Hello guys
I want to show Icon and text on a single button.
I create a button as this:
int iStyle = BS_TEXT | BS_NOTIFY | BS_VCENTER | WS_GROUP | WS_CHILD | WS_VISIBLE | WS_TABSTOP;
HWND hWnd = CreateWindowExW(0, L"BUTTON", L"MyText", iStyle, x, y, cx, cy, hwndDlg, nullptr, hInst, nullptr);
const wchar_t * wszIconId = MAKEINTRESOURCEW(IDI_MYICON);
int cpImageSize = cy - 4;
HICON hIcon = (HICON)LoadImage(hInstance, wszIconId, IMAGE_ICON, cpImageSize, cpImageSize, LR_SHARED);
SendMessage(hWnd, BM_SETIMAGE, (WPARAM)IMAGE_ICON, (LPARAM)hIcon);
This code works fine on Windows 7 and 8, But on windows XP only text is displayed. If I use BS_ICON style, then icon only is displayed fine on Win XP.
I found many similiar posts in google, but no solution.
Is this a Problem with Windows XP? Is any way to solve this problem?
any suggestions appretiated.
mr.abzadeh