Why isn't this making a toolbar?

This is a discussion on Why isn't this making a toolbar? within the Windows Programming forums, part of the Platform Specific Boards category; Code: case WM_CREATE: HWND ToolBar; ToolBar = CreateWindowEx(0, TOOLBARCLASSNAME, NULL, WS_CHILD | WS_VISIBLE, 0, 0, 0, 0, hwnd, (HMENU)ID_TOOLBAR, GetModuleHandle(NULL), ...

  1. #1
    left crog... back when? incognito's Avatar
    Join Date
    Oct 2001
    Posts
    1,427

    Why isn't this making a toolbar?

    Code:
    		case WM_CREATE:
    				
    		HWND ToolBar;
    				
    		ToolBar = CreateWindowEx(0, TOOLBARCLASSNAME, NULL, WS_CHILD | WS_VISIBLE, 0, 0, 0, 0,
    		hwnd, (HMENU)ID_TOOLBAR, GetModuleHandle(NULL), NULL);
    			
    
    			// Send the TB_BUTTONSTRUCTSIZE message, which is required for
    			// backward compatibility.
    			SendMessage(ToolBar, TB_BUTTONSTRUCTSIZE, (WPARAM)sizeof(TBBUTTON), 0);
    			TBADDBITMAP BmpMenusIcons;
    
    			BmpMenusIcons.hInst=HINST_COMMCTRL;
    			BmpMenusIcons.nID=IDB_STD_SMALL_COLOR;
    
    			TBBUTTON buttons;
    
    			buttons.iBitmap=STD_FILENEW;
    			buttons.fsState=TBSTATE_ENABLED;
    			buttons.fsStyle=TBSTYLE_BUTTON;
    			buttons.idCommand=ID_OPEN;
    Last edited by incognito; 04-23-2003 at 10:38 PM.
    There are some real morons in this world please do not become one of them, do not become a victim of moronitis. PROGRAMMING IS THE FUTURE...THE FUTURE IS NOW!!!!!!!!!

    "...The only real game I thank in the world is baseball..." --Babe Ruth

    "Life is beautiful"-Don Corleone right before he died.

    "The expert on anything was once a beginner" -Baseball poster I own.


    Left cprog on 1-3-2005. Don't know when I am coming back. Thanks to those who helped me over the years.

  2. #2
    It's full of stars adrianxw's Avatar
    Join Date
    Aug 2001
    Posts
    4,831
    What error is it giving you?

    There is also the CreateToolbarEx() routine.
    Wave upon wave of demented avengers march cheerfully out of obscurity unto the dream.

  3. #3
    left crog... back when? incognito's Avatar
    Join Date
    Oct 2001
    Posts
    1,427
    It wasn't giving me any errors, but it was giving me problems, I wasn't even sending messages to windows to add the pictures for the toolbar and a lot of other stuff.
    There are some real morons in this world please do not become one of them, do not become a victim of moronitis. PROGRAMMING IS THE FUTURE...THE FUTURE IS NOW!!!!!!!!!

    "...The only real game I thank in the world is baseball..." --Babe Ruth

    "Life is beautiful"-Don Corleone right before he died.

    "The expert on anything was once a beginner" -Baseball poster I own.


    Left cprog on 1-3-2005. Don't know when I am coming back. Thanks to those who helped me over the years.

  4. #4
    It's full of stars adrianxw's Avatar
    Join Date
    Aug 2001
    Posts
    4,831
    Allright, so what problems?

    First, is the CreateWindowEx() returning a valid handle? If not why not?
    Wave upon wave of demented avengers march cheerfully out of obscurity unto the dream.

  5. #5
    left crog... back when? incognito's Avatar
    Join Date
    Oct 2001
    Posts
    1,427
    Sorry I forgot to mention, it's working for me now, thanks Adrianxw, a little bit of problem with placing it in the right place but that should get fixed later on. Thanks.
    There are some real morons in this world please do not become one of them, do not become a victim of moronitis. PROGRAMMING IS THE FUTURE...THE FUTURE IS NOW!!!!!!!!!

    "...The only real game I thank in the world is baseball..." --Babe Ruth

    "Life is beautiful"-Don Corleone right before he died.

    "The expert on anything was once a beginner" -Baseball poster I own.


    Left cprog on 1-3-2005. Don't know when I am coming back. Thanks to those who helped me over the years.

Popular pages Recent additions subscribe to a feed

Similar Threads

  1. toolbar button question
    By supernater in forum Windows Programming
    Replies: 1
    Last Post: 05-25-2009, 08:24 PM
  2. Toolbar color
    By mrafcho001 in forum Windows Programming
    Replies: 2
    Last Post: 04-17-2006, 10:55 AM
  3. Dockable Toolbar (Like taskbar or office toolbar)
    By om3ga in forum Windows Programming
    Replies: 2
    Last Post: 11-20-2005, 02:09 AM
  4. What toolbar editor do you use?
    By _Elixia_ in forum Windows Programming
    Replies: 1
    Last Post: 08-09-2003, 04:57 AM
  5. Wild toolbar effect in MFC
    By Guardian in forum Windows Programming
    Replies: 0
    Last Post: 05-15-2002, 05:12 PM

1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21