always on top

This is a discussion on always on top within the Windows Programming forums, part of the Platform Specific Boards category; does anyone know how to make a window always on top?...

  1. #1
    mustang benny bennyandthejets's Avatar
    Join Date
    Jul 2002
    Posts
    1,401

    always on top

    does anyone know how to make a window always on top?
    benforbes@optusnet.com.au
    Microsoft Visual Studio .NET 2003 Enterprise Architect
    Windows XP Pro

    Code Tags
    Programming FAQ
    Tutorials

  2. #2
    Guest Sebastiani's Avatar
    Join Date
    Aug 2001
    Location
    Waterloo, Texas
    Posts
    5,699
    Maybe check for WM_FOCUSCHANGED and counter with a BringWindowToTop(hwnd)? Not sure, though...
    Code:
    bool fun(bool value)
    {
        return std::pow(std::exp(1), std::complex<float>(0, 1) 
        * std::complex<float>(std::atan(1)*(1 << (value + 2))))
        .real() > 0;
    }

  3. #3
    It's full of stars adrianxw's Avatar
    Join Date
    Aug 2001
    Posts
    4,831
    Call SetWindowPos(), specifying HWND_TOPMOST as the second parameter.
    Wave upon wave of demented avengers march cheerfully out of obscurity unto the dream.

  4. #4
    &TH of undefined behavior Fordy's Avatar
    Join Date
    Aug 2001
    Posts
    5,789
    Also, try ORing the WS_EX_TOPMOST style to the first param you pass to CreateWindowEx()

  5. #5
    erstwhile
    Join Date
    Jan 2002
    Posts
    2,227
    >>Also, try ORing the WS_EX_TOPMOST style to the first param you pass to CreateWindowEx()<<

    I was going to suggest that until I read (msdn):
    WS_EX_TOPMOST Specifies that a window created with this style should be placed above all nontopmost windows and stay above them even when the window is deactivated. An application can use the SetWindowPos member function to add or remove this attribute.
    So it seems that:

    >>Call SetWindowPos(), specifying HWND_TOPMOST as the second parameter.<<

    Is probably the most complete/flexible answer.

  6. #6
    mustang benny bennyandthejets's Avatar
    Join Date
    Jul 2002
    Posts
    1,401
    thanks, that works
    benforbes@optusnet.com.au
    Microsoft Visual Studio .NET 2003 Enterprise Architect
    Windows XP Pro

    Code Tags
    Programming FAQ
    Tutorials

Popular pages Recent additions subscribe to a feed

Similar Threads

  1. how to make opengl draw in lighter colors ?
    By jabka in forum Game Programming
    Replies: 2
    Last Post: 12-17-2007, 05:12 AM
  2. Button handler
    By Nephiroth in forum Windows Programming
    Replies: 8
    Last Post: 03-12-2006, 05:23 AM
  3. OpenGL, loading BMP Textures?
    By Zeusbwr in forum Game Programming
    Replies: 12
    Last Post: 12-09-2004, 04:16 PM
  4. Odd 3D Invis Objects?
    By Zeusbwr in forum Game Programming
    Replies: 4
    Last Post: 12-07-2004, 06:01 PM
  5. Stack functions as arrays instead of node pointers
    By sballew in forum C Programming
    Replies: 8
    Last Post: 12-04-2001, 10:13 AM

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