分类: WINDOWS
2007-05-16 11:09:19
typedef BOOL (WINAPI *AllowSetForegroundWindowFn_t)(DWORD dwProcessId);
HMODULE hModule = NULL;
AllowSetForegroundWindowFn_t pProcAddress = NULL;
hModule = GetModuleHandle("User32");
if(hModule != NULL)
{
pProcAddress = (AllowSetForegroundWindowFn_t)GetProcAddress(hModule, "AllowSetForegroundWindow");
}
if (pProcAddress != NULL)
{
if(pProcAddress(-1))
{
SetForegroundWindow(Hwnd);
}
}
if(IsIconic(Hwnd))
{
ShowWindow(Hwnd,SW_RESTORE);
}