[Okta Webinar] Learn how to a build a cloud-first strategyRegister Now


Set actionlist actions using Windows Messages

Posted on 2011-10-14
Medium Priority
Last Modified: 2012-05-12
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,

Question by:JeePeeTee
  • 2
  • 2
LVL 32

Expert Comment

by:Ephraim Wangoya
ID: 36971837

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!
LVL 21

Expert Comment

ID: 36973840
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.

Author Comment

ID: 36998265
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?

LVL 21

Accepted Solution

developmentguru earned 2000 total points
ID: 37002463
 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.

Author Closing Comment

ID: 37024775
Ok, thanks for all the info developmentguru.

Guess I have to find some other ways.

Featured Post

Independent Software Vendors: We Want Your Opinion

We value your feedback.

Take our survey and automatically be enter to win anyone of the following:
Yeti Cooler, Amazon eGift Card, and Movie eGift Card!

Question has a verified solution.

If you are experiencing a similar issue, please ask a related question

Introduction The parallel port is a very commonly known port, it was widely used to connect a printer to the PC, if you look at the back of your computer, for those who don't have newer computers, there will be a port with 25 pins and a small print…
Introduction Raise your hands if you were as upset with FireMonkey as I was when I discovered that there was no TListview.  I use TListView in almost all of my applications I've written, and I was not going to compromise by resorting to TStringGrid…
this video summaries big data hadoop online training demo (http://onlineitguru.com/big-data-hadoop-online-training-placement.html) , and covers basics in big data hadoop .
Is your data getting by on basic protection measures? In today’s climate of debilitating malware and ransomware—like WannaCry—that may not be enough. You need to establish more than basics, like a recovery plan that protects both data and endpoints.…
Suggested Courses
Course of the Month19 days, 3 hours left to enroll

834 members asked questions and received personalized solutions in the past 7 days.

Join the community of 500,000 technology professionals and ask your questions.

Join & Ask a Question