Subject | Re: [firebird-support] ShellExecute UDF succeeds but no window is shown |
---|---|
Author | Teträm Corp |
Post date | 2009-05-13T04:03:23Z |
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 :
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;
>
>