From efc158abbb2c282029aaa746e032ec678e374d7b Mon Sep 17 00:00:00 2001 From: Randolf Schultz Date: Fri, 29 Nov 2013 03:18:25 +0100 Subject: 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. --- .../Bug907GetAllWindowNamesViaMessageDispatch.c | 34 ++++++++++++++++++++++ 1 file changed, 34 insertions(+) create mode 100644 src/test-native/Bug907GetAllWindowNamesViaMessageDispatch.c (limited to 'src/test-native/Bug907GetAllWindowNamesViaMessageDispatch.c') 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 +#undef WIN32_LEAN_AND_MEAN + +#include +#include +#include + +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); +} -- cgit v1.2.3