Set actionlist actions using Windows Messages

Hi all,

I've build a plug-in for another application which fills edit boxes with default entry values. This works fine.
But now I want to extend this function by disabling/enabling some actions in the other application's action list to apply some business rules.

Is there a way I can also set values to non-visual components through Windows Messages?

Thanks in advance,

Who is Participating?
developmentguruConnect With a Mentor PresidentCommented:
 As I understand it, the action list works based on the idle time of the application.  During this time the action list is scanned to see if a matching hot key is pressed to trigger activation of the event.  When a button has the action property set for a specific action then the OnClick event of the button is set to the Execute event of the action.  So, if the button is clicked then the action event is called.  If a hot key combination is pressed then the action list calls the event.

  Actions can be used with non visual controls too.  This, by itself, makes it obvious that Windows messages are not how the effect is implemented.

  If the user interface is not going to change, and you know the control you want to make use of is non-visual, then you can send a mouse down and mouse up at the relative coordinates of the non visual control.  Delphi interprets the coordinates to cause the click for the non visual control.

  I would really classify that type of programming as reckless.  It is too easily broken.
Ephraim WangoyaCommented:

If the host application exposes methods to handle its controls, then you can use those.
Otherwise you have to know the handle of the control you want to modify and use PostMessage.

The challenge is how to find the handle of the component and therein is the problem!
If you can compile the other application then you can add in your own message handling.  This would easily allow you to do what you are attempting.  The problem is that non visual controls tend to be non windows controls.  This means that normal message handling assumptions may not apply.  As ewangoya stated, your only other recourse would be to use an API the application provides.
JeePeeTeeAuthor Commented:
Unfortunately, I can't compile the other program and it's API is insufficient. That's why I try to work around it. I know the application is programmed in Delphi as well, but that's about everything I know.

So, you say that non-visual components can't be controlled by Windows Messages, because they are not native Windows Controls? But in the other program the buttons are attached to an action list. How are these attached actions controlled during run-time, since the attached buttons are Windows Controls?

JeePeeTeeAuthor Commented:
Ok, thanks for all the info developmentguru.

Guess I have to find some other ways.
Question has a verified solution.

Are you are experiencing a similar issue? Get a personalized answer when you ask a related question.

Have a better answer? Share it in a comment.

All Courses

From novice to tech pro — start learning today.