VOID PureSetForegroundWindow(HWND hWnd)
{
::AttachThreadInput(::GetCurrentThreadId(), ::GetWindowThreadProcessId(::GetForegroundWindow(), NULL), TRUE);
::ShowWindow(hWnd, SW_SHOWNORMAL);
::SetWindowPos(hWnd, HWND_TOPMOST, 0, 0, 0, 0, SWP_NOSIZE|SWP_NOMOVE);
::SetWindowPos(hWnd, HWND_NOTOPMOST,0, 0, 0, 0, SWP_NOSIZE|SWP_NOMOVE);
::SetForegroundWindow(hWnd);
::AttachThreadInput(::GetCurrentThreadId(),::GetWindowThreadProcessId(::GetForegroundWindow(), NULL), FALSE);
}
跨线程激活窗体
最新推荐文章于 2016-01-26 18:11:05 发布