???? ID: 224816 - ????? ???????: 22 ??????? 2011 - ??????: 3.0

???????? ??? ???????? ?? ????? ???? ?? ??? ShellExecute ?? ????? ????

?????? ??????This article applies to a different operating system than the one you are using. Article content that may not be relevant to you is disabled.

?? ????? ??

??? ?? ??????? ???? | ??? ?? ??????? ????

??????

?? ???? ??????? ??? ??????? ?? ??????? ???? ?? ??? ???? ???? ?? ???? ??? ?? ??? ??????? ??? ??????? ??????? ???? ?? ??? ???? ???? ?? ???? ??? ??????? ??????? ?????? ???? ??ShellExecute????????? ???????????? ??????? (API)? ?? ?? ?????? ????? ?? ????? ?? ???? ????ShellExecute???? ?? ??? ??? ?????????? ??????? ?????? (URL) ?? ???? ?? ??? Microsoft Internet Explorer ?? ???? ???? ???

???? ???????

???????? ??? ???????? ?? ????????

???? ???????? ??? ??, Microsoft Internet Explorer ???? ??? ?? ?? ???????? ??? ???????? ?? ??????? ???? ?? ?? ???????? ??? ????? ?? ???? ??? Internet Explorer ??????? ???? ?? ?? ???????? (HTML) ??????? ?? ??????? ?? ????? ??????? ?? ??? ?????? ???, ?? Internet Explorer ??????? ?? ??? ???????? ???????? ???? ?? ?? ???? ??? ?? ??? ??????? ??????? ????? ?? ??? ????? ?????

?? ?? ??????? ???????? ??????? ?????Internet Explorer ??? ?? ???????? ?? ??? ?? ????????? ???, ???????? registers ????? ??????????? ????? ?? ????? ???????? ???????? (??? ???? ???????????? ??? ??? ??? ??) ????? ?? ???? HKEY_CLASSES_ROOT\.htm HKEY_CLASSES_ROOT\.html HKEY_CLASSES_ROOT\http\shell\open\command HKEY_CLASSES_ROOT\http\shell\open\ddeexec\Application HKEY_CLASSES_ROOT\ftp\shell\open\command HKEY_CLASSES_ROOT\ftp\shell\open\ddeexec\Application HKEY_CLASSES_ROOT\gopher\shell\open\command HKEY_CLASSES_ROOT\gopher\shell\open\ddeexec\Application


???????? ??? ???????? ????????? ???? ?? ??????? ????

???ShellExecuteAPI ?? ??? ???? ??? URL ????? Easiest ????? ?? ????????? ???? ???????? ??? ???????? ?? ??????? ???? ?? ??? ??? ???????? ??? ???????? ??????? ??? ???? ??, ???ShellExecute?????? ?? ??? ???? ?????????? ??????? ?????? (URL) ?? ???? ?? ??? ???? ?? ?? ???? ??? ??? ?? ???? ?? ??? ??, ??ShellExecute????????? ??????? ?? ???? ?? ?? ???? URL ?? ??? browses ???

??? ?? Microsoft Visual C++ ???? ????????? ?? ?????? ???? ?? ??? ????? ???? ??, ?? ????? ??? ?? ??? ???? ?? ??? ???? ?? ????? ???? ??ShellExecute.
LONG r = ShellExecute(NULL, "open", "http://www.microsoft.com", NULL, NULL, SW_SHOWNORMAL);
				
??? ?? Microsoft Visual Basic ????? ???? ???? ??, ?? ?? ???????? ???? ????ShellExecute???? ????????? ??? declaration. You can find this declaration in the Win32api.txt file that is located in a sub-folder of your Microsoft Visual Studio installation. Optionally, you may copy it from the API Text Viewer tool that comes with Visual Studio 6.0.

To insert theShellExecuteAPI into your project, follow these steps:
  1. Create a new project in Visual Basic.
  2. ??? ????Standard EXE.
  3. Add a button to your form.
  4. Put the following code in the form.
    Private Declare Function ShellExecute _
                                Lib "shell32.dll" _
                                Alias "ShellExecuteA"( _
                                ByVal hwnd As Long, _
                                ByVal lpOperation As String, _
                                ByVal lpFile As String, _
                                ByVal lpParameters As String, _
                                ByVal lpDirectory As String, _
                                ByVal nShowCmd As Long) _
                                As Long
    
    Private Sub Command1_Click()
       Dim r As Long
       r = ShellExecute(0, "open", "http://www.microsoft.com", 0, 0, 1)
    End Sub
    						
  5. Run your project, and then click the button to go to your URL with the default Web browser.
TheShellExecuteAPI ?? ??? ??? Microsoft Windows 95 ?? Microsoft Windows NT 3.1 ?? ??????? ??? ?? ????? ?? ???? ???ShellExecute??? Win32 ??? ??????? ??? ??????? ?? ?????? ???? ?? ??? ?? ??????? 1.0 ?? ??? ??? Microsoft Internet Explorer ?? ???????? ?? ????? ??????? ???? ?? ?? Microsoft Windows 3.x, UNIX, ?? MacIntosh ?????????????

ShellExecute ???? ??? ????

????? ????????? ?????????? ?? ???? ??????? ?? ??? ??? ?? ?? ?? ?? ???? ??? ????? ??? ???? ????????? ???? ???????? ?????? ?? ??? interacts ???? ??? ??? ???? ??????? assumptions ????? ?? ?? ??????? ?? ?????? ????? ????? ???? ?? ?? ??????????? ????????? ?? ?????? ??? Microsoft ???????? ?? ??????? ???

???? ShellExecute URL Interprets ???? ???

ShellExecute?? ???? ?? ??? ???? ??? ???????? ?????? ????ShellExecute??? ????????? ?????????? ?? ???? ????????? ?? ????? ?? ???? ???? nextShellExecute????????? ??? ????? ?? ?? ?? ????? ????????? ?????????? ?? ????????? ??? ????????? ?? ??????? ???? ?? ??? ?? ????????? ???? ?? ???? ??? ???? ??? ????HTTP://www.Microsoft.com???? ?? ???ShellExecute,ShellExecute???????HTTP://??? ????????? ?? ??? ???, ????? ???? sub-stringShellExecute????? ?? ???
HKEY_CLASSES_ROOT\http\shell\open
????? ?? ??? ???? ???? ?? ???? ??? ??????? ?? ???? ??? ???? ??? ????myfile.htm???? ?? ???ShellExecute,ShellExecute". htm" sub-string ????????? ?? ??? ??? ??????? ??? ???? ????ShellExecute????? ?? ???
HKEY_CLASSES_ROOT\.htm
, ?? ????
HKEY_CLASSES_ROOT\htmlfile\shell\open
.

??????????, ?? ?? ???? ???? ?? ??? ???? ??? ???????? ??? ???? URL ????????? ???? ?? ??? ???????ShellExecute?????? ?? ???::HTTP://www.Microsoft.com?? ????www.Microsoft.com. ?? ?? ???? ??? URL ?????????, ???? ????????? ???? ?? ??ShellExecuteknows ??????? ??? ?? ??? ?? ????????? ????? ???? ???????? ??? ??, ??? ??,ShellExecute????? ??? ?? ??? ???????? ?? ??? ????? ??www.*, ??FTP.*, ?? ?? ??? ?? ???????? ???????????? ?????????? ????????? (HTTP) ????????? ?? ????? ?????????? ????????? (FTP), respectively.

?? ????????? ???? ShellExecute ???? ?? ???? ??? ?? ?????? ??????? ???? ?? ???

??ShellExecute????????? ?? ??????, ??? ????? ?? ???
shell\open
???????:. ???
shell\open\ddeexec
????? ????????? ??, ?? ?? ????????? ????????? ?? ??? ????? ???? ???????? ???? Exchange (DDE)IExplore?? ????WWW_OpenURL??? ????-?????? windows ???????? ?? ???? ?? ??? ??????? ??? ?? ????? ?? ??? ???????? ???? ?? ??? ???? ????????? ?? ??? ?????? ???? ??? URL ?? ???? ?? ?? ????????? ??? ??? ??? ????????? ?? DDE ????? ?? ??? ?? ???? ???ShellExecute??????? ??? ????? ?? ?? ????? ???? ??
shell\open\command
????????? ??????? ???? ?? ??? ??????? ??? ?? re-broadcasts ?? DDE ????? ?????? ?? ?? URL ?? ???? ?? ??? ???

??????

??????? ?? ???? ??? ???? ??????? ?? ??? ??????? ?? ???, Microsoft ???????? ??? ???? ????? ?? ??? ????? ???? ?????? ?? ????? ????:
153774  (http://support.microsoft.com/kb/153774/ ) Internet Explorer ???????? ???????? ?? ??? ??? ???????? ???? ???? ???
?? ?????-???? ?????? Microsoft ?? ???????? ???????? ?????? ??????? ??? ?? ??? ????? ?? ???? ????? ???? ??.. Microsoft ?? ???????? ?? ???????? ?? ??????????? ?? ???? ??? ??? ?????? ???? ???? ??, ????? ?? ??????..

???? ???? ???? ??:
  • Microsoft Windows 2000 Server
  • Microsoft Windows 2000 Advanced Server
  • Microsoft Windows 2000 Professional Edition
  • Microsoft Internet Explorer 4.01 Service Pack 1
  • Microsoft Windows NT Server 3.51
  • Microsoft Windows NT Server 4.0 Standard Edition
  • Microsoft Windows NT Workstation 3.5
  • Microsoft Windows NT Workstation 3.51
  • Microsoft Windows NT Workstation 4.0 Developer Edition
??????: 
kbinfo kbwebbrowser kbmt KB224816 KbMthi
???? ?????? ???????????? ?????? ????????
??????????: ?? ???? ?? ???? ??????? ?? ????? ?? Microsoft ????-?????? ?????????? ?????? ?????? ???? ??? ??. Microsoft ???? ??? ????-???????? ?? ????-???????? ????? ?????? ?? ???? ???????? ???? ?? ???? ????? ????? ??? ?? ??? ?????? ?? ???? ???? ???? ??? ????? ??. ???????, ????-???????? ???? ????? ???? ???? ???? ???. ?????, ????????, ?????-???? ?? ??????? ?? ???????? ?? ???? ???, ???? ?? ??? ?????? ???? ???? ??? ????? ??? ?? ???? ??. Microsoft ??????? ??? ???? ?? ?????? ?? ??????????, ????????? ?? ??? ?????? ?? ???? ????? ?? ???? ???????? ?? ??? ???? ????? ?? ??? ????????? ???? ??. Microsoft ????-?????? ?????????? ?? ????? ?????? ?? ?? ??? ??.
?????????? ?? ??????? ????????? ??????? ??:224816  (http://support.microsoft.com/kb/224816/en-us/ )