May be my question is too simple, i just still don't know how to make our dialog box has a color or have a bitmap background. I just now used resource studio from symantex and still don't know how to drag and drop picture like if we are using vcl editor in delphi, we can drag and drop picture and change background color easyly. I am just guessing that we must call LoadBitmap and then handle WM_PAINT message in our dialog box or may be i am wrong. all response will be appreciated
from what i've learn until now, in asm is not so easy: To put a bitmap on a window i think that there's no other way of this: 1. GetDc 2. CreateCompatibleDC (copy of DC but in memory) 3. load bitmap and put it on compatibleDC with SelectObject 3. BitBlt to copy virtual compatibleDC on your window. this is greatly explaind on Iczelion tutorial 25-26 Angelo
I have read it and use it in normal window :-> I am just curious if we use Bitmap in dialog box is it the same ? and how to make my background has a color. I use resource studio from symantex binding in nre.zip file downloaded from Hutch homepage and when i create a new dialog box there is a menu picture that we can make a rectangle area that may be i can put bitmap in there but i still don't know how to do it, just still trying this tool. If we manually use LoadBitmap and BitBlt or StretchBlt function it was hard to determine the correct position of our bitmap in dialog box that usually there are so many controls like PushButton,Edit and so on or may be in win32asm we must do that manually can not do that visually ?
to change the background color of a dialog you have to process the WM_CTLCOLORDLG message like this:
note that you have to return the handle of the brush that should be used for the backgroundcolor. in this case it is black. to put a bitmap on the dialog's background there is the following trick: create a static control in the dialog that has the same size as the dialog. the static control should have the style SS_BITMAP and the identifier of a bitmap that you have to put in your resource file too. if you need more help, e-mail me.
.elseif uMsg==WM_CTLCOLORDIALOG invoke SetTextColor,wParam,White invoke SetBkColor,wParam,Black invoke GetStockObject,BLACK_BRUSH ret
Ok thanks safcon for your info i am trying the color first :-> i tried your routine and worked but by the way why in windows.inc, i could'n find BRUSH that is BLUE_BRUSH i want to make my dialog box to be blue, i just found : WHITE_BRUSH equ 0 LTGRAY_BRUSH equ 1 GRAY_BRUSH equ 2 DKGRAY_BRUSH equ 3 BLACK_BRUSH equ 4 NULL_BRUSH equ 5 HOLLOW_BRUSH equ NULL_BRUSH what about for another color ? how to change the color of control background, such us pushbutton ? i guess we must to subclass this control but in what message i have to change this color ? WM_CTLCOLORDLG or what ? any response will be appreciated :->
i have tried to change my ctext and control like this : .elseif uMsg==WM_CTLCOLORSTATIC invoke SetTextColor,wParam,Magenta invoke SetBkColor,wParam,Blue invoke GetStockObject,LTGRAY_BRUSH ret it worked with background color is Blue and Foreground color is Magenta. But if i use it to change my dialog box background like this .elseif uMsg==WM_CTLCOLORDLG invoke SetTextColor,wParam,Magenta invoke SetBkColor,wParam,Blue invoke GetStockObject,LTGRAY_BRUSH ret it didn't work what is the rule about parameter we must pass in GetStockObject coincide with parameter in SetBkColor ?
it is not really necessary that you use GetStockObject, you can also use CreateSolidBrush