Click to See Complete Forum and Search --> : How dose windows know?
Mass
Jun 20th, 2000, 08:40 PM
Hi
When you open say the Notepad with some text in it and rightclick on the texts a popup menue appears with the Copy section not enabled.
As soon as you select some text and you rightclick again
you see the copy section of the menu is enabled.
How dose windows know when the text is selected?
Sam Finch
Jun 20th, 2000, 11:01 PM
It Doesn't, Notepad knows, Notepad is essentially a big textbox, you can check if a textbox has any text selected with CBool(Text1.SelLength)
Mass
Jun 22nd, 2000, 04:59 AM
Thanks Sam but Could you tell me more. I don't know
anything about CBool(Text1.SelLength)
CBool will convert the statement to Boolean. Therefor, if SelLength = 0 then a False is returned (because False means 0) and if you do select and text, the length (SelLength) is greater than 0 so it returns True.
So if the Statement is True, then you enabled the Copy menu.
Mass
Jun 22nd, 2000, 05:49 AM
Sorry But I need to be able to detect it from a vb application and while you are at it, could you please tell me how do I know (again from vb) if the mouse is clicked or
dblclicked in external applications
Thanks
kedaman
Jun 22nd, 2000, 05:49 AM
Here also, he's talking about selected text in foreign applications, go look at my subclassing sample
vbforums.com
Copyright Internet.com Inc., All Rights Reserved.