On Sat, 6 Mar 2010, "Arí Ricardo Ody" wrote:


 

I would like to know if it's possible to make a program to detect if a service 
has started in windows. If affirmative this service shows a
window and I must to simulate a click on the “yes” button of this same window, 
e.g, the program will think that someone click yes in the
windows it shows when it starts.


Is it possible to do a program with Lazarus or FPC that solves this problem? If 
affirmative may someone send me an example of how to do
this?

You can use the TServiceManager component to detect whether a service runs.
I have coded this component, it is in active use in commercial projects.

But there is a strange thing about your story: as of Windows Vista, service
applications can no longer display a window on the desktop, Windows no longer
allows that. So probably, the window is displayed by some other program that
comes with the service ?

You can send a keypress to this program's window with the FindWindow call to
get the handle and then use a PostMessage() call to send a click or keypress.

Michael.
--
_______________________________________________
Lazarus mailing list
[email protected]
http://lists.lazarus.freepascal.org/mailman/listinfo/lazarus

Reply via email to