--- /dev/null
+///////////////////////////////////////\r
+// main.cpp\r
+\r
+#include "DialogApp.h"\r
+\r
+\r
+INT WINAPI WinMain(HINSTANCE hInstance, HINSTANCE hPrevInstance, LPTSTR lpCmdLine, int iCmdShow)\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
+ // The one and only CDialogApp object\r
+ CDialogApp theApp;\r
+\r
+ //Process the window messages\r
+ return theApp.Run();\r
+}\r
+\r