none
Get hWnd

    Question

  •  

    Is there any way to get a HWND without createwindow?  I am wanting to use async sockets and WSAAsyncSelect requires a HWND.  My server application won't be using a window.

     

    THanks

    Thursday, November 01, 2007 3:10 AM

Answers



  •  See you can use different Method but all of them Depend on your Requirement . In your case you Simply can use NULL at place of HWND .

    Few More Example is to get handle of window without Create are.
    GetActiveWindow() // Will return you the handle of the Active Window
    GetDesktopWindow() // Will return you handle of desktopWindow

    Thursday, November 01, 2007 4:18 AM

All replies



  •  See you can use different Method but all of them Depend on your Requirement . In your case you Simply can use NULL at place of HWND .

    Few More Example is to get handle of window without Create are.
    GetActiveWindow() // Will return you the handle of the Active Window
    GetDesktopWindow() // Will return you handle of desktopWindow

    Thursday, November 01, 2007 4:18 AM
  • Thanks!  I tried GetActiveWindow and it didn't return a valid handle.  I assume it is because there wasn't a window created initially?  GetDesktopWindow did return a valid handle but i'm wondering will this handle be valid through through the uptime of the PC?

    Thursday, November 01, 2007 2:28 PM