hinst=hInstance; 
hwnd=CreateWindow("wtmc","系统测试版",WS_OVERLAPPEDWINDOW,CW_USEDEFAULT, 
                CW_USEDEFAULT,CW_USEDEFAULT,CW_USEDEFAULT,(HWND)NULL,(HMENU)NULL,hInstance,(LPSTR)NULL); 

解决方案 »

  1.   

    #include<windows.h> 
    HINSTANCE hinst; 
    LRESULT CALLBACK wtmcproc(HWND,UINT,WPARAM,LPARAM); 
    //LRESULT CALLBACK DefwPorc(HWND,UINT,WPARAM,LPARAM); 
    HINSTANCE hInstance; 
    int APIENTRY WinMain(HINSTANCE hInstance, 
                         HINSTANCE hPrevInstance, 
                         LPSTR     lpCmdLine, 
                         int       nCmdShow) 

    MSG msg; 
        WNDCLASS wtmc; 
    wtmc.style=CS_HREDRAW|CS_VREDRAW; 
    wtmc.cbClsExtra =0; 
    wtmc.cbWndExtra =0; 
    wtmc.lpfnWndProc =wtmcproc; 
    wtmc.hInstance =hPrevInstance; //此处应为hPrevInstance
    wtmc.hIcon =LoadIcon(NULL,IDI_APPLICATION); 
    wtmc.hCursor =LoadCursor(NULL,IDC_ARROW); 
    wtmc.hbrBackground =(HBRUSH)(COLOR_WINDOW+1); 
    wtmc.lpszClassName ="wtmc"; 
    wtmc.lpszMenuName =NULL; 
    if(!RegisterClass(&wtmc)) 
    return 0; 
    HWND hwnd; 
    hinst=hInstance; 
    hwnd=CreateWindow("wtmc","系统测试版",WS_OVERLAPPEDWINDOW,CW_USEDEFAULT, 
                    CW_USEDEFAULT,CW_USEDEFAULT,CW_USEDEFAULT,(HWND)NULL,(HMENU)NULL,hInstance,(LPSTR)NULL); 
    //hins=hInstance; 
    ShowWindow(hwnd,nCmdShow); 
    UpdateWindow(hwnd); while(GetMessage(&msg,NULL,0,0)) 

    TranslateMessage(&msg); 
    DispatchMessage(&msg); 
    } return (msg.wParam ); 

    LRESULT CALLBACK wtmcproc(HWND hwnd,UINT message ,WPARAM wparam,LPARAM lparam) 

    HDC hdc; 
    PAINTSTRUCT ps; 
    switch(message) 

    case WM_PAINT: 
    hdc=BeginPaint(hwnd,&ps); 
    TextOut(hdc,285,230,"test ",5); 
    ValidateRect(hwnd,NULL); 
    EndPaint(hwnd,&ps); 
    break; 
    case WM_DESTROY: 
    PostQuitMessage(0); 
    break; 
    //default: 
    // return(DefwPorc(hwnd,message,wparam,lparam)); 
    default: 
     return(DefWindowProc(hwnd,message,wparam,lparam)); //有的消息没处理
    // break; 

    return 0; 
    }
      

  2.   

    插播紧急新闻请关注:http://www.csdn.net/expert/topic/709/709609.xml?temp=.4640314