The CreateToolbarEx function creates a toolbar window and adds the specified buttons to the toolbar.HWND CreateToolbarEx(    HWND hwnd,
    DWORD ws,
    UINT wID, 
    int nBitmaps, 
    HINSTANCE hBMInst, 
    UINT wBMID, 
    LPCTBBUTTON lpButtons, 
    int iNumButtons, 
    int dxButton, 
    int dyButton, 
    int dxBitmap, 
    int dyBitmap, 
    UINT uStructSize
   );
 ParametershwndHandle to the parent window for the toolbar.wsWindow styles for the toolbar. This parameter must specify at least the WS_CHILD style. It can also include a combination of styles as discussed in Toolbars and related topics.wIDControl identifier for the toolbar.nBitmapsNumber of button images contained in the bitmap specified by hBMInst and wBMID.hBMInstModule instance with the executable file that contains the bitmap resource.wBMIDResource identifier for the bitmap resource. If hBMInst is NULL, this parameter must be a valid bitmap handle.lpButtonsPointer to an array of TBBUTTON structures that contains information about the buttons to add to the toolbar.iNumButtonsNumber of buttons to add to the toolbar.dxButton Width, in pixels, of the buttons to add to the toolbar.dyButton Height, in pixels, of the buttons to add to the toolbar.dxBitmap Width, in pixels, of the button images to add to the buttons in the toolbar. dyBitmapHeight, in pixels, of the button images to add to the buttons in the toolbar. uStructSizeSize of a TBBUTTON structure.

解决方案 »

  1.   

    你挺好玩的,这么些api的代码都写出来了,怎么这个问题搞不定呀
    你把HINST_COMMCTRL替换为你的程序的句柄,就是你的全局量hInst,把IDB_STD_SMALL_COLOR替换为你在你的资源文件里面定义的资源ID就可以啦。
    我很奇怪。sdk编程其实挺easy的,要善于看help,是繁了一点,不过写程序看起来也挺舒服的。
      

  2.   

    你挺好玩的,这么些api的代码都写出来了,怎么这个问题搞不定呀
    你把HINST_COMMCTRL替换为你的程序的句柄,就是你的全局量hInst,把IDB_STD_SMALL_COLOR替换为你在你的资源文件里面定义的资源ID就可以啦。
    我很奇怪。sdk编程其实挺easy的,要善于看help,是繁了一点,不过写程序看起来也挺舒服的。
      

  3.   

    谢谢,其实我的问题是:hInst=hInstance因该放在CreateWind之前,已经有高手替我解答了,不过我还是谢谢你!