Inside the Windows Messaging System (1993)
drdobbs.com
drdobbs.com
It just-so-happens that unlike an actor-process, a Windows window usually has a GUI element attached to it. But not always! “Hidden windows”—i.e. plain actor-processes without the extra GUI bits—were the design pattern for doing background stuff for a long time before Windows introduced background services.
I bet some Windows developer here has a story of “that time I built an actor-modelled system just using Windows primitives.”
Isn't it still the same? cmd can't be hidden and this is the advice I found looking to do something around 5 years ago. Unless you want services but those have certain limitations. No idea why they found it appropriate to prevent services from interacting with the desktop post-XP.
It’s an architecture thing. Background services are supposed to be light things that just do the stuff the user can’t do at their own privilege level; they aren’t supposed to do stuff at the user’s privilege level, like showing windows, because mixing in that secondary concern increases their attack surface. Instead, if you have some background system that has some user-level concerns (like a GUI) and some system-level concerns, you’re supposed to build it as two programs: a tray utility or configuration program, which acts as an IPC client; and a background service, which acts as an IPC server.
You’re correct in that, even today, if you want a background service to be able to just arbitrarily pop up a message to you, you’re going to be writing a tray utility as a Win32 process that starts with a rootmost hidden window, to catch the IPC message the background service sends.
Named pipe carries security context. That's why newer Windows requires background services to close off all outside contacts except named pipe, so the service can control the access level.
That's been a real pain for me, there are some API's I'd love to use but they aren't supported from a Windows service.
https://en.wikipedia.org/wiki/Dynamic_Data_Exchange
https://docs.microsoft.com/en-us/windows/desktop/dataxchg/dy...
It's implemented with the WM_DDE_... series of messages. There's a library, DDEML, which wraps some of the complexities.
That’s unfortunate
I would also say that anyone who sends a message to all top-level windows should use SendMessageCallback or similar so they can handle a reply asynchronously.
> Say your database program gets a WM_COMMAND message, which it interprets to mean, "Go sort this database of 300,000 records," and dutifully conducts this 45-minute operation;
In Chrome just Right Click => Inspect one of the paragraphs, then in the element tree select one of the a tags and un-check the "#content .story a" css rule. Then your eyes will stop burning!