Commit before breaking everything
[matches/honours.git] / research / transmission_spectroscopy / TOF / Win32++ / samples / Performance / src / MyDialog.cpp
diff --git a/research/transmission_spectroscopy/TOF/Win32++/samples/Performance/src/MyDialog.cpp b/research/transmission_spectroscopy/TOF/Win32++/samples/Performance/src/MyDialog.cpp
new file mode 100644 (file)
index 0000000..e371e9b
--- /dev/null
@@ -0,0 +1,61 @@
+///////////////////////////////////////\r
+// MyDialog.cpp\r
+\r
+#include "stdafx.h"\r
+#include "MyDialog.h"\r
+#include "PerfApp.h"\r
+#include "resource.h"\r
+\r
+\r
+\r
+// Definitions for the CMyDialog class\r
+CMyDialog::CMyDialog(UINT nResID, CWnd* pParent) : CDialog(nResID, pParent)\r
+{\r
+}\r
+\r
+CMyDialog::~CMyDialog()\r
+{\r
+}\r
+\r
+INT_PTR CMyDialog::DialogProc(UINT uMsg, WPARAM wParam, LPARAM lParam)\r
+{\r
+//     switch (uMsg)\r
+//     {\r
+               //Additional messages to be handled go here\r
+//     }\r
+\r
+       return DialogProcDefault(uMsg, wParam, lParam);\r
+}\r
+\r
+\r
+BOOL CMyDialog::OnInitDialog()\r
+{\r
+       // Put the initial values in the edit boxes\r
+       SetDlgItemText(IDC_WINDOWS,  _T("10"));\r
+       SetDlgItemText(IDC_MESSAGES, _T("1000000"));\r
+\r
+       return true;\r
+}\r
+\r
+void CMyDialog::OnOK()\r
+// This function is called when the OK button is hit\r
+{\r
+       // Get the number of test windows to create \r
+       // Note 1: A Windows limit of 10000 handles per process imposes a practical limit of aprox 1000 test windows.\r
+       //         Refer to: http://support.microsoft.com/kb/327699\r
+       // Note 2: Creating (or destroying) more than say 200 windows may temporarily stress the Explorer process.\r
+       int nWindows = MIN(1000, GetDlgItemInt(IDC_WINDOWS, NULL, FALSE));\r
+       \r
+       // Get the number of test messages to send\r
+       int nTestMessages = GetDlgItemInt(IDC_MESSAGES, NULL, FALSE);\r
+\r
+       // Get a reference to the CMainWindow object\r
+       CMainWindow& MainWnd = ((CPerformanceApp*)GetApp())->GetMainWnd();\r
+       \r
+       MainWnd.SetTestMessages(nTestMessages);\r
+       MainWnd.CreateTestWindows(nWindows);\r
+\r
+       // End the dialog\r
+       EndDialog(IDOK);\r
+}\r
+\r

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