Question and Answer Database FAQ656C.txt sending messages with HINSTANCE to other window Category :Windows API Platform :All Product :BC++ 5.x Question: I spawned an app with ShellExecute. Now how do I send it messages so that I can resize it's window? Answer: use enumWindows with this function as CALLBACK : (of course the HINSTANCE handle will be the LPARAM... BOOL CALLBACK ProcessControl::GetWinHandle(HWND hwnd, LPARAM hproc) { if(hproc==GetWindowWord(hwnd,GWW_HINSTANCE)) { swProcess=hwnd; return FALSE; //stop enumeration : we've got the handle! } return TRUE; } 7/2/98 10:32:32 AM
Last Modified: 01-SEP-99