|
From: <jgr...@us...> - 2003-06-29 20:58:24
|
Update of /cvsroot/popfile/windows/POPFileIcon
In directory sc8-pr-cvs1:/tmp/cvs-serv32631
Modified Files:
icon.cpp icon.def icon.rc resource.h
Log Message:
Fix a resource leak because we were not deleting the icon object; add Hide POPFile Icon menu item; add confirmation dialog box for shutdown option
Index: icon.cpp
===================================================================
RCS file: /cvsroot/popfile/windows/POPFileIcon/icon.cpp,v
retrieving revision 1.2
retrieving revision 1.3
diff -C2 -d -r1.2 -r1.3
*** icon.cpp 6 May 2003 16:16:30 -0000 1.2
--- icon.cpp 29 Jun 2003 20:58:21 -0000 1.3
***************
*** 26,29 ****
--- 26,30 ----
bool gShutdown = false;
bool gUI = false;
+ bool gHideIcon = false;
// Used to store information about the POPFile icon displayed
***************
*** 78,82 ****
NULL ) ) {
case IDM_EXIT:
! gShutdown = true;
break;
case IDM_UI:
--- 79,88 ----
NULL ) ) {
case IDM_EXIT:
! if ( MessageBox( hwnd, "Are you sure you want to shutdown POPFile?", "Shutdown POPFile", MB_ICONQUESTION | MB_YESNO ) == IDYES ) {
! gShutdown = true;
! }
! break;
! case IDM_HIDEICON:
! gHideIcon = true;
break;
case IDM_UI:
***************
*** 158,164 ****
{
Shell_NotifyIcon( NIM_DELETE, &gNid );
!
DestroyWindow( gHwnd );
-
UnregisterClass( gClassName, ghInst );
}
--- 164,169 ----
{
Shell_NotifyIcon( NIM_DELETE, &gNid );
! DestroyIcon( gNid.hIcon );
DestroyWindow( gHwnd );
UnregisterClass( gClassName, ghInst );
}
***************
*** 183,186 ****
--- 188,211 ----
return 2;
}
+
+ if ( gHideIcon ) {
+ gHideIcon = false;
+ return 3;
+ }
+
+ return 0;
+ }
+
+ //---------------------------------------------------------------------------
+ //
+ // HideIcon
+ //
+ // Called to make the icon disappear
+ //
+ //---------------------------------------------------------------------------
+
+ int APIENTRY HideIcon()
+ {
+ HidePOPFileIcon__();
return 0;
Index: icon.def
===================================================================
RCS file: /cvsroot/popfile/windows/POPFileIcon/icon.def,v
retrieving revision 1.1
retrieving revision 1.2
diff -C2 -d -r1.1 -r1.2
*** icon.def 6 May 2003 16:11:56 -0000 1.1
--- icon.def 29 Jun 2003 20:58:21 -0000 1.2
***************
*** 3,5 ****
--- 3,6 ----
EXPORTS
GetMenuMessage @1
+ HideIcon @2
Index: icon.rc
===================================================================
RCS file: /cvsroot/popfile/windows/POPFileIcon/icon.rc,v
retrieving revision 1.1
retrieving revision 1.2
diff -C2 -d -r1.1 -r1.2
*** icon.rc 6 May 2003 16:11:56 -0000 1.1
--- icon.rc 29 Jun 2003 20:58:21 -0000 1.2
***************
*** 58,61 ****
--- 58,62 ----
BEGIN
MENUITEM "POPFile &UI", IDM_UI
+ MENUITEM "&Hide POPFile Icon", IDM_HIDEICON
MENUITEM SEPARATOR
MENUITEM "&Shutdown POPFile", IDM_EXIT
***************
*** 72,75 ****
--- 73,115 ----
// remains consistent on all systems.
IDI_POPFILE ICON "popfile.ico"
+
+ /////////////////////////////////////////////////////////////////////////////
+ //
+ // Version
+ //
+
+ VS_VERSION_INFO VERSIONINFO
+ FILEVERSION 1,0,0,1
+ PRODUCTVERSION 1,0,0,1
+ FILEFLAGSMASK 0x17L
+ #ifdef _DEBUG
+ FILEFLAGS 0x1L
+ #else
+ FILEFLAGS 0x0L
+ #endif
+ FILEOS 0x4L
+ FILETYPE 0x2L
+ FILESUBTYPE 0x0L
+ BEGIN
+ BLOCK "StringFileInfo"
+ BEGIN
+ BLOCK "040904b0"
+ BEGIN
+ VALUE "CompanyName", "The POPFile Project"
+ VALUE "FileDescription", "POPFile Tray Icon DLL"
+ VALUE "FileVersion", "1, 0, 0, 1"
+ VALUE "InternalName", "POPFileIcon.DLL"
+ VALUE "LegalCopyright", "Copyright (C) 2003 John Graham-Cumming"
+ VALUE "OriginalFilename", "POPFileIcon.dll"
+ VALUE "ProductName", "POPFile Tray Icon DLL"
+ VALUE "ProductVersion", "1, 0, 0, 1"
+ END
+ END
+ BLOCK "VarFileInfo"
+ BEGIN
+ VALUE "Translation", 0x409, 1200
+ END
+ END
+
#endif // English (U.S.) resources
/////////////////////////////////////////////////////////////////////////////
Index: resource.h
===================================================================
RCS file: /cvsroot/popfile/windows/POPFileIcon/resource.h,v
retrieving revision 1.1
retrieving revision 1.2
diff -C2 -d -r1.1 -r1.2
*** resource.h 6 May 2003 16:11:56 -0000 1.1
--- resource.h 29 Jun 2003 20:58:21 -0000 1.2
***************
*** 7,10 ****
--- 7,11 ----
#define IDM_EXIT 102
#define IDM_UI 103
+ #define IDM_HIDEICON 105
// Next default values for new objects
***************
*** 12,16 ****
#ifdef APSTUDIO_INVOKED
#ifndef APSTUDIO_READONLY_SYMBOLS
! #define _APS_NEXT_RESOURCE_VALUE 105
#define _APS_NEXT_COMMAND_VALUE 40001
#define _APS_NEXT_CONTROL_VALUE 1001
--- 13,17 ----
#ifdef APSTUDIO_INVOKED
#ifndef APSTUDIO_READONLY_SYMBOLS
! #define _APS_NEXT_RESOURCE_VALUE 106
#define _APS_NEXT_COMMAND_VALUE 40001
#define _APS_NEXT_CONTROL_VALUE 1001
|