Commit before breaking everything
[matches/honours.git] / research / transmission_spectroscopy / TOF / Win32++ / WCE samples / Subclass / main.cpp
diff --git a/research/transmission_spectroscopy/TOF/Win32++/WCE samples/Subclass/main.cpp b/research/transmission_spectroscopy/TOF/Win32++/WCE samples/Subclass/main.cpp
new file mode 100644 (file)
index 0000000..ceaf892
--- /dev/null
@@ -0,0 +1,28 @@
+///////////////////////////////////////\r
+// main.cpp\r
+\r
+#include "SubclassApp.h"\r
+#include "resource.h"\r
+\r
+INT WINAPI WinMain(HINSTANCE hInstance, HINSTANCE, LPTSTR, int)\r
+{\r
+       TCHAR szBuf[MAX_STRING_SIZE];\r
+       ::LoadString(hInstance, IDW_MAIN, szBuf, MAX_STRING_SIZE -1);\r
+       HWND hWnd = FindWindow(szBuf, NULL);\r
+\r
+       // If application is already running, restore it and quit\r
+       if (hWnd)\r
+       {\r
+               SetForegroundWindow ((HWND)(((DWORD)hWnd) | 0x01));\r
+               TRACE(_T("Application Already running"));\r
+               return -1;\r
+       }\r
+\r
+       // Start Win32++\r
+       CSubclassApp theApp;\r
+\r
+       // Process the window messages\r
+       return theApp.Run();\r
+}\r
+\r
+\r

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