Solved

SendMessage to service application (delphi  7)

Posted on 2009-05-05
4
2,163 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
  • 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

Free Tool: IP Lookup

Get more info about an IP address or domain name, such as organization, abuse contacts and geolocation.

One of a set of tools we are providing to everyone as a way of saying thank you for being a part of the community.

Question has a verified solution.

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

Hello everybody This Article will show you how to validate number with TEdit control, What's the TEdit control? TEdit is a standard Windows edit control on a form, it allows to user to write, read and copy/paste single line of text. Usua…
Introduction I have seen many questions in this Delphi topic area where queries in threads are needed or suggested. I know bumped into a similar need. This article will address some of the concepts when dealing with a multithreaded delphi database…
Established in 1997, Technology Architects has become one of the most reputable technology solutions companies in the country. TA have been providing businesses with cost effective state-of-the-art solutions and unparalleled service that is designed…
Nobody understands Phishing better than an anti-spam company. That’s why we are providing Phishing Awareness Training to our customers. According to a report by Verizon, only 3% of targeted users report malicious emails to management. With compan…

861 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