Announcement

Collapse
No announcement yet.

Common Dialog and DUAL Monitor

Collapse
X
 
  • Filter
  • Time
  • Show
Clear All
new posts

  • Common Dialog and DUAL Monitor

    Centering common dialog has always been a pain with Windows.

    But trying to do it with DUAL monitor is almost impossible even using a dialog hook procedure, and it is still broken on VISTA.

    Anybody aware of a work around?

    I read that VISTA uses the registry to store info about the common dialog positions there:
    HKEY_CURRENT_USER\Software\Microsoft\Windows\CurrentVersion\Explorer\ComDlg32\CIDSizeMRU

    and the positions are remembered for each application and can be forced to reset by deleting the key associated with the application.
    But I don't want to edit the registry and jump from Charybde to Scylla.

    Am I the only one struggling with this?
    Patrice Terrier
    www.zapsolution.com
    www.objreader.com
    Addons: GDImage.DLL 32/64-bit (Graphic library), WinLIFT.DLL 32/64-bit (Skin Engine).

  • #2
    Is this different for XP?

    I never encountered an issue on XP.
    I don't have access to Vista with multiple monitors at home unf.

    I center my forms based on certain criteria, common dialogs follow fine (as should)
    hellobasic

    Comment


    • #3
      The problem occures when trying to center common load/save dialog within the size of an application that is shown on the second monitor that could be on the left (negative coordinates) or on the right (positive coordinates) from the main monitor.

      I read an interresting article about using a WH_CBT hook that perhaps could help me to solve this Windows bug.
      http://www.vbaccelerator.com/home/VB...gs/article.asp
      Patrice Terrier
      www.zapsolution.com
      www.objreader.com
      Addons: GDImage.DLL 32/64-bit (Graphic library), WinLIFT.DLL 32/64-bit (Skin Engine).

      Comment


      • #4
        Hmm, i never center these dialogs, they appear on the same monitor as their owner hWnd.

        Though you mentioned Vista.. i know..
        hellobasic

        Comment


        • #5
          Salut Patrice,

          Did you have a look at those 2 programs?
          Not sure about vista but they do well under XP with dual monitors.
          Last edited by Pierre Bellisle; 21 Sep 2007, 03:52 PM.

          Comment


          • #6
            The problem is that using either SetWindowPos or MoveWindow doesn't change anything, impossible to change x, y location, however width and height are working just fine...
            Patrice Terrier
            www.zapsolution.com
            www.objreader.com
            Addons: GDImage.DLL 32/64-bit (Graphic library), WinLIFT.DLL 32/64-bit (Skin Engine).

            Comment


            • #7
              This has worked well for me...

              Instead of centering the dialog on the desktop, try centering it on the current location of your program's main window. If your program is maximized the popup dialog will be centered on the same monitor. If your program is "restored" (various sizes) the dialog will still be centered logically.

              -- Eric
              "Not my circus, not my monkeys."

              Comment


              • #8
                try centering it on the current location of your program's main window
                It is exactly what I want to do, center it in my program's main window.

                Note: A quick search on Google, shows that this is a knwon issue with MS common dialog and dual monitor.
                Patrice Terrier
                www.zapsolution.com
                www.objreader.com
                Addons: GDImage.DLL 32/64-bit (Graphic library), WinLIFT.DLL 32/64-bit (Skin Engine).

                Comment

                Working...
                X