Commit before breaking everything
[matches/honours.git] / research / transmission_spectroscopy / TOF / Win32++ / samples / Performance / src / TestWnd.cpp
1 //////////////////////////////////////////////\r
2 // TestWnd.cpp\r
3 //  Definitions for the CTestWindow class\r
4 \r
5 #include "stdafx.h"\r
6 #include "TestWnd.h"\r
7 #include "PerfApp.h"\r
8 \r
9 \r
10 CTestWindow::CTestWindow()\r
11 {\r
12 }\r
13 \r
14 void CTestWindow::CreateWin(int i)\r
15 {\r
16         m_nWindow = i + 1;\r
17         TCHAR str[80];\r
18         wsprintf(str, _T("Test Window %d"), m_nWindow);\r
19         CreateEx(0L, NULL, str, WS_OVERLAPPEDWINDOW | WS_VISIBLE,\r
20                 420, 50 + 4*i, 300, 200, NULL, NULL);\r
21 }\r
22 \r
23 void CTestWindow::OnInitialUpdate()\r
24 {\r
25         // Get a reference to the CMainWnd object\r
26         CMainWindow& MainWnd = ((CPerformanceApp*)GetApp())->GetMainWnd();\r
27 \r
28         // Post a message to MainWnd when the window is created. \r
29         MainWnd.PostMessage(WM_WINDOWCREATED, 0, 0);\r
30 }\r
31 \r
32 LRESULT CTestWindow::WndProc(UINT uMsg, WPARAM wParam, LPARAM lParam)\r
33 {\r
34         static LRESULT nMessages = 0;\r
35         switch (uMsg)\r
36         {\r
37         case WM_CLOSE:\r
38                 {\r
39                         CString str;\r
40                         str.Format(str, _T("Closing test Window #%d\n"), m_nWindow);\r
41                         TRACE(str);\r
42                 }\r
43                 break;\r
44 \r
45         case WM_TESTMESSAGE:\r
46                 // return the number of WM_TESTMESSAGE messages processsed so far\r
47                 return ++nMessages;\r
48         }\r
49 \r
50         return WndProcDefault(uMsg, wParam, lParam);\r
51 }\r
52 \r

UCC git Repository :: git.ucc.asn.au