连连看API版本的源代码[6]

[入库:2006年2月23日] [更新:2007年3月24日]

本文简介:

 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 ;
}

本文关键:连连看API版本的源代码
 

本站最佳浏览方式为 分辨率 1024x768 IE 6.0(或更高版本的 IE浏览器)

go top