16,548
社区成员




if(NULL == hMain)
{
return ;
}
if(::IsIconic(hMain))
{
::ShowWindow(hMain, SW_SHOWMAXIMIZED);
} ::BringWindowToTop(hMain);
//::SetWindowPos(hMain, HWND_TOP, 0, 0, 0, 0, SWP_NOMOVE | SWP_NOSIZE);
::SetWindowPos(hMain, HWND_TOPMOST, 0, 0, 0, 0,SWP_NOMOVE|SWP_NOSIZE|SWP_FRAMECHANGED);
typedef void (WINAPI *PSWITCHTOTHISWINDOW) (HWND,BOOL);
PSWITCHTOTHISWINDOW SwitchToThisWindow;
HMODULE hUser32=GetModuleHandle(_T("user32"));
SwitchToThisWindow=(PSWITCHTOTHISWINDOW)GetProcAddress(hUser32,"SwitchToThisWindow");
//现在就可以使用此函数了
SwitchToThisWindow(hMain,TRUE);