Undocumented Corner
by George Shepherd and Scot Wingo

Listing One
class CCommandBar {
protected:
    HWND      m_hWndParent;
    CWnd*     m_pParentWnd;
    HINSTANCE m_hInst;
    int       m_iCBHeight;
public:
    HWND      m_hCommandBar;
    HMENU     m_hMenu;
    HWND      m_hComboBox;
    CCommandBar();
    ~CCommandBar();
    HWND  Create( HWND hWndParent );
    HWND  Reset();
    HMENU InsertMenu( LPCTSTR lpszMenuName );
    HMENU InsertMenu( UINT uiResourceID )
        { return InsertMenu( MAKEINTRESOURCE(uiResourceID) ); }
    HWND  InsertComboBox( int iWidth );
    BOOL  InsertButtons( TBBUTTON arTBButtons[], UINT uiNButtons, 
                             int iToolbarBitmapID=-1, int iNImages=0 );
    BOOL  AddBitmap( int iNImages, int iToolbarBitmapID );
    BOOL  AddComboBoxString( UINT uiStringResourceID, long lItemData=0 );
    BOOL  AddComboBoxString( LPCTSTR szString, long lItemData=0 );
    int   GetComboCount() const;
    int   GetComboCurSel() const;
    int   SetComboCurSel( int nSelect );
    BOOL  AddAdornments( DWORD dwFlags );  
// CMDBAR_HELP (WM_HELP) and/or CMDBAR_OK (WM_COMMAND, IDOK)
    int   GetHeight()  { return (int)m_iCBHeight; }
};

Listing Two
//  Windows Helpers that live in WCEHND.CPP
extern HWND WINAPI    wce_GetTopWindow( HWND hWnd );
extern HWND WINAPI    wce_GetNextWindow(HWND hWnd, UINT nDirection);
extern BOOL WINAPI    wce_RedrawWindow(HWND hWnd, 
CONST RECT *lprcUpdate, 
HRGN hrgnUpdate, UINT flags);
extern HWND WINAPI    wce_GetDesktopWindow(VOID);
extern BOOL           wce_ScrollWindow(HWND hWnd, 
int xAmount, int yAmount, 
LPCRECT lpRect, LPCRECT lpClipRect);

//  ScrollBar Helpers  (WCESCRL.CPP)

extern int  WINAPI    wce_GetScrollPos( HWND hWnd, int nBar);
extern BOOL WINAPI    wce_GetScrollRange( HWND hWnd, int nBar, 
                                        LPINT lpMinPos, LPINT lpMaxPos);
//////////////////////////////////////////////////////////////////////////
//  Miscellaneous  (WCE.CPP)
//////////////////////////////////////////////////////////////////////////
extern DWORD          wce_GetVersion();
extern FARPROC        wce_GetProcAddress( HMODULE hModule, LPCSTR lpProcName);
extern LONG WINAPI    wce_SendDlgItemMessageW(HWND hDlg, 
                      int nIDDlgItem, UINT Msg, WPARAM wParam, LPARAM lParam);
extern UINT WINAPI    wce_IsDlgButtonChecked(HWND hDlg, int nIDButton);
extern BOOL  WINAPI   wce_IsIconic( HWND hWnd );
extern BOOL           wce_BegAttach( HWND hWnd );
extern void           wce_EndAttach();
extern HLOCAL         wce_ReAlloc( HLOCAL hMem, UINT uBytes, 
UINT uFlags );
extern HWND           wce_CreateModelessDialog( LPCTSTR lpszResName,
                                   HWND hwndParent, DLGPROC lpfnHook );
extern HWND           wce_GetInternalHWND( HWND hWnd );
extern BOOL           PegHelp( LPCWSTR lpszHelpPath );
extern void AFX_CDECL wce_Trace( LPCTSTR lpszFormat, ...);
extern HMODULE        wce_LoadLibraryA( LPCSTR lpLibFileName );
extern void*          wce_expand( void* pvMemBlock, size_t iSize );
extern LPVOID         GlobalLock( HGLOBAL  hMem );
extern BOOL           GlobalUnlock( HGLOBAL  hMem );
extern HGLOBAL        GlobalHandle( LPCVOID pMem );
extern UINT           GlobalFlags( HGLOBAL  hMem );

// see WINCORE.CPP
extern LRESULT CALLBACK wce_DefWindowProc(HWND hWnd, UINT nMsg, 
WPARAM wParam, LPARAM lParam);
// see DLGFR.CPP
extern HWND             wce_FindText( LPFINDREPLACE lpfr );
// see DLGFR.CPP
extern HWND             wce_ReplaceText(LPFINDREPLACE lpfr);


