Skocz do zawartości

Ikona na przycisku


Recommended Posts

Napisano

Witam,
mam taki problem rysuje sobie przycisk w c :
CreateWindow("button", "text", WS_CHILD | WS_VISIBLE|BS_ICON, 1,1,20,30, hwnd, (HMENU)100, hInstance, 3);
i chcialbym narysowac na nim ikonke ale nie mam pojecia jak to zrobic.
z gory dzieki za pomoc .

FranZ

Napisano

Należy wysłać do buttona komunikat BM_SETIMAGE.

SendMessage( 
  (HWND) hWnd,         // handle to destination window 
  BM_SETIMAGE,         // message to send
  (WPARAM) wParam,     // image type
  (LPARAM) lParam      // handle to the image (HANDLE)
);

Parameters:

wParam
Specifies the type of image to associate with the button. This parameter can be one of the following values:
IMAGE_BITMAP
IMAGE_ICON

lParam
Handle to the image to associate with the button.

Join the conversation

You can post now and register later. If you have an account, sign in now to post with your account.

Gość
Odpowiedz...

×   Wkleiłeś zawartość bez formatowania.   Usuń formatowanie

  Only 75 emoji are allowed.

×   Your link has been automatically embedded.   Display as a link instead

×   Your previous content has been restored.   Clear editor

×   You cannot paste images directly. Upload or insert images from URL.

×
×
  • Utwórz nowe...