Hey all how would I specify the background and text color for my overall program? (Im using a dialogasmain app in RADAsm). I have tried it before but failed. I have tried this but it doesnt seem to want to work:
I tried putting that in the WM_INITDIALOG block but it didnt seem to work (which I figured would). Any help is much appreciated.
invoke SetTextColor,wParam,Yellow
invoke SetBkColor,wParam,Black
ret
I tried putting that in the WM_INITDIALOG block but it didnt seem to work (which I figured would). Any help is much appreciated.
Afternoon, resistance_is_futile.
Are you asking how to make the colour of your dialog black, and its text yellow?
Cheers,
Scronty
Are you asking how to make the colour of your dialog black, and its text yellow?
Cheers,
Scronty
Not exactly. More on the lines of Red and grey ( I think will do nicely) like a dark red and dark grey.
Afternoon, resistance_is_futile.
Here's a start:
Hope this helps a little.
Cheers,
Scronty
Here's a start:
.
.
.
.data
; stuff for colouring the dialog box
dwYellowColour DWORD 00000FFFFh
hYellowBrush dd 0
dwDarkYellowColour DWORD 000508CB4h
hDarkYellowBrush dd 0
.
.
.
;--------------------------------------------------------
;---- WM_INITDIALOG
.if uMsg==WM_INITDIALOG
; create the colours
invoke CreateSolidBrush, dwYellowColour
mov hYellowBrush, eax
invoke CreateSolidBrush, dwDarkYellowColour
mov hDarkYellowBrush, eax
.
.
.
;--------------------------------------------------------
;---- WM_CTLCOLORDLG
;--------------------------------------------------------
;---- WM_CTLCOLOREDIT
;--------------------------------------------------------
;---- WM_CTLCOLORSTATIC
;--------------------------------------------------------
;---- WM_CTLCOLORBTN
;--------------------------------------------------------
;---- WM_CTLCOLORLISTBOX
;--------------------------------------------------------
;---- WM_CTLCOLORSCROLLBAR
; this message is for deciding what colours
; to use in painting our dialog controls
.elseif uMsg == WM_CTLCOLORDLG || \
uMsg == WM_CTLCOLOREDIT || \
uMsg == WM_CTLCOLORSTATIC || \
uMsg == WM_CTLCOLORBTN || \
uMsg == WM_CTLCOLORLISTBOX || \
uMsg == WM_CTLCOLORSCROLLBAR
; set the foreground colour of the text
INVOKE SetTextColor, wParam, dwYellowColour
; set the background colour of the text
INVOKE SetBkColor, wParam, dwDarkYellowColour
; in processing this message, we return the handle
; of a brush which is used to paint the background
; of the dialog
mov eax, hDarkYellowBrush
ret
.
.
.
;--------------------------------------------------------
;---- WM_DESTROY
.elseif uMsg == WM_DESTROY
; get rid of the brushes
invoke DeleteObject, hYellowBrush
invoke DeleteObject, hDarkYellowBrush
Hope this helps a little.
Cheers,
Scronty