/* * Windows Calendar * Copyright (c) 1985 by Microsoft Corporation, all rights reserved. * Written by Mark L. Chamberlin, consultant to Microsoft. * ****** calinit.c * */ #include "cal.h" #include "string.h" #define DOTIMER //- OBM_RGARROW & OBM_LFARROW: Use the new arrows instead of old ones. #define OBM_RGARROW 32751 #define OBM_LFARROW 32750 extern INT cchLongDateMax; extern INT cchTimeMax; extern BOOL f24Time; #define GSM(SM) GetSystemMetrics(SM) BOOL APIENTRY ProcessShellOptions( LPSTR lpszCmdLine); /**** CalInit ****/ BOOL APIENTRY CalInit ( HANDLE hInstance, HANDLE hPrevInstance, LPSTR lpszCmdLine, INT cmdShow) { BITMAP bmBell; WNDCLASS WndClass; HDC hDC; TEXTMETRIC Metrics; INT i; INT cyUseable; CHAR *pch; INT cchRemaining, cch, cxWnd2C, cyWnd2C; HANDLE hStrings; INT tm, TimeSetting; INT BlankWidth; /* width (in pixels) of a blank char */ CHAR * pszFilterSpec = vszFilterSpec; /* temp. var. for creating filter text */ CHAR sz[10]; CHAR *psz=sz; INT iHeight; INT iWidth; /* Remember our instance handle. */ vhInstance = hInstance; /* Assume this string is longer for initialization. */ vfHour24 = FALSE; TimeSetting = GTS_12HOUR; /* determine time setting from "International" section of win.ini */ tm = 1; if (tm=GetProfileInt("intl", "iTime", tm)) if (tm = 1) { TimeSetting = GTS_24HOUR; vfHour24 = TRUE; } InitTimeDate(vhInstance, TimeSetting); InitLongTimeDate(TimeSetting); /* Load strings from resource file. */ hStrings=LocalAlloc(LPTR, cchRemaining=CCHSTRINGSMAX); pch=(CHAR *)(hStrings); if (!pch) return (FALSE); for (i=0; i