diff options
Diffstat (limited to 'win/tclWinNotify.c')
| -rw-r--r-- | win/tclWinNotify.c | 23 |
1 files changed, 11 insertions, 12 deletions
diff --git a/win/tclWinNotify.c b/win/tclWinNotify.c index 436d333..4543b02 100644 --- a/win/tclWinNotify.c +++ b/win/tclWinNotify.c @@ -9,8 +9,6 @@ * * See the file "license.terms" for information on usage and redistribution of * this file, and for a DISCLAIMER OF ALL WARRANTIES. - * - * RCS: @(#) $Id: tclWinNotify.c,v 1.24 2008/07/24 21:54:43 nijtmans Exp $ */ #include "tclInt.h" @@ -52,6 +50,7 @@ static Tcl_ThreadDataKey dataKey; */ static int notifierCount = 0; +static const TCHAR classname[] = TEXT("TclNotifier"); TCL_DECLARE_MUTEX(notifierMutex) /* @@ -99,12 +98,12 @@ Tcl_InitNotifier(void) class.hInstance = TclWinGetTclInstance(); class.hbrBackground = NULL; class.lpszMenuName = NULL; - class.lpszClassName = "TclNotifier"; + class.lpszClassName = classname; class.lpfnWndProc = NotifierProc; class.hIcon = NULL; class.hCursor = NULL; - if (!RegisterClassA(&class)) { + if (!RegisterClass(&class)) { Tcl_Panic("Unable to register TclNotifier window class"); } } @@ -121,7 +120,7 @@ Tcl_InitNotifier(void) tsdPtr->event = CreateEvent(NULL, TRUE /* manual */, FALSE /* !signaled */, NULL); - return (ClientData) tsdPtr; + return tsdPtr; } } @@ -187,7 +186,7 @@ Tcl_FinalizeNotifier( Tcl_MutexLock(¬ifierMutex); notifierCount--; if (notifierCount == 0) { - UnregisterClassA("TclNotifier", TclWinGetTclInstance()); + UnregisterClass(classname, TclWinGetTclInstance()); } Tcl_MutexUnlock(¬ifierMutex); } @@ -351,7 +350,7 @@ Tcl_ServiceModeHook( */ if (mode == TCL_SERVICE_ALL && !tsdPtr->hwnd) { - tsdPtr->hwnd = CreateWindowA("TclNotifier", "TclNotifier", + tsdPtr->hwnd = CreateWindow(classname, classname, WS_TILED, 0, 0, 0, 0, NULL, NULL, TclWinGetTclInstance(), NULL); @@ -362,7 +361,7 @@ Tcl_ServiceModeHook( * if one is needed. */ - Tcl_AlertNotifier((ClientData)tsdPtr); + Tcl_AlertNotifier(tsdPtr); } } } @@ -457,7 +456,7 @@ Tcl_WaitForEvent( myTime.usec = timePtr->usec; if (myTime.sec != 0 || myTime.usec != 0) { - (*tclScaleTimeProcPtr) (&myTime, tclTimeClientData); + tclScaleTimeProcPtr(&myTime, tclTimeClientData); } timeout = myTime.sec * 1000 + myTime.usec / 1000; @@ -507,7 +506,7 @@ Tcl_WaitForEvent( PostQuitMessage((int) msg.wParam); status = -1; - } else if (result == -1) { + } else if (result == (DWORD)-1) { /* * We got an error from the system. I have no idea why this * would happen, so we'll just unwind. @@ -580,7 +579,7 @@ Tcl_Sleep( * TIP #233: Scale delay from virtual to real-time. */ - (*tclScaleTimeProcPtr) (&vdelay, tclTimeClientData); + tclScaleTimeProcPtr(&vdelay, tclTimeClientData); sleepTime = vdelay.sec * 1000 + vdelay.usec / 1000; for (;;) { @@ -595,7 +594,7 @@ Tcl_Sleep( vdelay.sec = desired.sec - now.sec; vdelay.usec = desired.usec - now.usec; - (*tclScaleTimeProcPtr) (&vdelay, tclTimeClientData); + tclScaleTimeProcPtr(&vdelay, tclTimeClientData); sleepTime = vdelay.sec * 1000 + vdelay.usec / 1000; } } |
