News:

MASM32 SDK Description, downloads and other helpful links
MASM32.com New Forum Link
masmforum WebSite

How to draw mouse selection ?

Started by ramguru, April 13, 2005, 07:42:19 PM

Previous topic - Next topic

ramguru

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 ?

pbrennick

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

ramguru

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.