+///////////////////////////////////////\r
+// main.cpp\r
+\r
+#include "wincore.h"\r
+#include "resource.h"\r
+#include "FrameApp.h"\r
+\r
+\r
+int WINAPI WinMain( HINSTANCE hInstance, HINSTANCE hPrevInstance, LPTSTR lpCmdLine, int nCmdShow)\r
+{\r
+ TCHAR szBuf[100];\r
+ ::LoadString(hInstance, IDW_MAIN, szBuf, 100);\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 the framework\r
+ CWceFrameApp MyApp;\r
+\r
+ //Process the window messages\r
+ return MyApp.Run();\r
+}\r
+\r