Measurement-computing Personal488 rev.3.0 For DOS & Windows 3.Xi Instrukcja Użytkownika Strona 233

  • Pobierz
  • Dodaj do moich podręczników
  • Drukuj
Przeglądanie stron 232
10E. C Languages II. SOFTWARE GUIDES - 10. Driver488/W31
II-218 Personal488 Users Manual, Rev. 3.0
MSG msg; /* MSG structure to store your messages */
int nRc; /* return value from Register Classes */
strcpy(szAppName, EXAMPLE2");
hInst = hInstance;
if (!hPrevInstance) {
/* register window classes if first instance of application */
if ((nRc = nCwRegisterClasses()) == -1) {
/* registering one of the windows failed */
LoadString(hInst,IDS_ERR_REGISTER_CLASS,szString,
sizeof(szString));
MessageBox(NULL, szString, NULL, MB_ICONEXCLAMATION);
return nRc;
}
}
/* create applications Main window */
hWndMain = CreateWindow(
szAppName /* Window class name */
Driver488/W31 Simple Example , /* Windows title */
WS_CAPTION | /* Title and Min/Max */
WS_SYSMENU /* Add system menu box */
WS_MINIMIZEBOX | /* Add minimize box */
WS_MAXIMIZEBOX | /* Add maximize box */
WS_THICKFRAME | /* thick sizeable frame */
WS_CLIPCHILDREN | /* dont draw in child windows areas*/
WS_OVERLAPPED,
CW_USEDEFAULT, 0, /* Use default X, Y */
CW_USEDEFAULT, 0, /* Use default X, Y */
NULL, /* Parent windows handle */
NULL, /* Default to Class Menu */
hInst, /* Instance of window */
NULL); /* Create struct for WM_CREATE */
if (hWndMain == NULL) {
LoadString(hInst, IDS_ERR_CREATE_WINDOW, szString,
sizeof(szString));
MessageBox(NULL, szString, NULL, MB_ICONEXCLAMATION);
return IDS_ERR_CREATE_WINDOW;
}
ShowWindow(hWndMain, nCmdShow) /* display main window */
while (GetMessage(&msg, NULL, 0, 0)) { /* Until WM_QUIT message */
TranslateMessage(&msg);
DispatchMessage(&msg);
}
/* Do clean up before exiting from the application */
CwUnRegisterClasses();
return msg.wParam;
} /* End of WinMain */
/*******************************************************************/
/* */
/* Main Window Procedure */
/* */
/* This procedure provides service routines for the Windows events */
/* (messages)that Windows sends to the window, as well as the user */
/* initiated events (messages) that are generated when the user */
/* selectsthe action bar and pulldown menu controls or the */
/* corresponding keyboard accelerators. */
/* */
/*******************************************************************/
LONG FAR PASCAL WndProc(HWND hWnd, WORD Message, WORD wParam, LONG
lParam)
Przeglądanie stron 232
1 2 ... 228 229 230 231 232 233 234 235 236 237 238 ... 399 400

Komentarze do niniejszej Instrukcji

Brak uwag