윈도우를 Top으로 올리는건

SetWindowPos(hWnd, HWND_TOP, 0, 0, 0, 0, SWP_NOSIZE | SWP_NOMOVE);
로 하면 되긴하지만, 이건 같은 어플리케이션내의 윈도우만 가능하다.


다른 어플리케이션의 윈도우는 이렇게 한다.

void ForceSetTop(HWND hWnd)
{
DWORD fromId = GetCurrentThreadId();
DWORD toId = GetWindowThreadProcessId(GetForegroundWindow(), NULL);

AttachThreadInput(fromId, toId, TRUE);
SetWindowPos(hWnd, HWND_TOP, 0, 0, 0, 0, SWP_NOSIZE | SWP_NOMOVE);
AttachThreadInput(fromId, toId, FALSE);
}


'게임개발 > ' 카테고리의 다른 글

시스템 이미지 가져다 쓰기  (1) 2006.03.06
VS2005 실행모듈 배포하기  (1) 2006.02.14
Variadic Macros in VC2005  (0) 2006.01.23
Named Return Value Optimization in Visual C++ 2005  (0) 2006.01.04
VC2005 추가 키워드  (2) 2006.01.04

+ Recent posts