Thread: Window on top of just my app?

  1. #1
    Registered User
    Join Date
    Feb 2010
    Posts
    98

    Window on top of just my app?

    I already know about WS_EX_TOPMOST but that keeps my popup window on top of every other application too. Is there a simple setting/flag to keep it on top of just my apps windows?
    Thanks

  2. #2
    train spotter
    Join Date
    Aug 2001
    Location
    near a computer
    Posts
    3,868
    Have you looked at SetForegroundWindow() or SetActiveWindow()?
    "Man alone suffers so excruciatingly in the world that he was compelled to invent laughter."
    Friedrich Nietzsche

    "I spent a lot of my money on booze, birds and fast cars......the rest I squandered."
    George Best

    "If you are going through hell....keep going."
    Winston Churchill

  3. #3
    - - - - - - - - oogabooga's Avatar
    Join Date
    Jan 2008
    Posts
    2,808
    Make your main app window the parent of the popup.
    The cost of software maintenance increases with the square of the programmer's creativity. - Robert D. Bliss

  4. #4
    Registered User
    Join Date
    Feb 2010
    Posts
    98
    Thanks for your replies.
    All my child windows have the main app window as its parent.
    I would like to avoid keeping an HWND list and running checks with GetNextWindow/SetForegroundWindow
    I would also like to avoid setting/resetting styles in WM_ACTIVATEAPP/WM_SYSCOMMAND
    Just hoping for something simple rather than another hack.

  5. #5
    Registered User
    Join Date
    Feb 2010
    Posts
    98
    I meant... all my popups have the main as its parent.
    I use several popups at a time though.

  6. #6
    - - - - - - - - oogabooga's Avatar
    Join Date
    Jan 2008
    Posts
    2,808
    If your popups have the main window as their parent then they will be displayed above the parent. Isn't that what you're asking for? Is that not what you're seeing?
    The cost of software maintenance increases with the square of the programmer's creativity. - Robert D. Bliss

  7. #7
    Registered User
    Join Date
    Feb 2010
    Posts
    98
    All of my popups are on top of my main window (the parent).
    One of them is flagged WS_EX_TOPMOST to be on top of all the others.
    But, that flag makes it on top of every other app that is open.
    Example... If I open IE to surf the web, that one flagged popup is on top of IE (unless my app is minimized).

  8. #8
    - - - - - - - - oogabooga's Avatar
    Join Date
    Jan 2008
    Posts
    2,808
    So your original question is not very accurate. For what you want, some sort of "hack" is, I fear, inevitable.
    The cost of software maintenance increases with the square of the programmer's creativity. - Robert D. Bliss

  9. #9
    Registered User
    Join Date
    Feb 2010
    Posts
    98
    Yeh, I pretty much guessed after reading everything on Google that a hack would be my only solution.
    Thanks anyway.

Popular pages Recent additions subscribe to a feed

Similar Threads

  1. Changing the window frame styles causes the window to disappear
    By sethjackson in forum Windows Programming
    Replies: 2
    Last Post: 08-12-2010, 04:43 PM
  2. Access Function in Child Window From Parent Window
    By Welder in forum Windows Programming
    Replies: 3
    Last Post: 05-20-2008, 03:06 AM
  3. parent window minimizing on child window destruction
    By Yarin in forum Windows Programming
    Replies: 1
    Last Post: 03-02-2008, 09:34 AM
  4. Creating a child window in a parent window
    By vopo in forum Windows Programming
    Replies: 8
    Last Post: 10-06-2007, 04:15 PM
  5. Retrieving the window handle of a window a control resides in
    By -leech- in forum Windows Programming
    Replies: 7
    Last Post: 08-09-2003, 08:55 AM