我觉得应该可以的,MFC毕竟是Win32的包装么,但具体怎么实现有没有人试过,讲讲该怎么做?

解决方案 »

  1.   

    比如tree view control
    http://msdn.microsoft.com/library/default.asp?url=/library/en-us/shellcc/platform/commctls/treeview/treeview.asp
    // CreateATreeView - creates a tree-view control. 
    // Returns the handle to the new control if successful,
    // or NULL otherwise. 
    // hwndParent - handle to the control's parent window. 
    // lpszFileName - name of the file to parse for tree-view items.HWND CreateATreeView(HWND hwndParent, LPSTR lpszFileName) 

        RECT rcClient;  // dimensions of client area 
        HWND hwndTV;    // handle to tree-view control     // Ensure that the common control DLL is loaded. 
        InitCommonControls();     // Get the dimensions of the parent window's client area, and create 
        // the tree-view control. 
        GetClientRect(hwndParent, &rcClient); 
        hwndTV = CreateWindowEx(0,
                                WC_TREEVIEW,
                                "Tree View",
                                WS_VISIBLE | WS_CHILD | WS_BORDER | TVS_HASLINES, 
                                0, 
                                0, 
                                rcClient.right, 
                                rcClient.bottom,
                                hwndParent, 
                                (HMENU)ID_TREEVIEW, 
                                g_hinst, 
                                NULL);     // Initialize the image list, and add items to the control. 
        // InitTreeViewImageLists and InitTreeViewItems are application- 
        // defined functions. 
        if (!InitTreeViewImageLists(hwndTV) || 
                    !InitTreeViewItems(hwndTV, lpszFileName))
        { 
            DestroyWindow(hwndTV); 
            return FALSE; 
        } 
        return hwndTV;
    }
      

  2.   

    调用的是系统控件当然是可以的,这些控件又不是MFC专用的,不过在SDK下调这些控件比较烦,首先要知道类名,才能用CreateWindowEx来创建出来。有的可能还要在创建之前初始化。
      

  3.   

    最好的办法是:
    打开一个相似的窗口(别人已做好的程序),然后用spy++查看,最后CreateWindowEx,把从spy++中获取到的参数填入CreateWindowEx的相应字段,就做好了。
    其实可能需要调用一些初始化函数,如楼上说的InitCommonControls();等。
      

  4.   

    不好意思,各位大大,我没说清楚,我想调的是一个没有窗口的控件,是别人写的一个类似com的东西,用regsvr32注册之后,想要调用它,比如zip控件?我这个控件本来在MFC下面调用就像Windows media player一样,用类的方式使用的,可是如果在win32程序里怎么来使用类声明对象呢?
      

  5.   

    #import directive很方便,不过你要花点时间学习一下
    msdn2.microsoft.com/en-us/library/8etzzkb6.aspx