--- trunk/init/GPGOEInit.c 2006/06/04 10:12:47 19 +++ trunk/init/GPGOEInit.c 2011/12/13 10:40:30 24 @@ -12,10 +12,6 @@ * but WITHOUT ANY WARRANTY; without even the implied warranty of * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the * GNU General Public License for more details. - * - * You should have received a copy of the GNU Lesser General Public License - * along with GPGOE; if not, write to the Free Software Foundation, - * Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA */ #ifdef HAVE_CONFIG_H @@ -46,6 +42,8 @@ /* Global module handle. */ static HINSTANCE glob_hinst = NULL; + +/* Valid options for the plug-in. */ struct { int decrypt_replies; int cache_passwd; @@ -70,7 +68,8 @@ PROCESSENTRY32 pe; HANDLE hd; BOOL next; - int fnd = 0; + size_t i; + int fnd; hd = CreateToolhelp32Snapshot (TH32CS_SNAPPROCESS, 0); if (hd == (HANDLE)-1) @@ -79,9 +78,8 @@ memset (&pe, 0, sizeof (pe)); pe.dwSize = sizeof (pe); next = Process32First (hd, &pe); + fnd = 0; while (next) { - size_t i; - for (i=0; i < strlen (pe.szExeFile); i++) pe.szExeFile[i] = (char)toupper (pe.szExeFile[i]); for (i=0; conflict_apps[i] != NULL; i++) { @@ -91,8 +89,6 @@ } } next = Process32Next (hd, &pe); - if (!next) - break; } CloseHandle (hd); return fnd; @@ -109,22 +105,6 @@ } -#if 0 -/* Set the menu item @muid to the state @state. */ -void -set_menu_state (HMENU menu, UINT muid, UINT state) -{ - MENUITEMINFO mii; - - memset (&mii, 0, sizeof (mii)); - mii.cbSize = sizeof (mii); - mii.fMask = MIIM_STATE; - mii.fState = state; - SetMenuItemInfo (menu, muid, FALSE, &mii); -} -#endif - - /* Get an option with the name @name from the registry. */ int get_gpgoe_option (const char *name) @@ -235,8 +215,7 @@ /* Main window procedure for the taskbar program. */ LRESULT CALLBACK gpgoe_main_proc (HWND hwnd, UINT msg, WPARAM wparam, LPARAM lparam) -{ - +{ NOTIFYICONDATA NID; POINT p; HMENU hm, popup; @@ -249,7 +228,7 @@ NID.uCallbackMessage = WM_USER; NID.hWnd = hwnd; NID.hIcon = LoadIcon (glob_hinst, MAKEINTRESOURCE (IDI_GPGOE)); - strcpy(NID.szTip, "GPG for Outlook Express"); + strcpy (NID.szTip, "GPG for Outlook Express"); Shell_NotifyIcon (NIM_ADD, &NID); DestroyIcon (NID.hIcon); @@ -260,7 +239,8 @@ if (opt.cache_passwd) gpgoe_set_active_modes (GPGOE_MODE_CACHEPASS); if (gpgoe_initialize ()) { - MessageBox (hwnd, "Couldn't register GPG OE hook", "Error", MB_ICONERROR|MB_OK); + MessageBox (hwnd, "Could not register GPG OE hook", + "Error", MB_ICONERROR|MB_OK); ExitProcess (0); } break; @@ -292,7 +272,8 @@ switch (lparam) { case WM_LBUTTONDBLCLK: SetForegroundWindow (hwnd); - id = MessageBox (NULL, "Remove the GPG OE plug-in from the system?", + id = MessageBox (NULL, + "Remove the GPG OE plug-in from the system?", "Are you sure?", MB_YESNO|MB_ICONINFORMATION); if (id == IDYES) SendMessage (hwnd, WM_DESTROY, 0, 0); @@ -331,7 +312,7 @@ char buf[256]; _snprintf (buf, sizeof (buf)-1, "GPGoe found an instance of a program which\n" - "might be effect the functionality of the plugin.\n" + "might effect the functionality of the plugin.\n" "\n" "Name of the process: %s\n" "\n" @@ -357,9 +338,11 @@ return 1; } - hwnd = CreateWindow ("GPGOE", "GPGOE", 0, 0, 0, 0, 0, NULL, NULL, hinst, NULL); + hwnd = CreateWindow ("GPGOE", "GPGOE", 0, 0, 0, 0, 0, + NULL, NULL, hinst, NULL); if (!hwnd) { - MessageBox (NULL, "Couldn't create window", "Error", MB_ICONERROR|MB_OK); + MessageBox (NULL, "Could not create window", + "Error", MB_ICONERROR|MB_OK); return 1; } UpdateWindow (hwnd);