if(::GetForegroundWindow() != GetSafeHwnd()) {
HWND hActiveWnd = ::GetForegroundWindow();
if(hActiveWnd != NULL) {
DWORD ThreadID = GetWindowThreadProcessId(hActiveWnd, NULL);
DWORD CurrentThreadID = GetCurrentThreadId();
if(CurrentThreadID != ThreadID) {
if(AttachThreadInput(CurrentThreadID, ThreadID, TRUE)) {
::BringWindowToTop(GetSafeHwnd());
AttachThreadInput(CurrentThreadID, ThreadID, FALSE);
}
}
}
}
윈도우 최상위로 끌어올리기
2009. 2. 24. 13:59