Update of /cvsroot/pywin32/pywin32/Pythonwin
In directory sc8-pr-cvs1:/tmp/cvs-serv10020
Modified Files:
dbgthread.cpp
Log Message:
Re-create the taskbar icons if explorer dies.
Index: dbgthread.cpp
===================================================================
RCS file: /cvsroot/pywin32/pywin32/Pythonwin/dbgthread.cpp,v
retrieving revision 1.1
retrieving revision 1.2
diff -C2 -d -r1.1 -r1.2
*** dbgthread.cpp 1 Sep 1999 23:32:59 -0000 1.1
--- dbgthread.cpp 6 Oct 2003 11:09:14 -0000 1.2
***************
*** 64,72 ****
}
}
LRESULT CALLBACK DebuggerWndProc( HWND hWnd, UINT msg, WPARAM wParam,
LPARAM lParam )
{
!
! switch( msg ) {
case WM_COMMAND:
break;
--- 64,85 ----
}
}
+
+ static void AddIcons(HWND hwndDebug)
+ {
+ HICON hIcon = AfxGetApp()->LoadIcon( MAKEINTRESOURCE(IDR_MAINFRAME) );
+ DWORD flags = NIF_ICON | NIF_MESSAGE | NIF_TIP;
+ NOTIFYICONDATA nid = { sizeof(NOTIFYICONDATA), hwndDebug, 0, flags, WM_USER+20, hIcon };
+ _tcscpy(nid.szTip, "Pythonwin");
+ Shell_NotifyIcon(NIM_ADD, &nid);
+ }
+
LRESULT CALLBACK DebuggerWndProc( HWND hWnd, UINT msg, WPARAM wParam,
LPARAM lParam )
{
! static UINT s_uTaskbarRestart;
! switch( msg ) {
! case WM_CREATE:
! s_uTaskbarRestart = RegisterWindowMessage(TEXT("TaskbarCreated"));
! break;
case WM_COMMAND:
break;
***************
*** 84,87 ****
--- 97,102 ----
\**************************************************************/
default:
+ if(msg==s_uTaskbarRestart)
+ AddIcons(hWnd);
return( DefWindowProc( hWnd, msg, wParam, lParam ));
}
***************
*** 97,101 ****
}
-
DWORD DebuggerThreadFunc( LPDWORD lpdwWhatever )
{
--- 112,115 ----
***************
*** 121,129 ****
NULL, NULL, AfxGetInstanceHandle(), NULL );
! HICON hIcon = AfxGetApp()->LoadIcon( MAKEINTRESOURCE(IDR_MAINFRAME) );
! DWORD flags = NIF_ICON | NIF_MESSAGE | NIF_TIP;
! NOTIFYICONDATA nid = { sizeof(NOTIFYICONDATA), hwndDebug, 0, flags, WM_USER+20, hIcon };
! _tcscpy(nid.szTip, "Pythonwin");
! Shell_NotifyIcon(NIM_ADD, &nid);
while (GetMessage(&msg, 0, 0, NULL))
--- 135,139 ----
NULL, NULL, AfxGetInstanceHandle(), NULL );
! AddIcons(hwndDebug);
while (GetMessage(&msg, 0, 0, NULL))
|