Solved

SendMessage to service application (delphi  7)

Posted on 2009-05-05
4
2,202 Views
Last Modified: 2012-06-27
how can I send a message using SendMessage to a service application? it looks like the FindWindow doesnt find any window.

I dont want to use TCP/IP communication. I just need a quick way to send a short message without arguments to the service.
0
Comment
Question by:WebWolf1
[X]
Welcome to Experts Exchange

Add your voice to the tech community where 5M+ people just like you are talking about what matters.

  • Help others & share knowledge
  • Earn cash & points
  • Learn & ask questions
  • 2
4 Comments
 
LVL 18

Expert Comment

by:Johnjces
ID: 24307054
Have a look at this Q still up on EE.

http://www.experts-exchange.com/Programming/Languages/Pascal/Delphi/Q_24376994.html

There is a link, I think, for SimpleIPC which uses FindWindow (source is included) that might help you and the entuire thread might be of assistance. Her is some of my info.....

If you do not want to use TCP/IP you could use mailslots which are not like email.

I have used them (mailslots) and they work just great.

You could also use a components called TssSimpleIPC from SunnisSoft. This uses WIndows Messaging (added via FindWindow).

http://www.sunisoft.com
http://www.torry.net/vcl/system/appscommunications/simpleipc.zip

It works very well in services and applications and it is free. Not sure what version of Delphi so could take some tweaking in newer versions.

John
0
 
LVL 18

Expert Comment

by:Johnjces
ID: 24307093
Added...

I must add that I have never used FIndWindow to "talk" to a service. I am pretty certain that you cannot talk to a service from an application using findwindow since a service does not have a window to find.

From service to application seems to work great for me and I had no problems in Vista either.

You will have to use a mailslot component. Look on torry or delphipages for mailslots.

John
0
 
LVL 12

Expert Comment

by:Hypo
ID: 24333464
If you for some reason can't send Windows messages to the service (like if the service don't have a window handle), then you could have your service create a named pipe, to which your other applications then can connect to and send messages. (I think this is quite a common way to communicate with services).
Rlibby (who is an expert in this forum), has created and published a vary good unit that can help you with pipe communication. To download, goto http://home.roadrunner.com/~rllibby/source.html, and get the file pipes.zip.

regards
Hypo
0
 

Accepted Solution

by:
WebWolf1 earned 0 total points
ID: 24365137
You are both wrong. FindWindow works well in services unless you know the class name.
I fixed it.
0

Featured Post

Technology Partners: 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

In this tutorial I will show you how to use the Windows Speech API in Delphi. I will only cover basic functions such as text to speech and controlling the speed of the speech. SAPI Installation First you need to install the SAPI type library, th…
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…
If you're a developer or IT admin, you’re probably tasked with managing multiple websites, servers, applications, and levels of security on a daily basis. While this can be extremely time consuming, it can also be frustrating when systems aren't wor…
In this brief tutorial Pawel from AdRem Software explains how you can quickly find out which services are running on your network, or what are the IP addresses of servers responsible for each service. Software used is freeware NetCrunch Tools (https…

705 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