Thread: fulscreen window needs to stay on top!!

  1. #1
    Registered User canine's Avatar
    Join Date
    Sep 2001
    Posts
    125

    Smile fulscreen window needs to stay on top!!

    I have a window that is created hidden and using timers, in fifteen seconds the ShowWindow func. opens it up. the window is fullscreen; not as in maximized but the whole screen is client area.
    in that fifteen seconds, when it opens how can I make it so it comes out on top of everything, including the task bar no matter what the other window are doing? Also i need to make it so it can not be alt tabbed or anything it needs to stay on top until it closes! how would i do these things?
    Thanx in advance!
    In a perfect world every dog would have a home and every home would have a dog.
    Visit My Web Site, Canine Programming
    I use Win32 API

  2. #2
    Registered User
    Join Date
    Nov 2001
    Posts
    1,348
    This is one solution to set a window to stay in focus using MFC.

    -----
    // enable focused

    AfxGetMainWnd()->SendMessage(WM_USER_FOCUSED, static_cast<WPARAM>(1), 0);


    // disable focused

    AfxGetMainWnd()->SendMessage(WM_USER_FOCUSED, static_cast<WPARAM>(0), 0);
    -----

    Kuphryn

  3. #3
    Registered User canine's Avatar
    Join Date
    Sep 2001
    Posts
    125
    i dont know if i can use that i know nothing about mfc and i use API mabey it'll work. will it?
    In a perfect world every dog would have a home and every home would have a dog.
    Visit My Web Site, Canine Programming
    I use Win32 API

  4. #4
    Registered User
    Join Date
    Nov 2001
    Posts
    1,348
    I believe you can use Win32 API in an MFC project, however; you cannot use MFC in a Win32 API application.

    Kuphryn

  5. #5
    Registered User canine's Avatar
    Join Date
    Sep 2001
    Posts
    125
    is there another way before I make a whole new project in MFC?
    In a perfect world every dog would have a home and every home would have a dog.
    Visit My Web Site, Canine Programming
    I use Win32 API

  6. #6
    erstwhile
    Join Date
    Jan 2002
    Posts
    2,227
    Create the window with the WS_EX_TOPMOST extended window style.
    CProgramming FAQ
    Caution: this person may be a carrier of the misinformation virus.

  7. #7
    Registered User canine's Avatar
    Join Date
    Sep 2001
    Posts
    125
    hmm it didn't quite work
    In a perfect world every dog would have a home and every home would have a dog.
    Visit My Web Site, Canine Programming
    I use Win32 API

  8. #8
    erstwhile
    Join Date
    Jan 2002
    Posts
    2,227
    Try SetWindowPos then to set your window to top of z-order:
    Code:
    SetWindowPos(hwnd,HWND_TOPMOST,0,0,0,0,SWP_NOMOVE|SWP_NOSIZE);

  9. #9
    Registered User
    Join Date
    Jul 2002
    Posts
    2
    Try this:
    SetFocus(hWnd);

Popular pages Recent additions subscribe to a feed

Similar Threads

  1. Just starting Windows Programming, School me!
    By Shamino in forum Windows Programming
    Replies: 17
    Last Post: 02-22-2008, 08:14 AM
  2. Taskbars; 'Cannot create top level child window'
    By Gerread in forum Windows Programming
    Replies: 4
    Last Post: 05-18-2007, 06:41 AM
  3. Adding colour & bmps to a Win 32 Window??
    By carey_sizer in forum Windows Programming
    Replies: 4
    Last Post: 09-04-2004, 05:55 PM
  4. Tab Controls - API
    By -KEN- in forum Windows Programming
    Replies: 7
    Last Post: 06-02-2002, 09:44 AM
  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