일 | 월 | 화 | 수 | 목 | 금 | 토 |
---|---|---|---|---|---|---|
1 | 2 | 3 | 4 | |||
5 | 6 | 7 | 8 | 9 | 10 | 11 |
12 | 13 | 14 | 15 | 16 | 17 | 18 |
19 | 20 | 21 | 22 | 23 | 24 | 25 |
26 | 27 | 28 | 29 | 30 | 31 |
Tags
- pandas
- CNN
- E-P1
- RNN
- Lotto
- Python
- SciPy
- SPL
- GT-S80
- Series
- imread
- LSTM
- synology
- index
- pycharm
- mean
- ipad
- pip
- Splunk
- 삼성소프트웨어멤버십
- keras
- mariadb
- 알고리즘
- DFS
- install
- GitHub
- javascript
- Numpy
- Button
- dataframe
Archives
- Today
- Total
잠토의 잠망경
CreateProcess 본문
#undef UNICODE #include#include #define MAX_PATH 100 void CreateProcess00() { STARTUPINFO si={sizeof(STARTUPINFO),}; PROCESS_INFORMATION pi; //Process를 실행시키는 명령어 CreateProcess(NULL, //lpApplicationName "NotePad.exe", //lpCommandLine NULL, NULL, FALSE, 0, NULL, NULL, &si, //lpStartupInfo &pi); //lpProcessInfomation CloseHandle(pi.hProcess); CloseHandle(pi.hThread); } void CreateProcess01() { STARTUPINFO si={sizeof(STARTUPINFO),}; PROCESS_INFORMATION pi; CHAR Path[MAX_PATH]={0,}; GetWindowsDirectoryA(Path,MAX_PATH); lstrcat(Path,"\\NotePad.exe"); //Process를 실행시키는 명령어 CreateProcess(Path, //lpApplicationName NULL, //lpCommandLine NULL, NULL, FALSE, 0, NULL, NULL, &si, //lpStartupInfo &pi); //lpProcessInfomation CloseHandle(pi.hProcess); CloseHandle(pi.hThread); } void CreateProcess02() { STARTUPINFO si={sizeof(STARTUPINFO),}; PROCESS_INFORMATION pi; //Process를 실행시키는 명령어 CreateProcess(NULL, //lpApplicationName "NotePad.exe c:\\autoexe.bat", //lpCommandLine NULL, NULL, FALSE, 0, NULL, NULL, &si, //lpStartupInfo &pi); //lpProcessInfomation CloseHandle(pi.hProcess); CloseHandle(pi.hThread); } void CreateProcess03() { STARTUPINFO si={sizeof(STARTUPINFO),}; PROCESS_INFORMATION pi; //Process를 실행시키는 명령어 CreateProcess(NULL, //lpApplicationName "NotePad.exe", //lpCommandLine NULL, NULL, FALSE, 0, NULL, NULL, &si, //lpStartupInfo &pi); //lpProcessInfomation //프로세스 생성 직후 리턴하므로 초기화가 완료될때까지 기다려야 한다. WaitForInputIdle(pi.hProcess,INFINITE); HANDLE hMemo = FindWindow("NotePad",NULL); if(hMemo==INVALID_HANDLE_VALUE) { printf("FindWindows error\n"); return; } CloseHandle(pi.hProcess); CloseHandle(pi.hThread); } int main(void) { //CreateProcess00(); //CreateProcess01(); //CreateProcess02(); CreateProcess03(); return 0; }
Comments