ShellExecute(handle, "open", "d:\\you\\IEXPLORE.EXE", NULL, NULL,SW_SHOWNORMAL);
我想把指针的地址给浏览器并且带浏览器;//这是什么意思?

解决方案 »

  1.   

    ShellExecute(NULL,NULL,strURL, NULL, NULL,SW_SHOWNORMAL);
      

  2.   

    你的意思是在已有浏览器中打开页面?
    IWebBrowser2::Navigate2 Method--------------------------------------------------------------------------------Navigates the browser to a location that might not be able to be expressed as a URL, such as a pointer to an item identifier list (PIDL) for an entity in the Microsoft® Windows® shell namespace.SyntaxHRESULT Navigate2(
        VARIANT *URL,
        VARIANT *Flags,
        VARIANT *TargetFrameName,
        VARIANT *PostData,
        VARIANT *Headers,
    );ParametersURL 
    [in] Pointer to a VARIANT that contains one of the following values. VT_BSTR String that contains a URL to navigate to. 
    VT_ARRAY|VT_UI1 PIDL that represents a folder to navigate to. Flags 
    [in] Pointer to a variable that specifies whether to add the resource to the history list, whether to read to or write from the cache, and whether to display the resource in a new window. The variable can be a combination of the values defined by the BrowserNavConstants enumeration. 
    TargetFrameName 
    [in] Pointer to a string that contains the name of the frame in which to display the resource. 
    PostData 
    [in] Pointer to data to send with the HTTP POST transaction. For example, the POST transaction is used to send data gathered by an HTML form. If this parameter does not specify any post data, the Navigate2 method issues an HTTP GET transaction. This parameter is ignored if URL is not an HTTP URL. 
    Headers 
    [in] Pointer to a value that contains the HTTP headers to send to the server. These headers are added to the default Microsoft® Internet Explorer headers. The headers can specify things such as the action required of the server, the type of data being passed to the server, or a status code. This parameter is ignored if URL is not an HTTP URL. 
    Return ValueReturns one of the following values.S_OK  The operation was successful. 
    E_INVALIDARG  One or more parameters are invalid. 
    E_OUTOFMEMORY  Out of memory. ResThis method extends the Navigate method to allow for shell integration; however, the original Navigate method can still be used for URL navigations (Navigate2 does not make Navigate obsolete).The post data specified by PostData is passed as a SAFEARRAY structure. The variant should be of type VT_ARRAY and point to a SAFEARRAY. The SAFEARRAY should be of element type VT_UI1, dimension one, and have an element count equal to the number of bytes of post data.
      

  3.   

    HKEY hkRoot,hSubKey;
    char ValueName[256];
    unsigned char DataValue[256];
    unsigned long cbValueName=256;
    unsigned long cbDataValue=256;
    char ShellChar[256];
    DWORD dwType; if(RegOpenKey(HKEY_CLASSES_ROOT,NULL,&hkRoot)==ERROR_SUCCESS)
    {
    if(RegOpenKeyEx(hkRoot, "htmlfile\\shell\\open\\command", 0, KEY_ALL_ACCESS, &hSubKey)==ERROR_SUCCESS){
    RegEnumValue(hSubKey, 0, ValueName, &cbValueName, NULL, &dwType, DataValue, &cbDataValue);
    strcpy(ShellChar,(char *)DataValue);
    strcat(ShellChar," www.xxxxxxx.com");
    WinExec(ShellChar,SW_SHOW);
    }
    else
    MessageBox("WEB浏览器打开错误!","错误",MB_OK);
    }
    else
    MessageBox("WEB浏览器打开错误!","错误",MB_OK);
    RegCloseKey(hSubKey);
    RegCloseKey(hkRoot);