zart Master Cheater
Reputation: 0
Joined: 20 Aug 2007 Posts: 351 Location: russia
|
Posted: Fri Oct 12, 2007 10:48 am Post subject: [masm] Transparent textboxes |
|
|
Probably me just being stupid (yet again) but anyone have any insight to this problem?
How do I get it to update ONLY the text box? Currently if I use invoke InvalidateRect, hWnd,NULL,1 - it works fine, but it updating my whole form. So I tried using SetRect - if I place this like it is below, it doesn't work - it's as if nothing is there. If I use SetRect in WM_CTLCOLOREDIT, the text is properly edited, but it is no longer transparent. If I put GetStockObject below the SetRect in WM_CTLCOLOREDIT it keeps the box transparent but does not update the text properly.
I don't really understand why it's doing this - since SetRect should just be setting a region and nothing else?
| Code: |
.elseif uMsg==WM_CTLCOLOREDIT
invoke GetDlgCtrlID,lParam
.if ax == IDC_NAME ; handle to edit control
invoke SetBkMode,wParam,TRANSPARENT;Background of Text
invoke SetTextColor,wParam, 0ffffffh ;TextColor
invoke GetStockObject,NULL_BRUSH ;return Transparent text background brush
;invoke SetRect, addr hName, 114, 39, 114+233, 39+19
ret
.endif
.elseif eax==WM_COMMAND
mov eax,wParam
.if ax==IDC_NAME
shr eax,16
.if ax==EN_CHANGE
; invoke Generate,hWnd
invoke SetRect, addr hName, 114, 39, 114+233, 39+19
invoke InvalidateRect, hWnd, addr hName, 1
;invoke InvalidateRect, hWnd,NULL,1
|
Edit I was being dumb;
First off the coord where wrong and i forgot a addr on "hName"
| Code: |
invoke SetRect, addr hName, 39, 118, 262, 134
invoke InvalidateRect, hWnd, addr hName, 1
|
works fine...
_________________
0x7A 0x61 0x72 0x74
TEAM RESURRECTiON |
|