X-Git-Url: https://git.ucc.asn.au/?p=matches%2Fhonours.git;a=blobdiff_plain;f=research%2Ftransmission_spectroscopy%2FTOF%2FWin32%2B%2B%2FWCE%20samples%2FDlgSubclass%2Fmain.cpp;fp=research%2Ftransmission_spectroscopy%2FTOF%2FWin32%2B%2B%2FWCE%20samples%2FDlgSubclass%2Fmain.cpp;h=0f51a3209084cd7bfe8ae85301564e2841fbf6dd;hp=0000000000000000000000000000000000000000;hb=70a96cca12cb006506461d26cd112bab179fe74c;hpb=8caf60af39689a3546074f0c68d14c3a2e28191e diff --git a/research/transmission_spectroscopy/TOF/Win32++/WCE samples/DlgSubclass/main.cpp b/research/transmission_spectroscopy/TOF/Win32++/WCE samples/DlgSubclass/main.cpp new file mode 100644 index 00000000..0f51a320 --- /dev/null +++ b/research/transmission_spectroscopy/TOF/Win32++/WCE samples/DlgSubclass/main.cpp @@ -0,0 +1,27 @@ +/////////////////////////////////////// +// main.cpp + +#include "DlgSubclassApp.h" + + +INT WINAPI WinMain(HINSTANCE hInstance, HINSTANCE, LPTSTR, int) +{ + TCHAR szBuf[MAX_STRING_SIZE]; + ::LoadString(hInstance, IDW_MAIN, szBuf, MAX_STRING_SIZE -1); + HWND hWnd = FindWindow(szBuf, NULL); + + // If application is already running, restore it and quit + if (hWnd) + { + SetForegroundWindow ((HWND)(((DWORD)hWnd) | 0x01)); + TRACE(_T("Application Already running")); + return -1; + } + + // Start Win32++ + CDlgSubclassApp theApp; + + // Process the window messages + return theApp.Run(); +} +