I tried searching this board for this api but I got some sort of vbscript runtime error. I've checked the api help and this is my question. I have an edit box with text in it which I set with SetWindowText. Can I use SetTextColor to change the text color of the existing text, or do I first have to write that text with TextOut/ExtTextOut? While I'm here I might as well ask my other question. I've got a bitmap that I'm loading in the WM_PAINT event, and when I drag the window around the screen it refreshes perfectly. However when I minimize it and restore it my dialog appears to be offset about 15 or so pixels beneath the window's title bar. Forgive me as I don't have my source in front of me, but I'm positioning the bitmap using a rect struct. Could that be the problem? Do I have to somehow track the coordinates of the window as it gets moved/minimized and update the coordinates of the rect when painting the bitmap? --4oh4
Posted on 2001-01-05 12:54:00 by 4oh4
I dunno about edit box messages, but I do know bitmaps It sounds like you're not geting the client area dims correctly. These can be somewhat tricky to get, as the API's don't quite give you what you want, ie, you want client dims but wind up getting screen dims (I forget the exact mess ups). Anyway, I have a couple of tuts on something similar, Custom window shapes and sizes, ignore the region stuff, look at how the client area is determines. Also check the scroll bar stuff, took a long time to puzzle out where that dang thing was ans should be moved. The math is explained there. Oh, I just redid the pages, lemmy know if the stuff ain't there please. I'll be home tonight to fix. ;-D http://here.is/COMinASM
Posted on 2001-01-05 15:06:00 by Ernie
Thanks, I've looked at the custom windows tut and now I'm back on the right track I believe. I still haven't gotten it right yet, but hey this stuff isn't exactly easy huh? Anyways thanks to this board and all the incredible tuts at Icz's site for making learning asm a lot easier. Thanks again Ernie, 4oh4
Posted on 2001-01-05 21:32:00 by 4oh4
As to changing the text color in an edit box with SetTextColor, your dialog box must respond to WM_CTLCOLOREDIT message and use the hdc supplied by Windows in wParam with SetTextColor. You can check this technique in my Pipe tutorial. Btw, what string did you use to search the forum? I would like to know so I can fix the problem. Thanks
Posted on 2001-01-05 22:52:00 by Iczelion
I just searched for "SetTextColor". --4oh4
Posted on 2001-01-06 01:12:00 by 4oh4
Say I have an variable in my initialized data section with a value of say "00ff00ffh". How do I go about passing that color value to the SetTextColor function? --4oh4
Posted on 2001-01-07 14:58:00 by 4oh4
invoke SetTextColor, hdc,00FF00FFh
Posted on 2001-01-07 18:52:00 by Iczelion
Icz, what I had meant was... how do I pass a color value that is stored in a variable to SetTextColor? invoke SetTextColor,wParam,addr color ;color being the variable holding my color value.....however this doesn't work --4oh4
Posted on 2001-01-07 21:06:00 by 4oh4
Dont put addr. invoke SetTextColor,hdc,color
Posted on 2001-01-07 21:21:00 by Varunun
You know I must really be doing something wrong because that doesn't seem to be working. If it's not asking too much, could you write a small example for me? --4oh4
Posted on 2001-01-08 20:54:00 by 4oh4
Thanks for all your help. I found my error. --4oh4
Posted on 2001-01-09 22:42:00 by 4oh4