Int 换成 INT, 大小写

解决方案 »

  1.   

    #include<windows.h>LRESULT CALLBACK WndProc(HWND,UINT,WPARAM,LPARAM);
    int WINAPI WinMain(HINSTANCE hInstance,
               HINSTANCE PreInstance,
               LPSTR lpCmdLine,
               int nCmdShow)
    {
       HWND hwnd;
       MSG msg;
       char lpszClassName[]="窗口";
       WNDCLASS wc;
       wc.style=0;
       wc.lpfnWndProc=WndProc;
       wc.cbClsExtra=0;
       wc.cbWndExtra=0;
       wc.hInstance=hInstance;
       wc.hIcon=LoadIcon(NULL,IDI_APPLICATION);
       wc.hCursor=LoadCursor(NULL,IDC_ARROW);
       wc.hbrBackground=(HBRUSH)GetStockObject(WHITE_BRUSH);
       wc.lpszMenuName=NULL;
       wc.lpszClassName=lpszClassName;
       
       RegisterClass(&wc);
       
       hwnd=CreateWindow(lpszClassName,
                       "Windows",
                       WS_OVERLAPPEDWINDOW,
                       120,50,800,600,
                       NULL,
                       NULL,
                       hInstance,NULL);
       
       ShowWindow(hwnd,nCmdShow);
       UpdateWindow(hwnd);
       
       while(GetMessage(&msg,NULL,0,0))
       {
          TranslateMessage(&msg);
          DispatchMessage(&msg);
       }
       return msg.wParam;
     } 
       
       LRESULT CALLBACK WndProc(HWND hwnd,
                              UINT message,
                              WPARAM wParam,
                              LPARAM lParam)
       {
         switch(message)
         { 
            case WM_LBUTTONDOWN:
            {
               MessageBeep(0);
            }
            break;
            case WM_DESTROY:
            PostQuitMessage(0);
            break;
            default:
              return DefWindowProc(hwnd,message,wParam,lParam);
         }
       return 0;
       }  
      
       单击鼠标左键发声的console程序.cpp
    e:\hack工具\单击鼠标左键发声的console程序\单击鼠标左键发声的console程序.cpp(67) : fatal error C1010: unexpected end of file while looking for precompiled header directive
    执行 cl.exe 时出错.