7 #include <WINNT/talocale.h>
10 // The following definition specifies the length of time that the
11 // stupid lawyer message will remain on the screen
13 #define cmsecSHOW_LAWYER_MESSAGE 5000
15 // Individual string resources in .RC files can't be more than 256
18 #define cchRESOURCE 256
21 // Lawyer_OnInitDialog - Populates the lawyer message window
23 void Lawyer_OnInitDialog (HWND hDlg)
25 // Make the title item boldfaced
27 HFONT hfOld = (HFONT)SendDlgItemMessage (hDlg, IDC_TITLE, WM_GETFONT, 0, 0);
30 GetObject (hfOld, sizeof(lf), &lf);
32 lf.lfWeight = FW_BOLD;
34 SendDlgItemMessage (hDlg, IDC_TITLE, WM_SETFONT, (WPARAM)CreateFontIndirect (&lf), 0);
36 // Allocate a buffer, load the string, and shove the text
37 // in the main window.
39 LPTSTR pszMessage = FormatString (TEXT("%1"), TEXT("%m"), IDS_MESSAGE_1);
41 SetDlgItemText (hDlg, IDC_MESSAGE, pszMessage);
43 FreeString (pszMessage);
47 // Lawyer_DlgProc - The window procedure for the lawyer message
49 BOOL CALLBACK Lawyer_DlgProc (HWND hDlg, UINT msg, WPARAM wp, LPARAM lp)
54 Lawyer_OnInitDialog (hDlg);
55 SetTimer (hDlg, 0, cmsecSHOW_LAWYER_MESSAGE, NULL);
67 case WM_CTLCOLORSTATIC:
68 if ((HWND)lp == GetDlgItem (hDlg, IDC_MESSAGE))
70 static HBRUSH hbrBackground = CreateSolidBrush (GetSysColor (COLOR_BTNFACE));
71 SetBkColor ((HDC)wp, GetSysColor (COLOR_BTNFACE));
72 SetTextColor ((HDC)wp, GetSysColor (COLOR_WINDOWTEXT));
73 return (BOOL)hbrBackground;
78 if (LOWORD(wp) == IDCANCEL)
87 // WinMain - Creates the window, waits for it to terminate
89 int WINAPI WinMain (HINSTANCE hInst, HINSTANCE hPrev, LPSTR pCmdLine, int nCmdShow)
91 TaLocale_LoadCorrespondingModule (hInst);
93 HWND hDlg = ModelessDialog (IDD_LAWYER, NULL, (DLGPROC)Lawyer_DlgProc);
94 SetWindowPos (hDlg, HWND_BOTTOM, 0, 0, 0, 0, SWP_NOMOVE | SWP_NOSIZE | SWP_NOACTIVATE | SWP_SHOWWINDOW);
97 while (GetMessage (&msg, NULL, 0, 0))
99 if (!IsDialogMessage (hDlg, &msg))
101 TranslateMessage (&msg);
102 DispatchMessage (&msg);