|
-
October 19th, 2010, 03:23 AM
#1
ShellExecute
Hi all
I have stranger problem, ShellExecute is working on Vista but problem on XP.
Code:
ShellExecute( NULL, "open","http://www.abctest.com",NULL, "http://www.abctest.com", SW_SHOWDEFAULT);
or
ShellExecute( NULL, "open","http://www.abctest.com",NULL, "", SW_SHOW);
Both code working on only Vista.Can any one help me where i am wrong?
-
October 19th, 2010, 03:41 AM
#2
Re: ShellExecute
I have tested under Windows XP and both worked well.
However, anytime ShellExecute fails, you can see what's going wrong by taking a look at the error code (see return value in the ShellExecute function documentation.
-
October 19th, 2010, 04:48 AM
#3
Re: ShellExecute
 Originally Posted by ovidiucucu
I have tested under Windows XP and both worked well.
However, anytime ShellExecute fails, you can see what's going wrong by taking a look at the error code (see return value in the ShellExecute function documentation.
Thanks for reply
Now i change something in code like this
Code:
ShellExecute( NULL, "open","iexplore.exe","http://www.abctest.com","iexplore.exe", SW_SHOW);
ShellExecute( NULL, "open","OUTLOOK.EXE","mailto:[email protected]","OUTLOOK.EXE",SW_SHOW);
Code is working on XP.So Expert can i use this code or not.
I want to know why this one is not working.
Code:
ShellExecute( NULL, "open","http://www.abctest.com",NULL, "", SW_SHOW);
Generally this code working fine.
Please help me.
-
October 19th, 2010, 06:11 AM
#4
Re: ShellExecute
May be in your XP there is no default browser set. So putting iexplore.exe and settings its parameter to desired site opens it in IE.
-
October 19th, 2010, 06:31 AM
#5
Re: ShellExecute
 Originally Posted by hypheni
May be in your XP there is no default browser set. So putting iexplore.exe and settings its parameter to desired site opens it in IE.
ok any one tell me there is any alternate option of shellexecute.
-
October 19th, 2010, 06:54 AM
#6
Re: ShellExecute
 Originally Posted by Msm
ok any one tell me there is any alternate option of shellexecute.
Could you very precisely define for whatpurpose you need an "any alternate option of shellexecute"?
Just to be able to open some internet browser which was not set as the default one and which name you don't know of?
Or something else?
Victor Nijegorodov
-
October 19th, 2010, 07:39 AM
#7
Re: ShellExecute
 Originally Posted by VictorN
Could you very precisely define for whatpurpose you need an "any alternate option of shellexecute"?
Just to be able to open some internet browser which was not set as the default one and which name you don't know of?
Or something else?
Thanks for reply sir
I try to open url and Send mail through shellexecute .
-
October 19th, 2010, 07:50 AM
#8
Re: ShellExecute
 Originally Posted by Msm
 Originally Posted by VictorN
Could you very precisely define for what purpose you need an "any alternate option of shellexecute"?
Just to be able to open some internet browser which was not set as the default one and which name you don't know of?
Or something else?
Thanks for reply sir
I try to open url and Send mail through shellexecute .

Again:
[QUOTE=Msm;1975008]
 Originally Posted by VictorN
Just to be able to open some internet browser which was not set as the default one and which name you don't know of?
Or something else?
Or you don't know what "default browser" mean?
Or you don't know how ShellExecute works?
Perhaps, you first must read MSDN about ShellExecute and Object Verbs
Victor Nijegorodov
-
October 19th, 2010, 07:55 AM
#9
Re: ShellExecute
[QUOTE=VictorN;1975012]
Again:
 Originally Posted by Msm
Or you don't know what "default browser" mean?
Or you don't know how ShellExecute works?
Perhaps, you first must read MSDN about ShellExecute and Object Verbs 
Both thing i know and if you look my 1 and 3rd post there i show some code.Problem is code not work on XP.
Code:
ShellExecute( NULL, "open","http://www.abctest.com",NULL, "http://www.abctest.com", SW_SHOWDEFAULT);
or
ShellExecute( NULL, "open","http://www.abctest.com",NULL, "", SW_SHOW);
-
October 19th, 2010, 08:43 AM
#10
Re: ShellExecute
[QUOTE=Msm;1975014]
 Originally Posted by VictorN

Again:
Both thing i know and if you look my 1 and 3rd post there i show some code.Problem is code not work on XP.
Code:
ShellExecute( NULL, "open","http://www.abctest.com",NULL, "http://www.abctest.com", SW_SHOWDEFAULT);
or
ShellExecute( NULL, "open","http://www.abctest.com",NULL, "", SW_SHOW);
You seem to not!
Please, look at the post#4 (hypheni)
And then check in your XP machine whether key HKEY_CLASSES_ROOT\http\shell\open\command exists...
And the same - for HKEY_CLASSES_ROOT\mailto\shell\open\command
Victor Nijegorodov
-
October 19th, 2010, 09:04 AM
#11
Re: ShellExecute
or simply set default browser from IE Tools > Programs
And hit Make Default button
-
October 19th, 2010, 11:37 AM
#12
Re: ShellExecute
[QUOTE=Msm;1975014]
 Originally Posted by VictorN

Again:
Both thing i know and if you look my 1 and 3rd post there i show some code.Problem is code not work on XP.
Code:
ShellExecute( NULL, "open","http://www.abctest.com",NULL, "http://www.abctest.com", SW_SHOWDEFAULT);
or
ShellExecute( NULL, "open","http://www.abctest.com",NULL, "", SW_SHOW);
You don't seem to understand the mechanism which ShellExecute uses to open data files. ShellExecute uses file associations to map file extensions to a program. For example, on most systems an extension of .txt maps to Notepad.exe.
Why this matters for your situation is because users can change or remove these extensions (which is probably why you are seeing failures on XP).
Posting Permissions
- You may not post new threads
- You may not post replies
- You may not post attachments
- You may not edit your posts
-
Forum Rules
|
Click Here to Expand Forum to Full Width
|