News:

MASM32 SDK Description, downloads and other helpful links
MASM32.com New Forum Link
masmforum WebSite

Static control with bitmap

Started by peaslee, May 11, 2012, 04:22:36 PM

Previous topic - Next topic

peaslee

I just can't get this to work:


DlgProc PROC hWnd:HWND,iMsg:DWORD,wParam:WPARAM, lParam:LPARAM
        .if iMsg==WM_INITDIALOG
        invoke LoadBitmap,hInstance,IDB_ABOUT_LOGO
mov    hAboutBitmap, eax                           ; icon handle
invoke GetDlgItem, hWnd, IDC_ABOUT_LOGOSTATIC       ; eax = handle of dialog static control

Invoke SendDlgItemMessage, eax, IDC_ABOUT_LOGOSTATIC,  STM_SETIMAGE, IMAGE_BITMAP, hAboutBitmap



It would seem to be a common task, to put the bitmap into the static control, but I have been unable to find an example.

I just corrected the title spelling.  :bg
Bruce Peaslee
"Reality is a crutch for those who can't do drugs."

peaslee

Never mind. It a style error and the wrong code.    ::)
Bruce Peaslee
"Reality is a crutch for those who can't do drugs."

dedndave

if you use GetDlgItem - you have a handle for the static, so you can use SendMessage
if you use SendDlgItemMessage, you do not need to get a handle to the static first - just use the control ID

if you need to store the static handle for other purposes, use the first method   :P