https://www.codeproject.com/Questions/591035/HowpluscanplusIpluscreateplusplusbuttonplusshowing



button에 텍스트 대신 이미지를 넣고 싶다면

속성창에서 버튼에 bitmap을 넣을지 icon을 넣을지 고른 후 고른 이미지 타입을 true로 변경


// use an icon
HICON hIcon = LoadIcon(hInstance, MAKEINTRESOURCE(IDR_MAINFRAME));
SendMessage(hButton, BM_SETIMAGE, (WPARAM)IMAGE_ICON, (LPARAM)hIcon);
 
// or use a bitmap
HANDLE hBitmap = LoadImage(hInstance, MAKEINTRESOURCE(IDR_BUTTON), IMAGE_BITMAP, 0, 0, LR_DEFAULTCOLOR);
SendMessage(hButton, BM_SETIMAGE, (WPARAM)IMAGE_BITMAP, (LPARAM)hBitmap);



hbutton은 getdlgItem으로 가져와서 셋팅하면 끝

'C++' 카테고리의 다른 글

c++11 typedef 사용하기  (0) 2018.01.08
enum to string  (0) 2017.08.03
char* to int  (0) 2017.04.07
rand  (0) 2017.02.20
int to string, int to char*  (0) 2016.12.02

+ Recent posts