Commit in reactos/apps/tests/multithrdwin on MAIN
makefile+2-21.1 -> 1.2
multithrdwin.c+39-31.1 -> 1.2
+41-5
2 modified files
added buttons to test if a thread is hung

reactos/apps/tests/multithrdwin
makefile 1.1 -> 1.2
diff -u -r1.1 -r1.2
--- makefile	14 Dec 2003 16:11:40 -0000	1.1
+++ makefile	11 Mar 2004 14:44:48 -0000	1.2
@@ -1,4 +1,4 @@
-# $Id: makefile,v 1.1 2003/12/14 16:11:40 weiden Exp $
+# $Id: makefile,v 1.2 2004/03/11 14:44:48 weiden Exp $
 
 PATH_TO_TOP = ../../..
 
@@ -10,7 +10,7 @@
 
 TARGET_NAME = multithrdwin
 
-TARGET_SDKLIBS = kernel32.a gdi32.a
+TARGET_SDKLIBS = kernel32.a gdi32.a ntdll.a
 
 TARGET_OBJECTS = $(TARGET_NAME).o
 

reactos/apps/tests/multithrdwin
multithrdwin.c 1.1 -> 1.2
diff -u -r1.1 -r1.2
--- multithrdwin.c	14 Dec 2003 16:11:40 -0000	1.1
+++ multithrdwin.c	11 Mar 2004 14:44:48 -0000	1.2
@@ -15,6 +15,7 @@
 
 static HINSTANCE hAppInstance;
 static HANDLE WinCreatedEvent;
+static THRDCREATEWIN wnds[3];
 
 LRESULT WINAPI MultiWndProc(HWND, UINT, WPARAM, LPARAM);
 
@@ -47,7 +48,10 @@
             GetLastError());
     return 1;
   }
-  
+  CreateWindow("BUTTON","Sleep",WS_CHILD|WS_VISIBLE|WS_TABSTOP|WS_GROUP|BS_PUSHBUTTON, 10, 10, 70, 23, cw->Window, (PVOID)1, hAppInstance, NULL);
+  CreateWindow("BUTTON","1",WS_CHILD|WS_VISIBLE|WS_TABSTOP|WS_GROUP|BS_PUSHBUTTON, 83, 10, 20, 23, cw->Window, (PVOID)2, hAppInstance, NULL);
+  CreateWindow("BUTTON","2",WS_CHILD|WS_VISIBLE|WS_TABSTOP|WS_GROUP|BS_PUSHBUTTON, 105, 10, 20, 23, cw->Window, (PVOID)3, hAppInstance, NULL);
+  CreateWindow("BUTTON","3",WS_CHILD|WS_VISIBLE|WS_TABSTOP|WS_GROUP|BS_PUSHBUTTON, 127, 10, 20, 23, cw->Window, (PVOID)4, hAppInstance, NULL);
   while(GetMessage(&msg, NULL, 0, 0))
   {
     TranslateMessage(&msg);
@@ -65,7 +69,6 @@
 {
   WNDCLASS wc;
   int i;
-  static THRDCREATEWIN wnds[3];
   HANDLE Threads[3];
   
   hAppInstance = hInstance;
@@ -152,6 +155,8 @@
   HDC hDC;
   RECT Client;
   HBRUSH Brush;
+  DWORD Ret;
+  
   static COLORREF Colors[] =
     {
       RGB(0x00, 0x00, 0x00),
@@ -187,7 +192,38 @@
 	  }
 	EndPaint(hWnd, &ps);
 	break;
-
+      
+      case WM_COMMAND:
+        switch(LOWORD(wParam))
+        {
+          case 1:
+            Sleep(20000);
+            break;
+          case 2:
+          case 3:
+          case 4:
+            if(SendMessageTimeout(wnds[LOWORD(wParam) - 2].Window, WM_NULL, 0, 0, SMTO_ABORTIFHUNG, 1000, &Ret))
+            {
+              DbgPrint("SendMessageTimeout() OK");
+              MessageBox(hWnd, "SendMessageTimeout() OK", NULL, 0);
+            }
+            else
+            {
+              if(GetLastError() == ERROR_TIMEOUT)
+              {
+                DbgPrint("SendMessageTimeout() Timeout");
+                MessageBox(hWnd, "SendMessageTimeout() Timeout", NULL, 0);
+              }
+              else
+              {
+                DbgPrint("SendMessageTimeout() Failed");
+                MessageBox(hWnd, "SendMessageTimeout() Failed", NULL, 0);
+              }
+            }
+            break;
+        }
+        break;
+      
       case WM_DESTROY:
 	PostQuitMessage(0);
 	break;
CVSspam 0.2.8