Questions tagged [shellexecute]

ShellExecute is a Win32 API function used to launch document files

ShellExecute is a Microsoft Win32 API function used to launch document files.

Depending on the type of document file, it will do this through:

  • Creating a process using the executable file associated with the specified document
  • Using the COM subsystem to request a shell extension to launch the document
  • Initiating an action to be completed by the end-user, such as a search

As a rule of thumb, it can be assumed that invoking ShellExecute on a document file will have the same result as double-clicking on that file in Windows Explorer, including displaying user interface elements.

521 questions
3
votes
4 answers

Handle for ShellExecute() - Parent Window?

I am trying to use ShellExecute to open a file in Excel. I was reading about the function on MSDN forums, and I found the folowing information about the handle, which is the first parameter: "hwnd [in] A handle to the owner window used for…
Shishiree
  • 165
  • 2
  • 11
3
votes
1 answer

Reading the output file of ShellExecute() in Delphi 2010?

I use the ShellExecute command to run an exe file which gets an input text file and returns an output text file. I've written it like this: ShellExecute(mainFormHandle, 'open', 'Test.exe', 'input.txt output.txt', nil, sw_shownormal); //Read the…
Mahm00d
  • 3,881
  • 8
  • 44
  • 83
3
votes
1 answer

Java + JNA, looking for a way to run ShellExecuteW

I am trying to run a ShellExecute function from java with JNA. I dont have any problems running ShellExecuteA on non-unicode folders import com.sun.jna.*; import com.sun.jna.platform.win32.ShellAPI; import com.sun.jna.platform.win32.WinDef; import…
estw272
  • 211
  • 5
  • 20
3
votes
1 answer

System-wide ShellExecute hooks?

is there any way I can install a system-wide ShellExecute hook using C++ without having to inject a hooking module into every active process. I am using Windows 7. My purpose for this is because, I want to be able to select which browser a link is…
Sam Blackburn
  • 288
  • 2
  • 9
3
votes
3 answers

VBA ShellExecute forces URL to lowercase

This used to work last week. I suspect a Windows update broke something. When using ShellExecute, it is forcing the URLs into lowercase, breaking parameter values passed to a case-sensitive server! Private Declare Function ShellExecute Lib…
Chloe
  • 25,162
  • 40
  • 190
  • 357
3
votes
1 answer

Clickonce program will not start when launched from shell_execute

I have a very old program that I have no control over. It launches a filetype with its default application like this(I cannot modify this code): LET Err (SHELL_EXECUTE 'open' (FIX_MESG '"{1}"' File_name) '' '') ^^The above code works, so long as…
Brandon
  • 1,058
  • 1
  • 18
  • 42
3
votes
2 answers

When could ShellExecute fail? (Delphi)

I am planning to use ShellExecute for the updater of an application written in delphi 2007, I was wondering if ShellExecute will work on most computers with Win or if it can easly fail because of some user permission or something like that.
Sebastian
  • 796
  • 4
  • 12
  • 22
3
votes
2 answers

Open URL with ShellExecute - SW_SHOWMAXIMIZED dont active window in C++

I used this function to open new tab in Chrome and active it: ShellExecuteA(0,0,"chrome.exe","http://google.com --incognito",0,SW_SHOWMAXIMIZED); but Chrome only open new tab but it doesnt active window. (I call this function from global…
NoName
  • 7,940
  • 13
  • 56
  • 108
3
votes
2 answers

Open a file automatically when USB is inserted

Ive been looking for answer to this questions for days, and still I haven't found anything about it. I'm trying to execute a .exe file when a USB flash drive is plugged in - WITHOUT asking the user for permission, I mean as soon as the USB is…
albeck
  • 510
  • 1
  • 7
  • 16
3
votes
1 answer

Using ShellExecuteEx to open file properties sheet under explorer process, not calling process

My issue is with a PropertySheetExtension, but the same behavior seems present with the default file properties sheet. The issue with the following code: // Snippet from http://stackoverflow.com/a/1936957/124721 using…
Caleb S
  • 163
  • 11
3
votes
3 answers

How to call PHP file from a shell script file

I need a shell script which has a loop. In each loop iteration it needs to call a PHP file with some parameters. Is there any way to do it?
Martin Jacob
  • 356
  • 1
  • 7
  • 16
3
votes
1 answer

ShellExecute Adobe Reader XI Security Warning Dialog Settings

I have a program which shells (using ShellExecute) Adobe Reader to open an FDF with a linked PDF on a mapped drive. The program inserts registry settings to setup the trusted locations prior to calling Reader. This worked fine up to version X but…
Carl Onager
  • 4,112
  • 2
  • 38
  • 66
3
votes
2 answers

How to open an embedded string resource with Notepad?

I added help.txt file in Resources as text file, and did like this: private void helpButton_Click(object sender, MouseEventArgs e) { System.Diagnostics.Process.Start(myProject.Properties.Resources.help); } It didn't work, then I tried this…
Romz
  • 1,437
  • 7
  • 36
  • 63
3
votes
1 answer

Path for ShellExecute of IExplorer.exe

I want to use ShellExecute iexplore.exe (with an html file name as a command line arg), even if iexplore isn't associated with html files. Assuming the user hasn't uninstalled it, how safe is it to do so without supplying a path to the program. …
RobertFrank
  • 7,332
  • 11
  • 53
  • 99
3
votes
2 answers

detect selected program opened using openas_rundll in c#

I am opening a file using openfile dialog with the help of openas_rundll in c#. Process.Start("rundll32.exe", string.Format("shell32.dll,OpenAs_RunDLL \"{0}\"", tempFilePath)); Now I want to detect which program is used to open the file. I want to…