Fixing Z-order on a modeless dialog?

This is a discussion on Fixing Z-order on a modeless dialog? within the Windows Programming forums, part of the Platform Specific Boards category; I'm creating a modeless dialog that I want the use to be able to leave open while working in the ...

  1. #1
    Registered User
    Join Date
    Jun 2008
    Posts
    161

    Fixing Z-order on a modeless dialog?

    I'm creating a modeless dialog that I want the use to be able to leave open while working in the main window. Problem is, the modeless dialog is still on top when the main window gets focus. Do I have to catch a message in the main window's procedure when it gets focus and use SetWindowPos? If so, what bloody message? I can't find anything on MSDN.

  2. #2
    Malum in se abachler's Avatar
    Join Date
    Apr 2007
    Posts
    3,189
    Yes, that is the function of a modeless dialog box. Dialog boxes are alwasy at teh top of the Z order. In fact thats the whole point of using a dialog box instead of a regular window. If you want yours to go below the main window, you need to create a new window, not a dialog box.
    Until you can build a working general purpose reprogrammable computer out of basic components from radio shack, you are not fit to call yourself a programmer in my presence. This is cwhizard, signing off.

  3. #3
    Registered User
    Join Date
    Jun 2008
    Posts
    161
    Then how the hell do I create a new "window" from a resource template? That's what I thought CreateDialog() was for.

  4. #4
    Malum in se abachler's Avatar
    Join Date
    Apr 2007
    Posts
    3,189
    Lose the ........ty attitude and perhaps more people will be inclined to assist you.
    Until you can build a working general purpose reprogrammable computer out of basic components from radio shack, you are not fit to call yourself a programmer in my presence. This is cwhizard, signing off.

  5. #5
    Registered User
    Join Date
    Jun 2008
    Posts
    161
    I can't get the goddamn dialog/window to behave the way I want it to and it's ........ing me off.

  6. #6
    Registered User
    Join Date
    Jun 2008
    Posts
    161
    ahhhhh. This works. Just had to change the arguments.
    Code:
    hwndSearch = CreateDialog(hinstMain, MAKEINTRESOURCE(DLG_SEARCH_MIPS), HWND_DESKTOP, SearchDlg);

  7. #7
    Registered User
    Join Date
    Jun 2008
    Posts
    161
    hmmm. Not quite there. I can click either window to get it on top, but I can't figure out out to force the main window back on top with ShowWindow or SetWindowPos.

    edit: I got it.
    Last edited by Viper187; 06-20-2008 at 07:16 PM.

Popular pages Recent additions subscribe to a feed

Similar Threads

  1. Replies: 9
    Last Post: 02-13-2008, 01:59 PM
  2. Modeless Dialog Communication (MFC)
    By mhandlon in forum Windows Programming
    Replies: 8
    Last Post: 08-22-2006, 01:28 PM
  3. When my modeless dialog has been closed it doesn't open again
    By Frandy in forum Windows Programming
    Replies: 5
    Last Post: 11-21-2004, 07:45 AM
  4. Tab Controls - API
    By -KEN- in forum Windows Programming
    Replies: 7
    Last Post: 06-02-2002, 09:44 AM
  5. V C++; dialog box; tab order; advancing thru
    By alzado in forum C++ Programming
    Replies: 2
    Last Post: 01-02-2002, 02:56 PM

1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21