views:

399

answers:

3
// Toolbar.rc
#include "resource.h"
IDI_MAINICON2 ICON "MainIcon.ico"

// resource.h
#define IDI_MAINICON2 201


// main.cpp
icon_button =   CreateWindow(TEXT("button"), TEXT("Button"),    
                  WS_VISIBLE | WS_CHILD | BS_PUSHBUTTON | 
                          BS_ICON | BS_TEXT,
                  80, 80, 55, 40,        
                  hwnd, (HMENU) 2, NULL, NULL);

// First Declare HICON hIcon1 at top of program and then
// use it to store Loaded icon 
hIcon1 = LoadIcon (NULL, IDI_INFORMATION);
SendMessage(icon_button,BM_SETIMAGE,IMAGE_ICON,(LPARAM)hIcon1);

This wont work it sets the icon at the bottom toolbar to the icon but the top little one to the left is not working and it does not show up onto my button

I do know it since i was writing it!!!

A: 

I can't read the code properly... please use the code formation Maybe you should look at that stackoverflow c++ icon

n00ki3
A: 

Read MSDN. (Newbie notion)

A: 

Unfortunately your example is incomplete - you mention two toolbars but your example creates a button control. That makes it essentially impossible to answer your question.

Larry Osterman