i'm reading these page: http://msdn.microsoft.com/en-us/library/windows/desktop/bb775951%28v=vs.85%29.aspx
but see the Remarks section:
Remarks
For illustrations of the principal button styles such as BS_CHECKBOX and BS_GROUPBOX, see Button Types.
The appearance of text or an icon or both on a button control depends on the BS_ICON and BS_BITMAP styles, and whether the BM_SETIMAGE message is sent. The possible results are as follows.
BS_ICON or BS_BITMAP set? BM_SETIMAGE called? Result
Yes Yes Show icon only.
No Yes Show icon and text.
Yes No Show text only.
No No Show text only
(the green it's the table)
for we use the BM_SETIMAGE, we must use the the SendMessage() function. now see my code:
LRESULT CALLBACK WndProc (HWND hwnd, UINT iMsg, WPARAM wParam, LPARAM lParam)
{
static HWND HandleButton;
static HICON HandleIcon;
switch (iMsg)
{
case WM_DESTROY:
DestroyIcon(HandleIcon);
PostQuitMessage (0) ;
return 0 ;
case WM_CREATE:
HandleButton=CreateWindow (TEXT("button"), TEXT ("hello\t\tHI"),
WS_CHILD | WS_VISIBLE | BS_DEFPUSHBUTTON | BS_LEFT,
100, 100,500, 200,hwnd, NULL, (HINSTANCE)GetModuleHandle(NULL), NULL) ;
HandleIcon=(HICON)LoadImage(NULL,"c:\\acrobat.ico",IMAGE_ICON,LR_DEFAULTSIZE,LR_DEFAULTSIZE,LR_LOADFROMFILE);
SendMessage(HandleButton, BM_SETIMAGE, IMAGE_ICON,(LPARAM)HandleIcon );
return 0;
}
return DefWindowProc (hwnd, iMsg, wParam, lParam) ;
}
i have sure about the path, unless the 'C' letter is case sensitive.
please tell me what i'm doing wrong with that information\code