On Mon, 20 Mar 2017 12:05:01 +0100, Karsten Hilbert
<karsten.hilb...@gmx.net> wrote:

>On Mon, Mar 20, 2017 at 06:48:36AM -0400, George Neuner wrote:
>
>> Windows informs all processes that it is shutting down (or entering
>> sleep, or waking up, etc.), but the notifications take different forms
>> depending on whether the process is a service or a normal application.
>> Services receive commands from the service manager, whereas
>> applications receive environment control messages sent to their main
>> window.
>> 
>> pg_ctl is a command-line program that can run as a service.  But since
>> it creates no window, when run as an application it cannot receive any
>> environment messages.
>
>Would it make sense to have pg_ctl create a non-visible
>window when run as an application in order to receive
>environment control messages ?
>
>       
> http://stackoverflow.com/questions/2122506/how-to-create-a-hidden-window-in-c
>
>Just wondering,
>Karsten

I'm afraid I have to agree with Tom.

That stackoverflow page is a bit misleading as the examples presume
MFC and wizard generated message maps.  I have no idea whether pg_ctl
currently even uses MFC.

Creating a window and message loop in pure C is a good page of code.
Not a lot, to be sure, but it would add a whole new mode of operation
because handling ordinary (window) messages is different from handling
service control messages.

George



-- 
Sent via pgsql-general mailing list (pgsql-general@postgresql.org)
To make changes to your subscription:
http://www.postgresql.org/mailpref/pgsql-general

Reply via email to