Get HWND from HINSTANCE
-
Hi I have a HINSTANCE, I want to get HWND from it. Can you help me? Thanks for your reading. Tran Hoang Chuong
-
Hi I have a HINSTANCE, I want to get HWND from it. Can you help me? Thanks for your reading. Tran Hoang Chuong
HINSTANCE is an instance handle to an application and an application can have many or no windows. I don't see how you would retrieve one HWND from any HINSTANCE. If your using MFC then CWinThread::m_pMainWnd holds the pointer to the application main window and from here you could use EnumChildWindows() to get the others... Cheers! :) "An expert is someone who has made all the mistakes in his or her field" - Niels Bohr
-
HINSTANCE is an instance handle to an application and an application can have many or no windows. I don't see how you would retrieve one HWND from any HINSTANCE. If your using MFC then CWinThread::m_pMainWnd holds the pointer to the application main window and from here you could use EnumChildWindows() to get the others... Cheers! :) "An expert is someone who has made all the mistakes in his or her field" - Niels Bohr
Hi HockeyDude I forgot to tell more detail about my question. It means I have a HINSTANCE from a command ShellExecute(...) and I want to get CWnd of the application I have just exectuted. Thanks for your reply. Tran Hoang Chuong
-
Hi HockeyDude I forgot to tell more detail about my question. It means I have a HINSTANCE from a command ShellExecute(...) and I want to get CWnd of the application I have just exectuted. Thanks for your reply. Tran Hoang Chuong
I think the CWinThread is no good to you then. :) I don't know of any function which would return the window handle associated with an HINSTANCE. Except EnumChildWindows which only returns child windows of a parent. Can you use FindWindow()...? "An expert is someone who has made all the mistakes in his or her field" - Niels Bohr
-
I think the CWinThread is no good to you then. :) I don't know of any function which would return the window handle associated with an HINSTANCE. Except EnumChildWindows which only returns child windows of a parent. Can you use FindWindow()...? "An expert is someone who has made all the mistakes in his or her field" - Niels Bohr
Hi HockeyDude Thank you very much Tran Hoang Chuong
-
Hi HockeyDude Thank you very much Tran Hoang Chuong
if you figured it out that's all that matters "An expert is someone who has made all the mistakes in his or her field" - Niels Bohr