试过包括IE在内的几个程序都不行..真是奇怪了,Shell起来的没问题....
我OD了一下,发现Shell后来调用的是kernel32.CreateProcessW,参数就更奇怪了...0012F420   00000000  |ModuleFileName = NULL
0012F424   0015E464  |CommandLine = "C:\Program Files\Internet Explorer\iexplore.exe"
0012F428   00000000  |pProcessSecurity = NULL
0012F42C   00000000  |pThreadSecurity = NULL
0012F430   00000000  |InheritHandles = FALSE
0012F434   00000000  |CreationFlags = 0
0012F438   00000000  |pEnvironment = NULL
0012F43C   00000000  |CurrentDir = NULL      <---这个工作目录竟然是Null
0012F440   0012F454  |pStartupInfo = 0012F454
0012F444   0012F498  \pProcessInfo = 0012F498代码如下....Option Explicit
Private Declare Function CreateProcess Lib "kernel32" Alias "CreateProcessA" (ByVal lpApplicationName As String, ByVal lpCommandLine As String, lpProcessAttributes As SECURITY_ATTRIBUTES, lpThreadAttributes As SECURITY_ATTRIBUTES, ByVal bInheritHandles As Long, ByVal dwCreationFlags As Long, lpEnvironment As Any, ByVal lpCurrentDriectory As String, lpStartupInfo As STARTUPINFO, lpProcessInformation As PROCESS_INFORMATION) As Long
Private Type PROCESS_INFORMATION '该结构用于容纳新进程的进程和线程标识符
    hProcess As Long
    hThread As Long
    dwProcessId As Long
    dwThreadId As Long
End TypePrivate Type STARTUPINFO 'STARTUPINFO结构,其中包含了创建进程时使用的附加信息
    cb As Long
    lpReserved As String
    lpDesktop As String
    lpTitle As String
    dwX As Long
    dwY As Long
    dwXSize As Long
    dwYSize As Long
    dwXCountChars As Long
    dwYCountChars As Long
    dwFillAttribute As Long
    dwFlags As Long
    wShowWindow As Integer
    cbReserved2 As Integer
    lpReserved2 As Byte
    hStdInput As Long
    hStdOutput As Long
    hStdError As Long
End Type
Private Type SECURITY_ATTRIBUTES '该参数定义了进程的安全特性
    nLength As Long
    lpSecurityDescriptor As Long
    bInheritHandle As Long
End Type
Private Sub Command1_Click()
Dim psa As SECURITY_ATTRIBUTES
Dim tsa As SECURITY_ATTRIBUTES
Dim sinfo As STARTUPINFO
Dim pinfo As PROCESS_INFORMATION
CreateProcess vbNullString, "C:\Program Files\Internet Explorer\iexplore.exe", psa, tsa, 0, 0, 0&, "C:\Program Files\Internet Explorer\", sinfo, pinfo
End Sub

解决方案 »

  1.   

    Option Explicit
    Private Declare Function CreateProcess Lib "kernel32" Alias "CreateProcessA" (ByVal lpApplicationName As String, ByVal lpCommandLine As String, lpProcessAttributes As any, lpThreadAttributes As any, ByVal bInheritHandles As Long, ByVal dwCreationFlags As Long, lpEnvironment As Any, ByVal lpCurrentDriectory As String, lpStartupInfo As STARTUPINFO, lpProcessInformation As PROCESS_INFORMATION) As Long
    Private Type PROCESS_INFORMATION '该结构用于容纳新进程的进程和线程标识符
        hProcess As Long
        hThread As Long
        dwProcessId As Long
        dwThreadId As Long
    End TypePrivate Type STARTUPINFO 'STARTUPINFO结构,其中包含了创建进程时使用的附加信息
        cb As Long
        lpReserved As String
        lpDesktop As String
        lpTitle As String
        dwX As Long
        dwY As Long
        dwXSize As Long
        dwYSize As Long
        dwXCountChars As Long
        dwYCountChars As Long
        dwFillAttribute As Long
        dwFlags As Long
        wShowWindow As Integer
        cbReserved2 As Integer
        lpReserved2 As Byte
        hStdInput As Long
        hStdOutput As Long
        hStdError As Long
    End Type
    Private Sub Command1_Click()
    Dim psa As SECURITY_ATTRIBUTES
    Dim tsa As SECURITY_ATTRIBUTES
    Dim sinfo As STARTUPINFO
    Dim pinfo As PROCESS_INFORMATION
    sinfo.cb=lenb(sinfo )
    CreateProcess vbNullString, "C:\Program Files\Internet Explorer\iexplore.exe", byval 0&, byval 0&, 0, 0,byval 0&, VbNullString, sinfo, pinfo
    End Sub
      

  2.   

    http://support.microsoft.com/Default.aspx?kbid=129797
    在ms上找到这个文章,就等着有个人来回答然后结贴呢.....
    都是那破API浏览器干的好事.....参数问题....唉..