Get the HWND value of a Dialog
-
hi, i want to send a message from a thread to my Dialog, but how do i get the HWND value from my dialog? I created the dialog by doing DoModal() thanks in advance, []D [] []D []
-
nope, it gives back a NULL value... so i need to get it in another way... i don't even know if the dialog has its own HWND, maybe i need to get it in a different way. []D [] []D []
lets see...fromthe help files CWnd::GetSafeHwnd HWND GetSafeHwnd( ) const; Return Value Returns the window handle for a window. Returns NULL if the CWnd is not attached to a window or if it is used with a NULL CWnd pointer. are you getting the hwnd before you start the thread? Bryce
-
lets see...fromthe help files CWnd::GetSafeHwnd HWND GetSafeHwnd( ) const; Return Value Returns the window handle for a window. Returns NULL if the CWnd is not attached to a window or if it is used with a NULL CWnd pointer. are you getting the hwnd before you start the thread? Bryce
Sorry, i got the solution(STUPID STUPID!!!), i wanted to get the HWND value BEFORE i did a DoModal() on my dialog, no wonder it didn't work! Now i set the HWND value of the thread at the OnInitDialog with GetSafeHwnd() and it works fine!:);):):-D:-D thanks for your help! []D [] []D []