Article View: borland.public.cppbuilder.nativeapi
Article #17111Re: Open one application from a service
From: Nico Bendlin
Date: Wed, 09 Apr 2003 15:22
Date: Wed, 09 Apr 2003 15:22
37 lines
2304 bytes
2304 bytes
Vic wrote: > I've got a service, and I want to open one app. > this is the code : > > ShellExecute(GetDesktopWindow(), "open", "calc.exe",NULL, NULL,SW_SHOW); > > the problem is that when the ShellExecute is executed, a process called > "calc.exe" is added to process list, but the app is not visible. > How can I solve it ? Calc is now running on another desktop. This is because your service is running as LocalSystem and has nothing to do with the interactive desktop (namely 'WinSta0\Default') but is running on his own 'service session desktop'. Further the application is running with the credentials of LocalSystem too. But SYSTEM is not allowed (by the security descriptor of the window station / desktop) to do something an the interactive desktop. Therefore you have at least three options: - use RunAs service / API (newer windows) - start the program as the logged-in user - modify the DACLs of the winsta/desktop Nothing of these options are trivial. Finally there is still A LOT of work to get it running corretly on Windows Terminal Server (Windows XP uses TS to implement Fast User Switsching (FUS)). -- "Sure, I want to be 25 years old again with $50 billion, so I can party, but it ain't gonna happen." -- David J. Craig
Technical Details
Message-ID:
<3e943a70@newsgroups.borland.com>Path:
arc1-ca.pugleaf.net!archiver1.google.com!news1.google.com!sn-xit-02!sn-xit-06!sn-xit-08!supernews.com!pln-w!extra.newsguy.com!lotsanews.com!newsfeed.wirehub.nl!news.kweb.on.ca!KWeb!newsgroups.borland.com!not-for-mailReferences:
<3e9437a8@newsgroups.borland.com>Show Full Headers
Complete Article Headers
X-Google-Language: ENGLISH,ASCII-7-bit X-Google-Thread: 10cc67,2c7710b325cdf21a X-Google-Attributes: gid10cc67,public X-Google-ArrivalTime: 2003-04-09 08:30:52 PST Date: Wed, 09 Apr 2003 17:22:43 +0200 From: Nico Bendlin <nicode@gmx.net> Organization: Piranha Bytes User-Agent: Mozilla/5.0 X-Accept-Language: de, en MIME-Version: 1.0 Newsgroups: borland.public.cppbuilder.nativeapi Subject: Re: Open one application from a service References: <3e9437a8@newsgroups.borland.com> In-Reply-To: <3e9437a8@newsgroups.borland.com> Content-Type: text/plain; charset=us-ascii; format=flowed Content-Transfer-Encoding: 7bit NNTP-Posting-Host: 149.225.118.223 Message-ID: <3e943a70@newsgroups.borland.com> X-Trace: newsgroups.borland.com 1049901680 149.225.118.223 (9 Apr 2003 08:21:20 -0800) Lines: 38 Path: arc1-ca.pugleaf.net!archiver1.google.com!news1.google.com!sn-xit-02!sn-xit-06!sn-xit-08!supernews.com!pln-w!extra.newsguy.com!lotsanews.com!newsfeed.wirehub.nl!news.kweb.on.ca!KWeb!newsgroups.borland.com!not-for-mail