我在WINSDK下编程 想在win32窗口中实现局部的滚动效果,像资源管理器类似的滚动左半区或滚动右半区,我是菜鸟还不知道该怎么弄,望大家赐教在线等。

解决方案 »

  1.   


    还望指教 怎么用API在一个窗口中 在创建子窗口?是不是再建个WNDCLASS wc,createWindow(wc,...,WS_CHILD,...);
      

  2.   

    要是是这样的话,wc.hInstance = ?,createwindow(...,?,NULL)中的hInstance该怎么填呢?望再赐教
      

  3.   

    既然这样,就先创建一个EDIT窗口吧,参见MSDN的例子,如下LONG APIENTRY MainWndProc( 
    HWND hwnd,                // window handle 
    UINT message,             // type of message 
    WPARAM wParam,            // additional information 
    LPARAM lParam)            // additional information 

        static HWND hwndEdit; 
     
        CHAR lpszTrouble[] = "When in the Course of human Events " 
                             "it becomes necessary for one People " 
                             "to dissolve the Political Bands which " 
                             "have connected them with another, and " 
                             "to assume among the Powers of the " 
                             "Earth, the separate and equal Station " 
                             "to which the Laws of Nature and of " 
                             "Nature's God entitle them, a decent " 
                             "Respect to the Opinions of Mankind " 
                             "requires that they should declare the " 
                             "causes which impel them to the " 
                             "Separation. "; 
     
        switch (message) 
        { 
            case WM_CREATE: 
                hwndEdit = CreateWindow( 
                    "EDIT",     // predefined class 
                    NULL,       // no window title 
                    WS_CHILD | WS_VISIBLE | WS_VSCROLL | 
                        ES_LEFT | ES_MULTILINE | ES_AUTOVSCROLL, 
                    0, 0, 0, 0, // set size in WM_SIZE message 
                    hwnd,       // parent window 
                    (HMENU) ID_EDITCHILD, // edit control ID 
                    (HINSTANCE) GetWindowLong(hwnd, GWL_HINSTANCE), 
                    NULL);                // pointer not needed 
     
                 // Add text to the window. 
     
                 SendMessage(hwndEdit, WM_SETTEXT, 0, 
                    (LPARAM) lpszTrouble); 
     
                return 0; 
      

  4.   

    我要在里面进行是很复杂的画图,所以不能用EDIT,河马大哥,像我上面说的那样可行不?