Simple Win32 caption clock.
authorEmanuele Aliberti <ea@iol.it>
Thu, 4 Sep 2003 21:33:11 +0000 (21:33 +0000)
committerEmanuele Aliberti <ea@iol.it>
Thu, 4 Sep 2003 21:33:11 +0000 (21:33 +0000)
It exposes a bug possibly in win32k.sys which causes a system crash.

svn path=/trunk/; revision=5983

reactos/apps/tests/capclock/Makefile [new file with mode: 0644]
reactos/apps/tests/capclock/capclock.c [new file with mode: 0644]
reactos/apps/tests/capclock/capclock.ico [new file with mode: 0644]
reactos/apps/tests/capclock/capclock.rc [new file with mode: 0644]

diff --git a/reactos/apps/tests/capclock/Makefile b/reactos/apps/tests/capclock/Makefile
new file mode 100644 (file)
index 0000000..0e849b8
--- /dev/null
@@ -0,0 +1,18 @@
+
+PATH_TO_TOP = ../../..
+
+TARGET_TYPE = program
+
+TARGET_APPTYPE = windows
+
+TARGET_NAME = capclock
+
+TARGET_SDKLIBS = kernel32.a
+
+TARGET_OBJECTS = capclock.o
+
+include $(PATH_TO_TOP)/rules.mak
+
+include $(TOOLS_PATH)/helper.mk
+
+# EOF
diff --git a/reactos/apps/tests/capclock/capclock.c b/reactos/apps/tests/capclock/capclock.c
new file mode 100644 (file)
index 0000000..4099d7c
--- /dev/null
@@ -0,0 +1,69 @@
+/* $Id: capclock.c,v 1.1 2003/09/04 21:33:11 ea Exp $
+ *
+ * DESCRIPTION: Simple Win32 Caption Clock
+ * PROJECT    : ReactOS (test applications)
+ * AUTHOR     : Emanuele Aliberti
+ * DATE       : 2003-09-03
+ * LICENSE    : GNU GPL v2.0
+ */
+#include <windows.h>
+
+UINT Timer = 1;
+
+static BOOL CALLBACK DialogFunc(HWND,UINT,WPARAM,LPARAM);
+static VOID CALLBACK TimerProc(HWND,UINT,UINT,DWORD);
+
+
+INT STDCALL WinMain (HINSTANCE hinst, HINSTANCE hinstPrev, LPSTR lpCmdLine, INT nCmdShow)
+{
+       WNDCLASS wc;
+
+       ZeroMemory (& wc, sizeof wc);
+       wc.lpfnWndProc    = DefDlgProc;
+       wc.cbWndExtra     = DLGWINDOWEXTRA;
+       wc.hInstance      = hinst;
+       wc.hCursor        = LoadCursor(NULL, IDC_ARROW);
+       wc.hbrBackground  = (HBRUSH) (COLOR_WINDOW + 1);
+       wc.lpszClassName  = "CapClock";
+       RegisterClass (& wc);
+       return DialogBox(hinst, MAKEINTRESOURCE(2), NULL, (DLGPROC) DialogFunc);
+
+}
+static int InitializeApp (HWND hDlg,WPARAM wParam, LPARAM lParam)
+{
+       Timer = SetTimer (hDlg,Timer,1000,TimerProc);
+       TimerProc (hDlg,0,0,0);
+       return 1;
+}
+static BOOL CALLBACK DialogFunc (HWND hwndDlg, UINT msg, WPARAM wParam, LPARAM lParam)
+{
+       switch (msg)
+       {
+       case WM_INITDIALOG:
+               InitializeApp(hwndDlg,wParam,lParam);
+               return TRUE;
+       case WM_CLOSE:
+               KillTimer (hwndDlg,Timer);
+               EndDialog(hwndDlg,0);
+               return TRUE;
+       }
+       return FALSE;
+}
+static VOID CALLBACK TimerProc (HWND hwnd, UINT uMsg, UINT idEvent, DWORD dwTime)
+{
+       CHAR text [20];
+       SYSTEMTIME lt;
+
+       GetLocalTime (& lt);
+       wsprintf (
+               text,
+               "%d-%02d-%02d %02d:%02d:%02d",
+               lt.wYear,
+               lt.wMonth,
+               lt.wDay,
+               lt.wHour,
+               lt.wMinute,
+               lt.wSecond);
+       SetWindowText (hwnd, text);
+}
+/* EOF */
diff --git a/reactos/apps/tests/capclock/capclock.ico b/reactos/apps/tests/capclock/capclock.ico
new file mode 100644 (file)
index 0000000..0b52fb0
Binary files /dev/null and b/reactos/apps/tests/capclock/capclock.ico differ
diff --git a/reactos/apps/tests/capclock/capclock.rc b/reactos/apps/tests/capclock/capclock.rc
new file mode 100644 (file)
index 0000000..886043d
--- /dev/null
@@ -0,0 +1,52 @@
+#include <windows.h>
+#include "../../../include/reactos/resource.h"
+
+/* Icons */
+
+1 ICON "capclock.ico"
+
+/* Dialogs */
+
+2 DIALOG 6, 18, 132, 0
+STYLE DS_MODALFRAME | WS_POPUP | WS_VISIBLE | WS_CAPTION | WS_SYSMENU
+FONT 8, "Microsoft Sans Serif"
+BEGIN
+END
+
+LANGUAGE LANG_ENGLISH, SUBLANG_ENGLISH_US
+
+/* Version information. */
+
+VS_VERSION_INFO VERSIONINFO
+       FILEVERSION     RES_UINT_FV_MAJOR,RES_UINT_FV_MINOR,RES_UINT_FV_REVISION,RES_UINT_FV_BUILD
+       PRODUCTVERSION  RES_UINT_PV_MAJOR,RES_UINT_PV_MINOR,RES_UINT_PV_REVISION,RES_UINT_PV_BUILD
+       FILEFLAGSMASK   0x3fL
+#ifdef _DEBUG
+       FILEFLAGS       0x1L
+#else
+       FILEFLAGS       0x0L
+#endif
+       FILEOS          0x40004L
+       FILETYPE        0x2L
+       FILESUBTYPE     0x0L
+BEGIN
+    BLOCK "StringFileInfo"
+    BEGIN
+        BLOCK "040904b0"
+        BEGIN
+            VALUE "CompanyName",       RES_STR_COMPANY_NAME
+            VALUE "FileDescription",   "ReactOS W32 Caption Clock\0"
+            VALUE "FileVersion",       RES_STR_PRODUCT_VERSION
+            VALUE "InternalName",      "capclock\0"
+            VALUE "LegalCopyright",    RES_STR_LEGAL_COPYRIGHT
+            VALUE "OriginalFilename",  "capclock.exe\0"
+            VALUE "ProductName",       RES_STR_PRODUCT_NAME
+            VALUE "ProductVersion",    RES_STR_PRODUCT_VERSION
+        END
+    END
+    BLOCK "VarFileInfo"
+    BEGIN
+        VALUE "Translation", 0x409, 1200
+    END
+END
+