VMware Horizon Community
mjohnmjohn
Contributor
Contributor

when use ShellExecute API, ThinApp will new a explorer.exe and oftern hangs

Hi,

I found when I use ShellExecute API in a vb6 program to open a folder as below,

ShellExecute hwnd, StrPtr("open"), StrPtr(strPath), 0, 0, &H5

When use ThinApp to package the program, the above code will start a new exporer.exe, so there will have 2 explorer.exe, and often the new explorer will hang and lead my program hang, and when I kill my program, then my program can't start anymore. I must restart my computer, then my program can start again.

How to solve the problem?

Thanks!

0 Kudos
2 Replies
Lakshman
Champion
Champion

Can you try using ExecuteVirtualProcess?

Please have a look here:

http://edwinfriesen.nl/content/?p=136

0 Kudos
notAlx
Contributor
Contributor

I have a problem with ShellExecute too.

I wrote a simple program in Delphi for test. Form with one button. When press the button execute code:

ShellExecute(Application.Handle, 'open', PChar(ExtractFilePath(Application.ExeName) + 'TEST'), nil, nil, SW_SHOW);

This program work fine on physical system. When i press the button the program open the folder for example "C:\MyProg\TEST".

But this program does not work in ThinApp. When i press the button the explorer display an error "C:\MyProg\TEST refers to a location that is unavailable. It could be on a hard drive on this computer, on a network, or on a different computer on your home network...".

How to solve the problem without change program code?

(Sorry for my English, I used Google Translate)

0 Kudos