将一个窗口显示到最前面的源代码

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);
}

<!-- google_ad_client = "pub-2416224910262877"; google_ad_width = 468; google_ad_height = 60; google_ad_format = "468x60_as"; google_ad_type = "image"; google_ad_channel = ""; // -->

你可能感兴趣的:(Google)