Documente Academic
Documente Profesional
Documente Cultură
__in BOOL bInheritHandles, __in DWORD dwCreationFlags, __in_opt LPVOID lpEnvironment, __in_opt LPCTSTR lpCurrentDirectory, __in LPSTARTUPINFO lpStartupInfo, __out LPPROCESS_INFORMATION lpProcessInformation );
2
CreateProcess( MTQ.exe, NULL, // NULL, // NULL, // FALSE, // 0, // NULL, // NULL, // &si, // &pi ) // // Module name Command line Process handle not inheritable Thread handle not inheritable Set handle inheritance to FALSE No creation flags Use parent's environment block Use parent's starting directory Pointer to STARTUPINFO structure Pointer to PROCESS_INFORMATION structure
3
PROCESS_INFORMATION: typedef struct _PROCESS_INFORMATION { HANDLE hProcess; HANDLE hThread; DWORD dwProcessId; DWORD dwThreadId; } PROCESS_INFORMATION, *LPPROCESS_INFORMATION;
5 BOOL nReturnVal = TerminateProcess( hProcess, 9 ); CloseHandle (hProcess); } BOOL WINAPI __in_opt __in __in __in ); PostMessage( HWND hWnd, UINT Msg, WPARAM wParam, LPARAM lParam
6
HWND hProcess; hProcess = ::FindWindow(NULL, "TeachingPendant"); if (hProcess != 0) { ::PostMessage(hProcess, WM_QUIT, 0, 0); }