Solved

Communicating between two services

Posted on 2014-10-28
2
204 Views
Last Modified: 2014-10-30
Hi,

If I want to communicate between two Services with the WM_CopyData messaging system then how to get the Handle of the Service ?
I would prefer not to use Socket / Named pipes.

I use Delphi on Windows.

Regards
Allan
0
Comment
Question by:Allan_Fernandes
[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 Comments
 
LVL 27

Accepted Solution

by:
Sinisa Vuk earned 500 total points
ID: 40408574
You can use custom message too - look in this article:
http://www.delphi-central.com/ipc_sendmessage.aspx

Custom message can be adopted to use WM_CopyData or just look how to find client app (using FindWindow)
This is not a fancy way - but works.

Second way is to broadcust a custom created message (RegisterWindowMessage) (send to not specific window) - but this is also not so usual way
0
 

Author Comment

by:Allan_Fernandes
ID: 40410055
Since it is a Service I will not get a result for FindWindow, that will not allow me to use the first option.

Broadcast will not be refined method either.

Please note that both the services are mine and I have the liberty to store details in a text file (eg: Handle etc) for the other service to read.
0

Featured Post

On Demand Webinar: Networking for the Cloud Era

Ready to improve network connectivity? Watch this webinar to learn how SD-WANs and a one-click instant connect tool can boost provisions, deployment, and management of your cloud connection.

Question has a verified solution.

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

The Windows functions GetTickCount and timeGetTime retrieve the number of milliseconds since the system was started. However, the value is stored in a DWORD, which means that it wraps around to zero every 49.7 days. This article shows how to solve t…
Determining the an SCCM package name from the Package ID
In this video, we discuss why the need for additional vertical screen space has become more important in recent years, namely, due to the transition in the marketplace of 4x3 computer screens to 16x9 and 16x10 screens (so-called widescreen format). …
Finding and deleting duplicate (picture) files can be a time consuming task. My wife and I, our three kids and their families all share one dilemma: Managing our pictures. Between desktops, laptops, phones, tablets, and cameras; over the last decade…

688 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