Casio PA-2400W Manuel Page 23

  • Télécharger
  • Ajouter à mon manuel
  • Imprimer
  • Page
    / 83
  • Table des matières
  • MARQUE LIVRES
  • Noté. / 5. Basé sur avis des utilisateurs
Vue de la page 22
23
Sample program to acquire power-on event notification
#include <windows.h>
static HANDLE hEventOn = NULL;
static HANDLE hThreadOn = NULL ;
DWORD WINAPI OnThread()
{
LONG WaitReturn;
While(1) {
WaitReturn = WaitForSingleObject(hEventon, INFINITE);
If (WaitReturn == WAIT_OBJECT_0) {
MessageBox(NULL, TEXT(“PowerONEvent”), TEXT(“Event”), MB_OK);
}
ResetEvent(hEventOn);
}
return 0;
}
BOOL Initialize()
{
DWORD ThreadIDOn;
hEventOn = CreateEvent(NULL, TRUE, FALSE, TEXT(“PA_OnEvent”));
if( !hEventOn )
{
return(FALSE);
}
hThreadOn = CreateThread(NULL, 0, OnThread, 0, 0, &ThreadIDOn);
if(!hThreadOn)
{
return(FALSE);
}
return(TRUE);
}
int WINAPI WinMain(HINSTANCE hInstance, HINSTANCE hPrevInstance, LPSTR lpCmdLine, int nCmdShow)
{
if(Initialize() ) {
MessageBox(NULL, TEXT(“Initialize Success”), TEXT(“Initialize”), MB_OK);
While(1) {
Sleep(1000);
}
return(TRUE);
}
else {
MessageBox(NULL, TEXT(“Initialize Error”), TEXT(“Initialize”), MB_OK);
return(FALSE);
}
}
Vue de la page 22
1 2 ... 18 19 20 21 22 23 24 25 26 27 28 ... 82 83

Commentaires sur ces manuels

Pas de commentaire