티스토리 뷰
반응형
#include <Windows.h>
int main()
{
STARTUPINFOW si = { 0 };
si.cb = sizeof(si);
PROCESS_INFORMATION pi = { 0 };
// Create the child process
BOOL success = CreateProcessW(
L"C:\\Windows\\system32\\notepad.exe", // Path to executable
NULL, // Command line arguments
NULL, // Process attributes
NULL, // Thread attributes
FALSE, // Inherit handles
0, // Creation flags
NULL, // Environment
NULL, // Working directory
&si, // Startup info
&pi); // Process information
if (success)
{
// Wait for the process to exit
WaitForSingleObject(pi.hProcess, INFINITE);
// Process has exited - check its exit code
DWORD exitCode;
GetExitCodeProcess(pi.hProcess, &exitCode);
// At this point exitCode is set to the process' exit code
// Handles must be closed when they are no longer needed
CloseHandle(pi.hThread);
CloseHandle(pi.hProcess);
}
}
반응형
'프로그래밍' 카테고리의 다른 글
winapi CreateFile 예제 (0) | 2022.01.27 |
---|---|
winapi 쓰레드 생성하기 (0) | 2022.01.27 |
스핀락을 사용하는 지원 루틴 호출 (0) | 2020.03.02 |
스핀 락 초기화 (0) | 2020.03.02 |
스핀 락 및 보호 된 데이터를위한 스토리지 제공 (0) | 2020.03.02 |
반응형
공지사항
최근에 올라온 글
최근에 달린 댓글
- Total
- Today
- Yesterday
링크
TAG
- ChatGPT
- 주식
- Linux
- react
- 커널드라이버
- 스핀락
- JavaScript
- JSX
- 생각
- ios
- Windows
- 유튜브
- Frontend
- Python
- go
- 예제
- Spring
- reactjs
- HTML
- SWiFT
- 부동산
- 투자
- WinAPI
- CSS
- frida
- 트렌드
- Backend
- Java
- golang
- 파이썬
일 | 월 | 화 | 수 | 목 | 금 | 토 |
---|---|---|---|---|---|---|
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 |
글 보관함