Thread: Common Dialogs

  1. #1
    Anal comment spacer DominicTrix's Avatar
    Join Date
    Apr 2002
    Posts
    120

    Question Common Dialogs

    Howdy, a very simple question (hope there's a simple answer!)

    Using the GetOpenFileName() and GetSaveFileName() common dialogs, how do you get the dialogs to appear in the centre of the screen rather than in the top left corner?

    Thanks in advance,

    dom
    "The most important thing about acting is honesty. If you can fake that you've got it made" - George Burns

  2. #2
    Registered User
    Join Date
    Dec 2002
    Posts
    16

    Window Ownership

    Did you set the "HWND hwndOwner" and "HINSTANCE hInstance" variables in the OPENFILENAME struct? If so, I believe the dialog should center on the owners window.

  3. #3
    Code Monkey Davros's Avatar
    Join Date
    Jun 2002
    Posts
    812
    I don't think you can set the position explicitly. I'm currently working the SHBrowseFolder call & there isn't any way to set that.

    Rather the dialogs will appear in a sensible location if you set the owner window handle.

  4. #4
    Anal comment spacer DominicTrix's Avatar
    Join Date
    Apr 2002
    Posts
    120
    Yes, I think thats right. Ah well, thanks for the help anyways!

    dt
    "The most important thing about acting is honesty. If you can fake that you've got it made" - George Burns

Popular pages Recent additions subscribe to a feed

Similar Threads

  1. How to handle multiple cases which use common code?
    By tmaxx in forum C Programming
    Replies: 3
    Last Post: 10-03-2008, 07:42 AM
  2. Modeless Dialogs in Multiple threads
    By MrGrieves in forum Windows Programming
    Replies: 0
    Last Post: 06-22-2004, 01:33 PM
  3. Common File Dialogs
    By pinkcheese in forum Windows Programming
    Replies: 2
    Last Post: 02-11-2003, 12:40 PM
  4. Lowest Common Factor
    By PJYelton in forum C++ Programming
    Replies: 9
    Last Post: 12-23-2002, 09:30 AM
  5. common dialogs
    By Shakespeare in forum Windows Programming
    Replies: 2
    Last Post: 02-15-2002, 06:18 PM