Simple Win32 caption clock.

It exposes a bug possibly in win32k.sys which causes a system crash.

svn path=/trunk/; revision=5983
This commit is contained in:
Emanuele Aliberti 2003-09-04 21:33:11 +00:00
parent 7377c5fe18
commit a7793b4ec9
4 changed files with 139 additions and 0 deletions

View file

@ -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

View file

@ -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 */

Binary file not shown.

After

Width:  |  Height:  |  Size: 766 B

View file

@ -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