murlopaz Posted June 29, 2006 Posted June 29, 2006 I am trying to check if a ToolStripButton is enabled on a ToolStrip within some application. How do I do that? Note: i am trying to do this within my own program (the ToolStrip is on a different app that I have access to (code)) Note: i was trying to use Spy++ to find the handle of the button but with no success, it recognizes the toolstrip+button as a whole component, on the other hand if you have a ToolStripComboBox on the ToolStrip, the ComboBox has a handle... i was thinking of using SendMessage to accomplish my task. Any will be much appreciated! Quote
Leaders snarfblam Posted June 29, 2006 Leaders Posted June 29, 2006 Is the other app .Net? Quote [sIGPIC]e[/sIGPIC]
murlopaz Posted June 30, 2006 Author Posted June 30, 2006 (edited) Is the other app .Net? yes it is. Plus I don't want to make any changes to the code of the app with the toolstrip. Edited June 30, 2006 by murlopaz Quote
Administrators PlausiblyDamp Posted July 5, 2006 Administrators Posted July 5, 2006 It looks as though the individual buttons are not implemented as individual windows (which does make sense in terms of performance / resource usage) , controls that need to receive their own messages (TextBox etc.) are however treated as a window. It would appear that internally the toolstrip control decides which button was clicked etc. by checking the mouse co-ordinates. This, unfortunately, doesn't really give an easy way of detecting (or really any form of interaction with) individual buttons. There may be an alternate solution to your problem, could you give some more details about what you are trying to do and the reasons why? Quote Posting Guidelines FAQ Post Formatting Intellectuals solve problems; geniuses prevent them. -- Albert Einstein
murlopaz Posted July 7, 2006 Author Posted July 7, 2006 well i am trying to check weather buttons on the toolstrip are enabled or not, as well as i am trying to click on buttons without using the coordinate system. Moreover my general question was: is it possible to control one application from another if you have both the code of the first and second one. I've heard something about COM, but i am not sure if it the solution for my problem. p.s. and yeah... i am using SIlktest for testign some app written in .NET. You guessed my problem indeed in your post. Quote
Administrators PlausiblyDamp Posted July 10, 2006 Administrators Posted July 10, 2006 If you have the code to both and you can make changes to the one you want to control then it is certainly possible. If you are not in a position to change the source then it looks that it is either impossible or potentially far too much work to be practical. Quote Posting Guidelines FAQ Post Formatting Intellectuals solve problems; geniuses prevent them. -- Albert Einstein
murlopaz Posted July 13, 2006 Author Posted July 13, 2006 alright... i have to test a piece of software written by developers. I am using an automate tool for that that doesn't see toolstripbuttons. I know for sure there is a way to write a dll that would communicate to silk and the software being tested. That's why I wanna know how I can manipulate that toolstripbutton... from another process. Thanks Quote
Recommended Posts
Join the conversation
You can post now and register later. If you have an account, sign in now to post with your account.