i have developing a C++ Api project.
i will use dialogboxparam to create a dialogbox…
i done to create and set the textbox,labels and buttons…
its work fine…
now i want to add a image in the top of the dialogbox…
i did use this code in WM_INITDIALOG:
HBITMAP hImage= (HBITMAP)LoadImage(NULL,L"C:\\WINDOWS\\system32\\BMA-Images\\login-header",IMAGE_BITMAP,LR_DEFAULTSIZE ,LR_DEFAULTSIZE ,LR_LOADFROMFILE|LR_CREATEDIBSECTION);
SendMessage(_hwnd,STM_SETIMAGE,IMAGE_BITMAP,(LPARAM)hImage);
But it didnt work…
Can anyone help to resolve this…
Thanks in advance
Sonu
The easiest way is to override the WM_PAINT for the window and paint the bitmap at that point (between the BeginPaint and EndPaint) calls
There is an MFC based example here:
http://www.programmersheaven.com/mb/mfc_coding/113034/113034/how-do-i-set-a-background-picture-in-a-dialog-box-/