]> asedeno.scripts.mit.edu Git - PuTTY.git/commitdiff
Pageant now detects if it is already running and refuses to start if so
authorSimon Tatham <anakin@pobox.com>
Mon, 25 Sep 2000 10:56:56 +0000 (10:56 +0000)
committerSimon Tatham <anakin@pobox.com>
Mon, 25 Sep 2000 10:56:56 +0000 (10:56 +0000)
[originally from svn r624]

pageant.c

index 1619749035f370e6e94e82a89fee98f93306f03b..f8d7ad2dd372a27f25237d52662c199eb6de3533 100644 (file)
--- a/pageant.c
+++ b/pageant.c
@@ -545,6 +545,15 @@ int WINAPI WinMain(HINSTANCE inst, HINSTANCE prev, LPSTR cmdline, int show) {
     WNDCLASS wndclass;
     MSG msg;
 
+    /*
+     * First bomb out totally if we are already running.
+     */
+    if (FindWindow("Pageant", "Pageant")) {
+        MessageBox(NULL, "Pageant is already running", "Pageant Error",
+                   MB_ICONERROR | MB_OK);
+        return 0;
+    }
+
     instance = inst;
 
     if (!prev) {