标签:重新启动 findwindowa
如题:
在代码的入口处添加:
int WINAPI _tWinMain(HINSTANCE hInstance, HINSTANCE /*hPrevInstance*/, LPTSTR lpstrCmdLine, int nCmdShow)
{
if (try_show_first_windows(NULL, "魔方服务控制台"))
{
return 0;
}
BOOL try_show_first_windows(LPCSTR cls, LPCSTR wnd_cap)
{
HWND hTheWest = FindWindowA(cls, wnd_cap);
if (hTheWest)
{
CWindow cds;
cds.Attach(hTheWest);
cds.ShowWindow(SW_RESTORE);
cds.SetWindowPos(HWND_TOP, NULL, NULL, NULL, NULL, SWP_NOSIZE | SWP_NOREPOSITION);
cds.CenterWindow(hTheWest);
return TRUE;
}
else
{
return FALSE;
}
}点击快捷方式,不重新启动程序而是让程序窗口重新显示的解决方案
标签:重新启动 findwindowa
原文地址:http://blog.csdn.net/qingzai_/article/details/46633311