[Herecast-commit] herecast/src/TodayItem whereami.cpp,1.9,1.10
Status: Beta
Brought to you by:
mdpaciga
|
From: Mark P. <mdp...@us...> - 2005-07-24 20:28:58
|
Update of /cvsroot/herecast/herecast/src/TodayItem In directory sc8-pr-cvs1.sourceforge.net:/tmp/cvs-serv9715/src/TodayItem Modified Files: whereami.cpp Log Message: moved init code into HerecastInit and HerecastCleanup, so it can be run without the today item Index: whereami.cpp =================================================================== RCS file: /cvsroot/herecast/herecast/src/TodayItem/whereami.cpp,v retrieving revision 1.9 retrieving revision 1.10 diff -C2 -d -r1.9 -r1.10 *** whereami.cpp 24 Jul 2005 19:34:20 -0000 1.9 --- whereami.cpp 24 Jul 2005 20:28:49 -0000 1.10 *************** *** 52,55 **** --- 52,57 ---- static INT InitilizeClasses(); VOID doScan(HWND hWnd); + extern "C" __declspec(dllexport) HWND HerecastInit(); + extern "C" __declspec(dllexport) void HerecastCleanup(); *************** *** 87,91 **** DestroyIcon(g_hIcon); ! DestroyWindow(g_hWndDummy); UnregisterClass((LPCTSTR)LoadString(g_hInst2, IDS_TODAY_APPNAME,0,0), g_hInst2); --- 89,94 ---- DestroyIcon(g_hIcon); ! //HerecastCleanup(); ! DestroyWindow(g_hWndDummy); UnregisterClass((LPCTSTR)LoadString(g_hInst2, IDS_TODAY_APPNAME,0,0), g_hInst2); *************** *** 420,423 **** --- 423,459 ---- } + + /*************************************************************************/ + /* Initilize/Cleanup the dummy window */ + /*************************************************************************/ + + extern "C" __declspec(dllexport) + HWND HerecastInit() + { + // create "dummy" window at the top level to receive messages from + // other applications + g_hWndDummy = CreateWindow(TEXT("Herecast"), TEXT("Herecast"), 0, + CW_USEDEFAULT, 0, CW_USEDEFAULT, 0, NULL, NULL, g_hInst2, NULL); + + if (g_hWndDummy) { + ShowWindow(g_hWndDummy, SW_HIDE); //this window is never actually shown + UpdateWindow(g_hWndDummy); + } + + return g_hWndDummy; + } + + + extern "C" __declspec(dllexport) + void HerecastCleanup() + { + if (g_hWndDummy) { + DestroyWindow(g_hWndDummy); + g_hWndDummy = NULL; + } + } + + + /*************************************************************************/ /* Initilize the DLL by creating a new window */ *************** *** 430,447 **** } ! ! // create "dummy" window at the top level to receive messages from ! // other applications ! g_hWndDummy = CreateWindow(TEXT("Herecast"), TEXT("Herecast"), 0, ! CW_USEDEFAULT, 0, CW_USEDEFAULT, 0, NULL, NULL, g_hInst2, NULL); ! ! if (!g_hWndDummy) { return NULL; } - ShowWindow(g_hWndDummy, SW_HIDE); //this window is never actually shown - UpdateWindow(g_hWndDummy); - - // create the main today item window LPCTSTR className = TEXT("dlgHerecastTodayItemClass"); --- 466,473 ---- } ! if (!HerecastInit()) { return NULL; } // create the main today item window LPCTSTR className = TEXT("dlgHerecastTodayItemClass"); *************** *** 455,460 **** // if the second window didn't work, destroy both and return if (!g_hWnd) { ! DestroyWindow(g_hWndDummy); ! g_hWndDummy = NULL; return NULL; } --- 481,485 ---- // if the second window didn't work, destroy both and return if (!g_hWnd) { ! HerecastCleanup(); return NULL; } |