Add this to the beginning of the file:
Code:
#define IDB_BUTTON1 50001
A code example, place it in your WM_CREATE:
Code:
HWND button;
button=CreateWindowEx(0,"Button","Buttontext", WS_BORDER | WS_CHILD | WS_VISIBLE | BS_PUSHBUTTON, 1, 1, 100, 23, hwnd, (HMENU)IDB_BUTTON1, GetModuleHandle(NULL), NULL);
And to change the font you can use:
Code:
HFONT hf;
long lf;
lf = -MulDiv(12, GetDeviceCaps(hdc, LOGPIXELSY), 72);
hf = CreateFont(lf, 0, 0, 0, FW_MEDIUM, FALSE, 0, 0, 0, 0, 0, 0, 0, "Times New Roman");
SendMessage(button,WM_SETFONT,(WPARAM)hf,TRUE);
You can use any other font instead of Times New Roman.
And if you want it to do something, when you click on the button, add this code to your message switch:
Code:
case WM_COMMAND:
switch(wParam){
case IDB_BUTTON1:
MessageBox(hwnd,"You clicked the button","Message",MB_OK | MB_INFORMATION);
return 0;
}
break;