Wilfried,
I couldn't find the window either using terminal services, but had no
problem using Remote desktop :
Also, I used your Service framework to start with.
In the small app:
const
WM_APP_ShowTrayIcon = WM_APP + 16101;
Hwnd := FindWindow('TEDIFTPSVCMain', 'EDIFTPSVCMain');
if Hwnd <> 0 then
begin
PostMessage(Hwnd, WM_APP_ShowTrayIcon, 0, 0);
end
else
MessageDlg('Window not found', mtError, [mbOK], 0);
In the Service :
//=================================================
procedure TEDIFTPSVCMain.WndProc(var Message: TMessage);
begin
if Message.Msg > WM_APP then
begin
case Message.Msg of
WM_APP_ShowTrayIcon : begin
CreateTrayIcon;
TrayTimer.Free;
TrayTimer := nil;
WriteToFile('WM_APP_ShowTrayIcon message
received', 4);
end;
end; {case}
end;
inherited WndProc(Message);
end;
Sincerely,
Brad Gies
-------------------------------------
NLM Software
Southfield, MI, USA
-------------------------------------
> -----Original Message-----
> From: [EMAIL PROTECTED] [mailto:delphi-talk-
> [EMAIL PROTECTED] On Behalf Of Wilfried Mestdagh
> Sent: Wednesday, August 24, 2005 12:08 PM
> To: Delphi-Talk Discussion List
> Subject: Re[2]: NT service and tray icon on remote desktop
>
> Hello Brad,
>
> GB> I finally created a custom message and built a small program that
> sends
> GB> the message to the NT Service message loop which tells it to show
the
> GB> icon. It was the only way I found.
>
> How? I recall me creating a hidden window in a service to send a
custom
> message to from within a normal GUI, but unfortionally FindWindow()
> could not find it.
>
> I realize the service's Execute method create a message queue. But how
> to know it's handle ?
>
> ---
> Rgds, Wilfried
> http://www.mestdagh.biz
>
> __________________________________________________
> Delphi-Talk mailing list -> [email protected]
> http://www.elists.org/mailman/listinfo/delphi-talk
__________________________________________________
Delphi-Talk mailing list -> [email protected]
http://www.elists.org/mailman/listinfo/delphi-talk