2 * Copyright 2000, International Business Machines Corporation and others.
5 * This software has been released under the terms of the IBM Public
6 * License. For details, see the LICENSE file in the top-level source
7 * directory or online at http://www.openafs.org/dl/license10.html
11 #include <afs/param.h>
16 #include <WINNT/talocale.h>
19 // The following definition specifies the length of time that the
20 // stupid lawyer message will remain on the screen
22 #define cmsecSHOW_LAWYER_MESSAGE 5000
24 // Individual string resources in .RC files can't be more than 256
27 #define cchRESOURCE 256
30 // Lawyer_OnInitDialog - Populates the lawyer message window
32 void Lawyer_OnInitDialog (HWND hDlg)
34 // Make the title item boldfaced
36 HFONT hfOld = (HFONT)SendDlgItemMessage (hDlg, IDC_TITLE, WM_GETFONT, 0, 0);
39 GetObject (hfOld, sizeof(lf), &lf);
41 lf.lfWeight = FW_BOLD;
43 SendDlgItemMessage (hDlg, IDC_TITLE, WM_SETFONT, (WPARAM)CreateFontIndirect (&lf), 0);
45 // Allocate a buffer, load the string, and shove the text
46 // in the main window.
48 LPTSTR pszMessage = FormatString (TEXT("%1"), TEXT("%m"), IDS_MESSAGE_1);
50 SetDlgItemText (hDlg, IDC_MESSAGE, pszMessage);
52 FreeString (pszMessage);
56 // Lawyer_DlgProc - The window procedure for the lawyer message
58 BOOL CALLBACK Lawyer_DlgProc (HWND hDlg, UINT msg, WPARAM wp, LPARAM lp)
63 Lawyer_OnInitDialog (hDlg);
64 SetTimer (hDlg, 0, cmsecSHOW_LAWYER_MESSAGE, NULL);
76 case WM_CTLCOLORSTATIC:
77 if ((HWND)lp == GetDlgItem (hDlg, IDC_MESSAGE))
79 static HBRUSH hbrBackground = CreateSolidBrush (GetSysColor (COLOR_BTNFACE));
80 SetBkColor ((HDC)wp, GetSysColor (COLOR_BTNFACE));
81 SetTextColor ((HDC)wp, GetSysColor (COLOR_WINDOWTEXT));
82 return (BOOL)hbrBackground;
87 if (LOWORD(wp) == IDCANCEL)
96 // WinMain - Creates the window, waits for it to terminate
98 int WINAPI WinMain (HINSTANCE hInst, HINSTANCE hPrev, LPSTR pCmdLine, int nCmdShow)
100 TaLocale_LoadCorrespondingModule (hInst);
102 HWND hDlg = ModelessDialog (IDD_LAWYER, NULL, (DLGPROC)Lawyer_DlgProc);
103 SetWindowPos (hDlg, HWND_BOTTOM, 0, 0, 0, 0, SWP_NOMOVE | SWP_NOSIZE | SWP_NOACTIVATE | SWP_SHOWWINDOW);
106 while (GetMessage (&msg, NULL, 0, 0))
108 if (!IsDialogMessage (hDlg, &msg))
110 TranslateMessage (&msg);
111 DispatchMessage (&msg);