"Win API"의 두 판 사이의 차이
jjuiddong
35번째 줄: | 35번째 줄: | ||
CloseHandle( pi.hThread ); | CloseHandle( pi.hThread ); | ||
* [[Drag & Drop]] | * [[Drag & Drop]] | ||
+ | * [[Windows API 클립보드 복사,저장]] |
2015년 6월 3일 (수) 11:20 판
- 더블 버퍼링
- https://github.com/jjuiddong/wxMemMonitor 의 Target프로젝트의 target.cpp 파일에 구현되어 있다.
- http://msdn.microsoft.com/en-us/library/ms969905 사이트를 참조해서 구현했다.
- 실행인자값 가져오기
int nArgs; LPWSTR *szArglist = CommandLineToArgvW(GetCommandLineW(), &nArgs); if (nArgs > 1) { configFileName = wstr2str(szArglist[ 1]); SetConfigFileName( configFileName ); }
- 마우스 이벤트, 키보드 이벤트 처리
- mouse_event()
- mouse_event(MOUSEEVENTF_RIGHTDOWN,0,0,0,0);
- keybd_event()
- keybd_event(VK_ESCAPE, 0, KEYEVENTF_EXTENDEDKEY, 0);
- mouse_event()
- 프로세스 실행, 끝날 때까지 대기
STARTUPINFOA si = {0}; PROCESS_INFORMATION pi; ZeroMemory(&si,sizeof(si)); ZeroMemory(&pi,sizeof(pi)); si.cb = sizeof(STARTUPINFOA); si.dwFlags=STARTF_USESHOWWINDOW; si.wShowWindow=SW_SHOW; if (!::CreateProcessA(NULL, "WebExtractor.exe", NULL, NULL, FALSE, 0, NULL, NULL, &si, &pi)) { wxMessageBox( "Not Found WebExtractor" ); return; } WaitForSingleObject( pi.hProcess, INFINITE ); CloseHandle( pi.hProcess ); CloseHandle( pi.hThread );