summaryrefslogtreecommitdiffstats
path: root/src/test-native
diff options
context:
space:
mode:
authorRandolf Schultz <[email protected]>2013-11-29 03:18:25 +0100
committerSven Gothel <[email protected]>2013-11-29 03:18:25 +0100
commitefc158abbb2c282029aaa746e032ec678e374d7b (patch)
tree7bc6bc4f535ceda6d0cba90c608fe395c5ac2353 /src/test-native
parent586446311ea1ba87f98236d5347955bf99b465d6 (diff)
Bug 907 - Add native Windows test sending WM_GETTEXT to all windows and dumping the result. If working, Bug907 is fixed and hence DDT is working.
Diffstat (limited to 'src/test-native')
-rw-r--r--src/test-native/Bug907GetAllWindowNamesViaMessageDispatch.c34
1 files changed, 34 insertions, 0 deletions
diff --git a/src/test-native/Bug907GetAllWindowNamesViaMessageDispatch.c b/src/test-native/Bug907GetAllWindowNamesViaMessageDispatch.c
new file mode 100644
index 000000000..9144e965b
--- /dev/null
+++ b/src/test-native/Bug907GetAllWindowNamesViaMessageDispatch.c
@@ -0,0 +1,34 @@
+#define WIN32_LEAN_AND_MEAN
+#include <windows.h>
+#undef WIN32_LEAN_AND_MEAN
+
+#include <wingdi.h>
+#include <stddef.h>
+#include <stdio.h>
+
+BOOL CALLBACK EnumWindowsProc(HWND hwnd, LPARAM lParam)
+{
+ static int i = 0;
+ char buffer[255];
+ BOOL bRet = SendMessageTimeout(hwnd, WM_GETTEXT, 255, (LPARAM)buffer,
+ SMTO_ABORTIFHUNG, 1000/*ms*/, NULL);
+ if(bRet == 0) {
+ fprintf(stderr,"#%4d: FAILURE!\n", i++); fflush(stderr);
+ return FALSE;
+ } else {
+ fprintf(stderr,"#%4d: GOT: %s\n", i++, buffer); fflush(stderr);
+ return TRUE;
+ }
+}
+
+int main(int argc, char **argv)
+{
+ BOOL bRet = EnumWindows(EnumWindowsProc, 0);
+ if(bRet == 0)
+ {
+ fprintf(stderr,"ERROR!");
+ exit(EXIT_FAILURE);
+ }
+ fprintf(stderr,"SUCCESS!");
+ exit(EXIT_SUCCESS);
+}