Jump to content
Xtreme .Net Talk

Recommended Posts

Posted

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!

Posted (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 by murlopaz
  • Administrators
Posted

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?

Posting Guidelines FAQ Post Formatting

 

Intellectuals solve problems; geniuses prevent them.

-- Albert Einstein

Posted

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.

  • Administrators
Posted

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.

Posting Guidelines FAQ Post Formatting

 

Intellectuals solve problems; geniuses prevent them.

-- Albert Einstein

Posted

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

Join the conversation

You can post now and register later. If you have an account, sign in now to post with your account.

Guest
Reply to this topic...

×   Pasted as rich text.   Paste as plain text instead

  Only 75 emoji are allowed.

×   Your link has been automatically embedded.   Display as a link instead

×   Your previous content has been restored.   Clear editor

×   You cannot paste images directly. Upload or insert images from URL.

×
×
  • Create New...