How to get Handler to window(HWND) that was created by function "ShellExecute" function?
Printable View
How to get Handler to window(HWND) that was created by function "ShellExecute" function?
ShellExecute() returns an HINSTANCE if successful. You need to call EnumWindows() to list all top-level windows, and then use
hInstWnd = (HINSTANCE)::GetWindowLong(hWnd, GWL_HINSTANCE)
on each of them to see if hInstWnd matches the instance returned from ShellExecute().