flat assembler
Message board for the users of flat assembler.

Index > Windows > readonly edit control color

Author
Thread Post new topic Reply to topic
dacid



Joined: 31 Aug 2008
Posts: 57
dacid
I use this code to make the readonly edit control white color.

.ELSEIF uMsg == WM_CTLCOLORSTATIC
invoke GetWindowLong,lParam,GWL_ID
.IF eax == IDC_EDIT
invoke GetStockObject,WHITE_BRUSH
ret
.ENDIF

The problem is that other controls displaying text in the dialogbox, gets the white background also.

CONTROL "",IDC_EDIT,"Edit",WS_CHILD|WS_VISIBLE|WS_TABSTOP|ES_READONLY|ES_AUTOHSCROLL,28,38,194,11,WS_EX_CLIENTEDGE

CONTROL "File:",IDC_STATIC,"Static",WS_CHILD|WS_VISIBLE,10,19,16,11

IDC_EDIT equ 3000
IDC_STATIC equ -1

Why?
Post 28 Sep 2008, 15:44
View user's profile Send private message Reply with quote
revolution
When all else fails, read the source


Joined: 24 Aug 2004
Posts: 17663
Location: In your JS exploiting you and your system
revolution
What does your code do (what value is left in EAX) if the GWL_ID is not equal to IDC_EDIT?
Post 28 Sep 2008, 15:51
View user's profile Send private message Visit poster's website Reply with quote
dacid



Joined: 31 Aug 2008
Posts: 57
dacid
nothing .. goes to the next .ELSEIF uMSg == WM_COMMAND
Post 28 Sep 2008, 16:10
View user's profile Send private message Reply with quote
dacid



Joined: 31 Aug 2008
Posts: 57
dacid
ok, you give me the key ...

xor eax,eax
ret

it works now, thx Smile
Post 28 Sep 2008, 16:13
View user's profile Send private message Reply with quote
Display posts from previous:
Post new topic Reply to topic

Jump to:  


< Last Thread | Next Thread >
Forum Rules:
You cannot post new topics in this forum
You cannot reply to topics in this forum
You cannot edit your posts in this forum
You cannot delete your posts in this forum
You cannot vote in polls in this forum
You cannot attach files in this forum
You can download files in this forum


Copyright © 1999-2020, Tomasz Grysztar. Also on GitHub, YouTube, Twitter.

Website powered by rwasa.