I have problem with ShellExecute() for open image with Ms Paint :
I tried :
ShellExecute(NULL,"Open","mspaint.exe",szFileName,NULL,SW_SHOWNORMAL);

If szFileName with space ("C:\\Documents and Settings\\pic.jpg" etc...) ->
MS Paint cannot open this file !

What the happen ?
Pls. help me! :(
--
Using Opera's revolutionary e-mail client: http://www.opera.com/mail/

Re: Problem with ShellExecute by Igor

Igor
Mon Jul 21 12:48:07 CDT 2008

Viet Tuan <viettuan1807@gmail.com> wrote:
> I have problem with ShellExecute() for open image with Ms Paint :
> I tried :
> ShellExecute(NULL,"Open","mspaint.exe",szFileName,NULL,SW_SHOWNORMAL);
>
> If szFileName with space ("C:\\Documents and Settings\\pic.jpg"
> etc...) -> MS Paint cannot open this file !

Enclose file name in quotes, as in "\"C:\\Documents and
Settings\\pic.jpg\"" . Just as you would do when typing command line by
hand.
--
With best wishes,
Igor Tandetnik

With sufficient thrust, pigs fly just fine. However, this is not
necessarily a good idea. It is hard to be sure where they are going to
land, and it could be dangerous sitting under them as they fly
overhead. -- RFC 1925



Re: Problem with ShellExecute by Viet

Viet
Tue Jul 22 01:26:10 CDT 2008

On Tue, 22 Jul 2008 00:48:07 +0700, Igor Tandetnik <itandetnik@mvps.org>
wrote:

> Viet Tuan <viettuan1807@gmail.com> wrote:
>> I have problem with ShellExecute() for open image with Ms Paint :
>> I tried :
>> ShellExecute(NULL,"Open","mspaint.exe",szFileName,NULL,SW_SHOWNORMAL);
>>
>> If szFileName with space ("C:\\Documents and Settings\\pic.jpg"
>> etc...) -> MS Paint cannot open this file !
>
> Enclose file name in quotes, as in "\"C:\\Documents and
> Settings\\pic.jpg\"" . Just as you would do when typing command line by
> hand.

Yeah, It's work !Thanks for all!

--
Using Opera's revolutionary e-mail client: http://www.opera.com/mail/