Subject Re: ShellExecute UDF succeeds but no window is shown
Author domokaidus
Hello,

Thanks to you, I've been able to fix my issue using CreateProcessAsUser().

Issue closed !

Regards

--- In firebird-support@yahoogroups.com, "domokaidus" <domokaidus@...> wrote:
>
>
> Thank you very much !
>
> You are right, I'm using FB as a service. When I switched FB to
> application mode, everything worked perfectly.
>
> I tried CreateProcess() previously but I wasn't providing any special
> parameters. I'll try again and keep you posted with the results.
>
> Thanks again and have a great day
>
> Emmanuel
>
>
> --- In firebird-support@yahoogroups.com, Teträm Corp <dev@> wrote:
> >
> > Hi,
> >
> > I guess you're using FB as service
> > So, the ShellExecute is executed in the service context... no session
> so
> > no GUI, etc
> >
> > AFAIR, if you want to do that, you have to use CreateProcess and give
> > some parameters to say which session will shows up your application
> > (look at msdn for more details)
> > At least, you can test my assumptions by running FB as application. If
> > I'm right, you'll have your application shown.
> >
> > Also, keep in mind that your ShellExecute will run application on the
> > server, so whatever you do distant clients will never show the
> > application on their computer
> >
> > domokaidus a écrit :
> > >
> > >
> > > Hello everyone,
> > >
> > > I coded the following UDF but I'm getting strange behavior. The code
> > > is actually executed and ShellExecute returns success(value > 32)
> but
> > > the application passed in parameter never show up.
> > >
> > > When I used the same ShellExecute call from a standard dialog-based
> > > application, it works perfectly.
> > >
> > > Your help would be greatly appreciated !
> > > Thanks
> > >
> > > function ExecShell(sz: PChar):integer;cdecl;export;
> > > var
> > > Handle: HWND;
> > > begin
> > > //Write2EventLog('UDF', sz);
> > > result := ShellExecute(Handle,'open', sz, nil, nil, SW_SHOWNORMAL) ;
> > > end;
> > >
> > >
> >
>