我想学vc,但不想学MFC,想学SDK编程,请问各位大神怎么办,求指点一二。

解决方案 »

  1.   

    《Windows程序设计》第五版好像是1998年出版的吧
      

  2.   

    我觉得Windows程序设计SDK方式在16位的Windows 3.1时就已经成熟了,Win95时变成32位的API,2000、XP时API有所增加而已。
      

  3.   

    古老的16位的Windows程序,比如一些小游戏,在32位的Win7上也是能运行的,因为SDK方式编写的程序是兼容的,本质上因为API是兼容的。
      

  4.   

    如果C/C++基础过关,你想就学。如果你C/C++还处于入门,先把标准C和C++学好
      

  5.   

    纯windows sdk编程,程序稍大一点就能写死你,一点点功能代码淹没在无尽的窗口过程之中。
      

  6.   

    仅供参考:#pragma comment(lib,"user32")
    #pragma comment(lib,"gdi32")
    #include <windows.h>
    LRESULT CALLBACK WndProc(HWND hWnd, UINT message, WPARAM wParam, LPARAM lParam) {
        PAINTSTRUCT ps;
        HDC hdc;
        HFONT hfont,ohfont;
        RECT r;
        COLORREF oc;    switch(message) {
        case WM_CLOSE://按Alt+F4退出
            PostQuitMessage(0);
            break;
        case WM_PAINT:
            BeginPaint(hWnd, &ps);
            hdc = ps.hdc; // the device context to draw in
            GetClientRect(hWnd, &r); // Obtain the window's client rectangle
            hfont = CreateFont(200, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, "宋体");
            ohfont=(HFONT)SelectObject(hdc,hfont);
            oc=SetTextColor(hdc,0x00C080FF);
            SetBkMode(hdc, TRANSPARENT);
            TextOut(hdc,r.left+r.right/2-600, r.top+r.bottom/2-100,"最短画图程序",12);
            SelectObject(hdc,ohfont);
            SetTextColor(hdc,oc);
            DeleteObject(hfont);
            EndPaint(hWnd, &ps);
            break;
        default:
            return DefWindowProc(hWnd, message, wParam, lParam);
        }
        return 0;
    }
    int WINAPI WinMain(HINSTANCE hInstance, HINSTANCE hPrevInstance, LPSTR lpCmdLine, int nCmdShow) {
        MSG msg             = {0};
        WNDCLASS wc         = {0};
        HBRUSH hbrh;
        hbrh=CreateSolidBrush(0x00000000);
        wc.lpfnWndProc      = WndProc;
        wc.hInstance        = hInstance;
        wc.hbrBackground    = hbrh;
        wc.lpszClassName    = "minwindowsapp";
        wc.hCursor          = LoadCursor(NULL,IDC_ARROW);
        if (0==RegisterClass(&wc)) return 1;    if (NULL==CreateWindow(wc.lpszClassName,
                            "Minimal Windows Application",
                            WS_POPUP|WS_VISIBLE,
                            0,
                            0,
                            GetSystemMetrics(SM_CXSCREEN),
                            GetSystemMetrics(SM_CYSCREEN),
                            0,
                            0,
                            hInstance,
                            NULL))
            return 2;    while( GetMessage( &msg, NULL, 0, 0 ) > 0 ) {
            DispatchMessage( &msg );
        }
        DeleteObject(hbrh);
        return 0;
    }