From a7793b4ec9c69c3f2ba2d1757fed82db696a3b17 Mon Sep 17 00:00:00 2001 From: Emanuele Aliberti Date: Thu, 4 Sep 2003 21:33:11 +0000 Subject: [PATCH] Simple Win32 caption clock. It exposes a bug possibly in win32k.sys which causes a system crash. svn path=/trunk/; revision=5983 --- reactos/apps/tests/capclock/Makefile | 18 ++++++ reactos/apps/tests/capclock/capclock.c | 69 +++++++++++++++++++++++ reactos/apps/tests/capclock/capclock.ico | Bin 0 -> 766 bytes reactos/apps/tests/capclock/capclock.rc | 52 +++++++++++++++++ 4 files changed, 139 insertions(+) create mode 100644 reactos/apps/tests/capclock/Makefile create mode 100644 reactos/apps/tests/capclock/capclock.c create mode 100644 reactos/apps/tests/capclock/capclock.ico create mode 100644 reactos/apps/tests/capclock/capclock.rc diff --git a/reactos/apps/tests/capclock/Makefile b/reactos/apps/tests/capclock/Makefile new file mode 100644 index 00000000000..0e849b80fc6 --- /dev/null +++ b/reactos/apps/tests/capclock/Makefile @@ -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 index 00000000000..4099d7cd4b7 --- /dev/null +++ b/reactos/apps/tests/capclock/capclock.c @@ -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 + +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 index 0000000000000000000000000000000000000000..0b52fb0ccde9b5887ef492e7c6639565f413d9ab GIT binary patch literal 766 zcmd5%!3_f;3^S)bn4oW-9iyY=88%=X#b>UCvhA>0tB9v9xyu(;K}$R z67ePiTm!Z5CIBx)JkT>G1hrNQtzWce8Np*EbDKrIm<(RBmw)h_H+?=b`|ra`DI7)s uRZcC@HxnDsx$BEt!hR1r_xU#;->v^P&LwOM&J}yedgZ&`o6K?Vd)Wv5PX!48 literal 0 HcmV?d00001 diff --git a/reactos/apps/tests/capclock/capclock.rc b/reactos/apps/tests/capclock/capclock.rc new file mode 100644 index 00000000000..886043d8819 --- /dev/null +++ b/reactos/apps/tests/capclock/capclock.rc @@ -0,0 +1,52 @@ +#include +#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 +