Solve issue #11
This commit is contained in:
@@ -69,12 +69,13 @@ int WINAPI wWinMain(_In_ HINSTANCE hInstance, _In_opt_ HINSTANCE hPrevInstance,
|
|||||||
HANDLE hAccel;
|
HANDLE hAccel;
|
||||||
HMENU hMenu;
|
HMENU hMenu;
|
||||||
HMENU hSystemMenu;
|
HMENU hSystemMenu;
|
||||||
|
HWND hOldProgMgr;
|
||||||
WNDCLASS wc = { 0 };
|
WNDCLASS wc = { 0 };
|
||||||
WCHAR szBuffer[MAX_PATH];
|
WCHAR szBuffer[MAX_PATH];
|
||||||
RECT rcRoot;
|
RECT rcRoot;
|
||||||
POINT ptOffset = { 0 };
|
POINT ptOffset = { 0 };
|
||||||
|
|
||||||
// Initialize the instance
|
// Grab the instance
|
||||||
g_hAppInstance = hInstance;
|
g_hAppInstance = hInstance;
|
||||||
|
|
||||||
// Create Strings
|
// Create Strings
|
||||||
@@ -82,6 +83,16 @@ int WINAPI wWinMain(_In_ HINSTANCE hInstance, _In_opt_ HINSTANCE hPrevInstance,
|
|||||||
LoadString(g_hAppInstance, IDS_APPTITLE, g_szAppTitle, ARRAYSIZE(g_szAppTitle));
|
LoadString(g_hAppInstance, IDS_APPTITLE, g_szAppTitle, ARRAYSIZE(g_szAppTitle));
|
||||||
LoadString(g_hAppInstance, IDS_WEBSITE, g_szWebsite, ARRAYSIZE(g_szWebsite));
|
LoadString(g_hAppInstance, IDS_WEBSITE, g_szWebsite, ARRAYSIZE(g_szWebsite));
|
||||||
|
|
||||||
|
// Lazily search for another instance of Program Manager
|
||||||
|
// If we find one, switch focus to it and then abort.
|
||||||
|
hOldProgMgr = FindWindowEx(NULL, NULL, g_szClass, NULL);
|
||||||
|
|
||||||
|
if (hOldProgMgr != NULL)
|
||||||
|
{
|
||||||
|
SwitchToThisWindow(hOldProgMgr, FALSE);
|
||||||
|
return FALSE;
|
||||||
|
}
|
||||||
|
|
||||||
// Get Desktop background color
|
// Get Desktop background color
|
||||||
//CreateSolidBrush(GetBackgroundColor
|
//CreateSolidBrush(GetBackgroundColor
|
||||||
|
|
||||||
|
|||||||
Reference in New Issue
Block a user