cancel
Showing results for 
Search instead for 
Did you mean: 

Calling shellexecute from a clicked dw event in powerbuilder 12.6

Former Member
0 Kudos

I'm trying to open an abode file, that's stored on my database in the adobe viewer

when the user clicks on a list of the files

it will pull down the data, and store into an adobe file.

then.... with that filename, it will call shellexecute

the file opens up properly

but... it seems to drive the cursor on the datawindow crazy

it appears to be highlight every row that it touches

Am I doing something wrong?   do I need to set the cursor to hourglass?

or... do I need to somehow wait on the Adobe reader operation to end

before letter powerbuilder take back over

I've used the run and wait operation before

should I use that, instead of the shellexecute

Accepted Solutions (1)

Accepted Solutions (1)

Former Member
0 Kudos

Hi Scot;

For the ShellExecute ( ) API - are you suing the Unicode version ... either: ShellExecuteW() or ShellExecuteExW () ?

Regards ... Chris

Former Member
0 Kudos

I'm using the following

It really doesn't seem to have a problem with calling of the external program.

but...  I'm calling the program from a clicked event, of a datawindow

the cursor on the datawindow, is acting like it's wanting to select multiple rows while the external program is up

FUNCTION long ShellExecute (long hwnd, ref string lpOperation, ref string lpFile, ref string lpParameters, ref string lpDirectory, integer nShowCmd )

       LIBRARY "shell32" Alias for "ShellExecuteA;Ansi"

pfd file selected.jpg

arnd_schmidt
Active Contributor
0 Kudos

You might call the unicode function declarations like:


Function long ShellExecute ( &

   long hwindow, &

   string lpOperation, &

   string lpFile, &

   string lpParameters, &

   string lpDirectory, &

   long nShowCmd &

  ) Library "shell32.dll" Alias for "ShellExecuteW"


Function long GetDesktopWindow ( ) Library "user32.dll"


Try to use the Desktop Window Handle.


So


ShellExecute ( GetDesktopWindow() , .... )


hth


Arnd


Former Member
0 Kudos

Hi Scot;

  Suggestion: Create a new un-mapped user event and just post the UE from the DW Control's "Clicked" event. Then run the ShellExecute from the new posted User Event. (just a random thought)

Regards ... Chris

Former Member
0 Kudos

Looks like the posted user event, managed to resolve it

I'll keep testing, to make sure

thanks

Former Member
0 Kudos

You can post it directly:

Post ShellExecute(...)

Former Member
0 Kudos

Hi Scot;

  Excellent news!  

Have hugged a DataWindow today? 

Regards... Chris

Answers (0)