Zohar Posted November 10, 2009 Share Posted November 10, 2009 (edited) HelloI know how to check the Selection's Length for regular EDIT control - I do it via _GUICtrlEdit_GetSel($CurrentControl_Handle).But let's say the selected text can be in many other types of Text Writing Controls,for example Microsoft Word, or any other thing.Is there a way to ask windows something about the Selection, without asking Current Control about it?Some kind of API that check if anything is Selected, and then the Length of it?If I try to simulate Ctrl-C, use ClipGet(), and then Check the Length of the returned value, there's 1 problem:If nothing is selected, then the returned value is the last Ctrl-C that the user has done.So it's not a reliable wayThank you Edited November 10, 2009 by Zohar Link to comment Share on other sites More sharing options...
AdmiralAlkex Posted November 10, 2009 Share Posted November 10, 2009 You could use ClipPut() to empty the clipboard before doing the CTRL+C. .Some of my scripts: ShiftER, Codec-Control, Resolution switcher for HTC ShiftSome of my UDFs: SDL UDF, SetDefaultDllDirectories, Converting GDI+ Bitmap/Image to SDL Surface Link to comment Share on other sites More sharing options...
somdcomputerguy Posted November 10, 2009 Share Posted November 10, 2009 (edited) Maybe do a ClipGet first, then Ctrl-C and another ClipGet. Check the two ClipGet values, if they're not equal, Check the Length.. Not perfect though, if the second Copy is supposed to be the same as the second one...or you could do as AdmiralAlkex posted.. Edited November 10, 2009 by snowmaker - Bruce /*somdcomputerguy */ If you change the way you look at things, the things you look at change. Link to comment Share on other sites More sharing options...
Zohar Posted November 14, 2009 Author Share Posted November 14, 2009 (edited) Hi Thank you for the ideas. those 2 ideas will actually get what I want, however the only disadvantage is that the first will Clear the clipboard, even if nothing is selected, and the second can thin nothing is selected, if the same string is selected like before. So I should assume there's no API that can check the Length of the Selection? If anyone knows, please write me.. Thank you Edited November 14, 2009 by Zohar Link to comment Share on other sites More sharing options...
Recommended Posts
Create an account or sign in to comment
You need to be a member in order to leave a comment
Create an account
Sign up for a new account in our community. It's easy!
Register a new accountSign in
Already have an account? Sign in here.
Sign In Now