locked
Desktop Window RRS feed

  • Question

  • Hi.
    Dose anybody know how to create a window that will not come on top of other windows and be displayed in background?
    I was able to acomplish this by finding Program Manager window and setting the parent of the window to Program Manager handle. This works but the thing is my application will replace windows shell and there will be no explorer which is actually creates a program manager window.
    Is anybody aware of way to acomplish this?

    Friday, October 3, 2008 6:42 AM

Answers

  • You can use ::SetWindowPos() with second parameter as
    HWND_NOTOPMOST   or  HWND_BOTTOM 


     ::SetWindowPos(m_hWnd ,       // handle to window 
                    HWND_BOTTOM,       // placement-order handle
                    10,       // horizontal position
                    10,      // vertical position
                    100,   // width
                    100,  // height
                    SWP_SHOWWINDOW // window-positioning options);



    Vikas
    Friday, October 3, 2008 3:10 PM

All replies

  • You can use ::SetWindowPos() with second parameter as
    HWND_NOTOPMOST   or  HWND_BOTTOM 


     ::SetWindowPos(m_hWnd ,       // handle to window 
                    HWND_BOTTOM,       // placement-order handle
                    10,       // horizontal position
                    10,      // vertical position
                    100,   // width
                    100,  // height
                    SWP_SHOWWINDOW // window-positioning options);



    Vikas
    Friday, October 3, 2008 3:10 PM
  • I have already tried that. The only thing i acomplished this way is to display the window at the bottom but it would still change it zorder and came on top of other windows when clicked.
    Friday, October 3, 2008 3:20 PM
  • if problem is only setting active window then a simple approach is ,before creating your Window Simply call GetActiveWindow() method which will return you the handle of your active Window. And after you had done with your Window Create simply call SetActiveWindow() with the handle of ActiveWindow that's all you have to do.

    Thanx

    Rupesh Shukla
    Friday, October 3, 2008 6:08 PM
  • The problem is that i dont want my window to be activated and focused when clicked.
    Saturday, October 4, 2008 1:23 PM
  • That  is what i told you in my previous post .Your last active window will be ActiveWindow after the creation of new window

    Thanx

    Rupesh Shukla
    Saturday, October 4, 2008 2:25 PM
  • This will not work.

    Saturday, October 4, 2008 2:45 PM
  • Ok i finaly managed to fix this inside wndproc :) Thanks everybody!
    Saturday, October 4, 2008 4:13 PM
  • It Will Work

    Thanx

    Rupesh Shukla
    Sunday, October 5, 2008 7:06 AM
  • Ok i will try this to :) Thanks Pintu
    Sunday, October 5, 2008 7:50 PM