The ControlService API allows one send a control code to a Win32 service. However, what if I need to send (and receive) more than a control code? What is the best way to establish communication between a user-mode GUI Win32 application and a Win32 service, to exchange arbitrary pieces of data? (Assume I can compile both the service and the application). The method should work from Windows 2000 to Windows 7, and it should work for both the administrators and the standard users. Thanks!
相关问题
- the application was unable to start correctly 0xc0
- Handle button click in another application
- Why does a windows service, hosting an NserviceBus
- win32 Python - pythoncom error - ImportError: No m
- How to prevent windows from accessing and detectin
相关文章
- Service层和Dao层一定要对应吗?
- k8s 访问Pod 时好时坏
- XCopy or MOVE do not work when a WCF Service runs
- Why windows 64 still makes use of user32.dll etc?
- Can WM_NEXTDLGCTL be used with non-dialog windows?
- Async task does not work properly (doInBackground
- Windows EventLog: How fast are operations with it?
- Problem installing windows service
You can use pretty much any IPC mechanism. If your service and app are .net based, then the most common solution is to use WCF. For native code service and app, a very common solution is a named pipe. But what choice is best depends on your specific usage needs.
It sounds as though you intend for the service to respond to remote requests. For this, you can use named pipes, as already mentioned. Named pipes, however, are a little more complicated than TCP sockets.
If you take up TCP sockets programming (
socket()
,bind()
,listen()
, etc.), you will be able to port that knowledge to other platforms.