The MASM Forum Archive 2004 to 2012

General Forums => The Campus => Topic started by: ramguru on April 13, 2005, 07:42:19 PM

Title: How to draw mouse selection ?
Post by: ramguru on April 13, 2005, 07:42:19 PM
I'm a bit confused about that. In notepad color of mouse selection is blue and text color is white. So it is not a result of InvertRgn (it would be black and white). Another puzzle is how to combine different length rectangular regions (multiple line selection) to one, there is no such api like exclude region (when I need disselect some lines, part of line). Am I in a wrong way ? Could someone say a few words, links ?
Title: Re: How to draw mouse selection ?
Post by: pbrennick on April 13, 2005, 08:18:05 PM
Hi ramguru,
Use GetSysColor to retrieve any of the various color settings used by the system (and there are more than you would think), look it up in the API to see what flag to use to get a particular setting.  You can use SetSysColor to change the default settings, if you so desire.

Paul
Title: Re: How to draw mouse selection ?
Post by: ramguru on April 13, 2005, 09:22:14 PM
Hey, but I need no default settings. I have my own edit class and want to implement particular feature like text selection. I figured out the first part
something like:
WM_PAINT:
....
invoke FillRgn,hmem,region,inverted_color
invoke DrawText...
invoke InvertRgn...
But I have no ideas how to draw multiple line selection.