if (!RegisterClass (&wndclass))
{
MessageBox (NULL, TEXT ("This program requires Windows NT!"),
szAppName, MB_ICONERROR) ;
return 0 ;
}
hwnd = CreateWindow ( szAppName, // window class name
TEXT ("连连看 V1.08.18.01"), // window caption
WS_OVERLAPPEDWINDOW &
~WS_MAXIMIZEBOX & ~WS_SIZEBOX,// window style
//没有最大化按钮和无法改变窗口大小
CW_USEDEFAULT, // initial x position
CW_USEDEFAULT, // initial y position
xsize, // initial x size
ysize, // initial y size
NULL, // parent window handle
NULL, // window menu handle
hInstance, // program instance handle
NULL ) ; // creation parameters
ShowWindow (hwnd, iCmdShow) ;
UpdateWindow (hwnd) ;
hAccel = LoadAccelerators (hInstance, TEXT ("MY_ACCELERATOR")) ;
while(GetMessage (&msg, NULL, 0, 0))
{
if(!TranslateAccelerator (hwnd, hAccel, &msg))
{
TranslateMessage (&msg) ;
DispatchMessage (&msg) ;
}
}
return msg.wParam ;
}
BOOL CALLBACK AboutDlgProc (HWND hDlg, UINT message,
WPARAM wParam, LPARAM lParam)
{
switch (message)
{
case WM_INITDIALOG :
return TRUE ;
case WM_COMMAND :
switch (LOWORD (wParam))
{
case IDOK :
case IDCANCEL :
EndDialog (hDlg, 0) ;
return TRUE ;
}
break ;
}
return FALSE ;
}