shellexecute

Google Chrome broke ShellExecute() ?

For years I've been using ShellExecute() API to launch the default web browser from within my applications. Like this: ShellExecute( hwnd, _T("open"), _T("http://www.winability.com/home/"), NULL, NULL, SW_NORMAL ); It's been working fine until a couple of weeks ago, when Google released its Chrome browser. Now, if Chrome is ...

Vista not allowing one .exe to call another .exe

I have a legacy VB6 executable that runs on Vista. This executable shells out another legacy MFC C++ executable. In our early Vista testing, this call would display the typical UAC message to get the user's permission before running the second executable. This wasn't perfect, but acceptable. However, it now looks like this call is bei...

Getting rid of the evil delay caused by ShellExecute

This is something that's been bothering me a while and there just has to be a solution to this. Every time I call ShellExecute to open an external file (be it a document, executable or a URL) this causes a very long lockup in my program before ShellExecute spawns the new process and returns. Does anyone know how to solve or work around t...

How do I execute a program from python? os.system fails due to spaces in path

I have a python script that needs to execute an external program, but for some reason fails. If I have the following script: import os; os.system("C:\\Temp\\a b c\\Notepad.exe"); raw_input(); Then it fails with the following error: 'C:\Temp\a' is not recognized as an internal or external command, operable program or batch file. If...

Syntax of shell\command\open values - %1 vs %l vs %L

Hi, one of the programs I'm developing at work is reading the registry to figure out how to open files that it is given from another application (we didn't use ShellExecute because we need to process id, and I failed to look at ShellExecuteEx closely enough to see that it gives the process handle, and it's too late now, anyway). It alrea...

ShellExecute equivalent in .NET

I'm looking for the .NET-preferred way of performing the same type of thing that ShellExecute does in Win32 (opening, printing, etc. for arbitrary file types). I've been programming Windows for over 20 years, but I'm a complete newbie at .NET, so maybe I'm just looking in the wrong places. I'm currently using .NET 2.0 (VS C# 2005), but ...

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 displaying a user interface (UI) or error messages. This value can be NULL if the operation is no...

Launching Shell Links (LNKs) from WOW64

Our 32-Bit application launches Windows LNK files (Shell Links) via ShellExecute. When it tries to "launch" a link to a 64-Bit binary (such as the "Internet Explorer (64-Bit)" shortcut in Start Menu) it always ends up launching the 32-Bit binary. Internally, ShellExecute incorrectly resolves the link target: There's a hidden field inside...

Launching Apps in the Foreground

Hi, How can I use ShellExecute to launch an application and force the main window to the foreground? I read this atricle http://www.ddj.com/windows/184405755. Is this the right way to do it? My program requires the application to be opened in foreground, just like how google desktop search is able to open files. Thanks in advance, Man...

Need to execute shell script from webapp and display console output in page

I am looking for java examples or library that will help me integrate this into a Struts2/Spring application. Many build systems such as Luntbuild or Hudson have this functionality, I thought I would ask if any one knows of a standalone example before I attempted to dig it out of one of those. I glanced at Quartz job scheduling framewo...

ShellExecute from within a procedure

i want to call this.. well as good as ShellExecute(Handle, 'open', 'c:\Windows\notepad.exe', nil, nil, SW_SHOWNORMAL) i can call this without issue from within a method of form1 but i just had a procedure "procedure transformdataset();" that i want to call this in and it does not recognise handle... do i just need to make this procedure...

Display Windows character map applet?

What's the best way to display Windows' character map applet from my .NET (C#) application? I know it's an optional component, so I want to display a message to the user if they don't have it installed. I've tried using ShellExecute( 0, "OPEN", "charmap.exe", "", "", 0 ); but all that happens is my app loses focus and character map ...

shellexecute question

i have successfully used shellexecute() to open a .rtf file. but my problem is i have to double click the button before the file opens. can i make it open in a single click of the button? when i try to open a folder using shellexecute, the folder opens in a single click of a button only. does shellexecute() really behaves like that? ...

Open a URL in a new browser process

I need to open a URL in a new browser process. I need to be notified when that browser process quits. The code I'm currently using is the following: Process browser = new Process(); browser.EnableRaisingEvents = true; browser.StartInfo.Arguments = url; browser.StartInfo.FileName = "iexplore"; bro...

How to shell to another app and have it appear in a delphi form

In Delphi I've used ShellExecute for years to launch (and optionally wait for) other applications. Now though, I need to have one of these applications appear in one of my Delphi app forms. I've tried the code below as a simple test to open notepad (which it does) and to display the result within PAnel1 on my form (which it doesnt). Can ...

OSX equivalent of ShellExecute?

I've got a C++ app that I'm porting from Win32 to OSX. I'd like to be able to launch arbitrary files as if the user opened them. This is easy on windows using ShellExecute. How do I accomplish the same thing on the Mac? Thanks! ...

Determine the registered application for an extension

I've got a file extension and I'd like to get the name of the application (if there is one) that will be invoked when I ShellExecute a file of that type. This is a WTL/C++ app. Is there any sample code out there that does this? Thanks! ...

C++: Get name of process executing my application

My application will be launched by an installer during the installation process, probably using ShellExecute. I would like to get the name of the installer executable when it launches my application. Can I from my application see a "parent process" somehow? Or can I scan the system for windows with a specific caption and get the name of...

How do i launch a process with low priority? C#

I want to execute a cmd line tool to process data. It does not need to be blocking. I want it to be low priority. So i wrote the below Process app = new Process(); app.StartInfo.FileName = @"bin\convert.exe"; app.StartInfo.Arguments = TheArgs; app.PriorityClass = ProcessPriorityClass.BelowNormal; app.Start(); However i get a Syst...

Link Checker With ShellExecute?

I've been tasked with going through a database and checking all of the links, on a weekly schedule. I normally work in PHP, but doing this in PHP would be very slow (it actually would timeout the page after about 100 URLs), so I decided to make a quick C++ app. Admitidly, I haven't used C++ since college, so I'm a bit rusty. I found th...