Thread: Always On Top

  1. #1
    Registered User
    Join Date
    Aug 2004
    Posts
    23

    Always On Top

    im creating a simple program, which consists of a single message box which i want to have the always on top feature often seen in programs like msn messenger .etc is this possible with a messagebox? and if so how?

  2. #2
    Reverse Engineer maxorator's Avatar
    Join Date
    Aug 2005
    Location
    Estonia
    Posts
    2,318
    I think you must create your own dialog box or window for this, but I can be wrong.

  3. #3
    Registered User
    Join Date
    Sep 2004
    Posts
    57
    Use this extended window style: WS_EX_TOPMOST

  4. #4
    Reverse Engineer maxorator's Avatar
    Join Date
    Aug 2005
    Location
    Estonia
    Posts
    2,318
    Code:
    MessageBox(HWND_DESKTOP,"Text","Title",MB_OK|WS_EX_TOPMOST);
    This results a message box with "cancel" and "help" buttons, but still doesn't make it topmost.

  5. #5
    Registered User
    Join Date
    Sep 2004
    Posts
    57
    MB_TOPMOST

    Code:
    #include <windows.h>
    
    int main() {
       MessageBox(HWND_DESKTOP,"Text","Title",MB_OK|MB_TOPMOST);
    }

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, 06:12 AM
  2. Button handler
    By Nephiroth in forum Windows Programming
    Replies: 8
    Last Post: 03-12-2006, 06:23 AM
  3. OpenGL, loading BMP Textures?
    By Zeusbwr in forum Game Programming
    Replies: 12
    Last Post: 12-09-2004, 05:16 PM
  4. Odd 3D Invis Objects?
    By Zeusbwr in forum Game Programming
    Replies: 4
    Last Post: 12-07-2004, 07:01 PM
  5. Stack functions as arrays instead of node pointers
    By sballew in forum C Programming
    Replies: 8
    Last Post: 12-04-2001, 11:13 AM