[Gpa-commits] r753 - trunk/src

scm-commit@wald.intevation.org scm-commit at wald.intevation.org
Mon Mar 20 13:35:21 CET 2006


Author: werner
Date: 2006-03-20 13:35:20 +0100 (Mon, 20 Mar 2006)
New Revision: 753

Modified:
   trunk/src/ChangeLog
   trunk/src/hidewnd.c
Log:
Fixed console windows bug.


Modified: trunk/src/ChangeLog
===================================================================
--- trunk/src/ChangeLog	2006-03-13 18:54:51 UTC (rev 752)
+++ trunk/src/ChangeLog	2006-03-20 12:35:20 UTC (rev 753)
@@ -1,3 +1,8 @@
+2006-03-20  Werner Koch  <wk at g10code.com>
+
+	* hidewnd.c (enum_parent_windows): Updated test for newer
+	Windows versions.
+
 2006-03-13  Werner Koch  <wk at g10code.com>
 
 	* keygenwizard.c (gpa_keygen_wizard_generate_action): Init PARAMS

Modified: trunk/src/hidewnd.c
===================================================================
--- trunk/src/hidewnd.c	2006-03-13 18:54:51 UTC (rev 752)
+++ trunk/src/hidewnd.c	2006-03-20 12:35:20 UTC (rev 753)
@@ -20,6 +20,7 @@
 
 /* This module is only used in this environment */
 #if defined(__MINGW32__) || defined(__CYGWIN__)
+#include <stdio.h>
 
 #include <windows.h>
 
@@ -28,18 +29,21 @@
 static BOOL CALLBACK
 enum_parent_windows( HWND hwnd, LPARAM lparam )
 {
-	char wndclass[ 512 ];
-	char wndtext[ 512 ];
-
-	GetWindowText( hwnd, wndtext, sizeof( wndtext ) );
-	GetClassName( hwnd, wndclass, sizeof( wndclass ) );
-
-	if ( !strcmp( wndclass, "tty" ) && strstr( wndtext, "gpa" ) ) {
-		console_window = hwnd;
-		return FALSE;
-	}
-
-	return TRUE;
+  char wndclass[ 512 ];
+  char wndtext[ 512 ];
+  
+  GetWindowText( hwnd, wndtext, sizeof( wndtext ) );
+  GetClassName( hwnd, wndclass, sizeof( wndclass ) );
+  
+  if ( (!strcmp( wndclass, "tty" ) && strstr( wndtext, "gpa" ))
+       || (!strcmp ( wndclass, "ConsoleWindowClass" )
+           && (strstr (wndtext, "GPA") || strstr (wndtext, "gpa.exe"))))
+    {
+      console_window = hwnd;
+      return FALSE;
+    }
+  
+  return TRUE;
 }
 
 int



More information about the Gpa-commits mailing list