父進(jìn)程:
char cmdline[256]; sprintf(cmdline, "%ld ", hwnd); CreateProcess( "child.exe ",cmdline,&sa,&sa,true,CREATE_DEFAULT_ERROR_MODE,NULL,NULL,&si,&pi); 子進(jìn)程中 : LPSTR cmdline = GetCommandLine(); 先解析出第二個參數(shù),然后用atol轉(zhuǎn)成HANDLE型 HANDLE hwnd = atol(...); |
|