This function is called by the system as the initial entry point for Windows CE-based applications.

int WINAPI WinMain(
  HINSTANCE hInstance, 
  HINSTANCE hPrevInstance, 
  LPWSTR lpCmdLine, 
  int nShowCmd 


[in] Handle to the current instance of the application.
[in] Handle to the previous instance of the application. For a Win32-based application, this parameter is always NULL.

If you need to detect whether another instance already exists, create a uniquely named mutex using the CreateMutex function. CreateMutex will succeed even if the mutex already exists, but the GetLastError function will return ERROR_ALREADY_EXISTS. This indicates that another instance of your application exists, because it created the mutex first.

[in] Pointer to a null-terminated string that specifies the command line for the application, excluding the program name.
[in] Specifies how the window is to be shown.




BOOL CMulticardTestApp::InitInstance()
 // InitCommonControlsEx() is required on Windows XP if an application
 // manifest specifies use of ComCtl32.dll version 6 or later to enable
 // visual styles.  Otherwise, any window creation will fail.
 InitCtrls.dwSize = sizeof(InitCtrls);
 // Set this to include all the common control classes you want to use
 // in your application.
 InitCtrls.dwICC = ICC_WIN95_CLASSES;

HANDLE  hMutex =::CreateMutex(NULL,FALSE,_T("Testapp"));

  return FALSE;