본문 바로가기

My Study/Function

GetForegroundWindow

HWND GetForegroundWindow(void);

유저가 현재 작업하고 있는 윈도우의 핸들을 반환한다.

리턴
최상위 윈도우 핸들, 윈도우가 활성화를 잃을 때 NULL이 리턴 될 수도 있다.

ps..
Explorer의 CreateProcess 후킹해서 새로 생성되는 프로세스마다 인젝션을 수행시키는 방법보다
GetForegroundWindow함수를 써서 인젝션 시키는게 더욱 편할꺼 같네요..

'My Study > Function' 카테고리의 다른 글

IoCreateDevice, IoDeleteDevice 메모리 할당,해제  (0) 2010.12.20
GetDesktopWindow  (1) 2010.05.02
ContinueDebugEvent  (0) 2010.04.12
WaitForDebugEvent  (0) 2010.04.12
DebugActiveProcess  (0) 2010.04.12