Sign in to follow this  
Followers 0
smahdi83

Using Microsoft Web Browser ActiveX as a Fileviewer

5 posts in this topic

Hi,

What I am trying to do is quite simple. I have a Microsoft Web Browser ActiveX control and I then use the navigate2 method to go to a folder locally on the PC. For example:

#include <GUIConstants.au3>
$Form1 = GUICreate("AForm1", 388, 279, 322, 198, BitOR($WS_MAXIMIZEBOX,$WS_MINIMIZEBOX,$WS_SYSMENU,$WS_CAPTION,$WS_POPUPWINDOW,$WS_GROUP,$WS_TABSTOP,$WS_BORDER,$WS_CLIPSIBLINGS))
$Obj1 = ObjCreate("Shell.Explorer.2")
$Obj1_ctrl = GUICtrlCreateObj($Obj1, 0, 0, 1276, 908)
GUISetState(@SW_SHOW)

$Obj1.navigate2("c:")
While 1
$nMsg = GUIGetMsg()
Switch $nMsg
    Case $GUI_EVENT_CLOSE
    Exit

EndSwitch
WEnd

But what I am trying to do is actually display "My Computer", not "C:". How can I do that.

Thanks,

Share this post


Link to post
Share on other sites



Hi, use CLSID eg:

#include <GUIConstants.au3>
$Form1 = GUICreate("AForm1", 388, 279, 322, 198, BitOR($WS_MAXIMIZEBOX,$WS_MINIMIZEBOX,$WS_SYSMENU,$WS_CAPTION,$WS_POPUPWINDOW,$WS_GROUP,$WS_TABSTOP,$WS_BORDER,$WS_CLIPSIBLINGS))
$Obj1 = ObjCreate("Shell.Explorer.2")
$Obj1_ctrl = GUICtrlCreateObj($Obj1, 0, 0, 1276, 908)
GUISetState(@SW_SHOW)

$Obj1.navigate2("::{20D04FE0-3AEA-1069-A2D8-08002B30309D}")
While 1
$nMsg = GUIGetMsg()
Switch $nMsg
    Case $GUI_EVENT_CLOSE
    Exit

EndSwitch
WEnd

Cheers

Share this post


Link to post
Share on other sites

#3 ·  Posted (edited)

Hi, use CLSID eg:

#include <GUIConstants.au3>
$Form1 = GUICreate("AForm1", 388, 279, 322, 198, BitOR($WS_MAXIMIZEBOX,$WS_MINIMIZEBOX,$WS_SYSMENU,$WS_CAPTION,$WS_POPUPWINDOW,$WS_GROUP,$WS_TABSTOP,$WS_BORDER,$WS_CLIPSIBLINGS))
$Obj1 = ObjCreate("Shell.Explorer.2")
$Obj1_ctrl = GUICtrlCreateObj($Obj1, 0, 0, 1276, 908)
GUISetState(@SW_SHOW)

$Obj1.navigate2("::{20D04FE0-3AEA-1069-A2D8-08002B30309D}")
While 1
$nMsg = GUIGetMsg()
Switch $nMsg
    Case $GUI_EVENT_CLOSE
    Exit

EndSwitch
WEnd

Cheers

Thanks a million! Now I noticed how this doesn't work with Vista. Would you happen to know how to do it for Vista?

Thanks again,

Edited by smahdi83

Share this post


Link to post
Share on other sites

Your Welcome.

No Idea for vista sorry.

Vista and I don't play well together I'm afraid to say.

But one day when M$ can offer a straight out of the box OS that doesn't nag like a mofo and not call it better security instead of what it really is (BABYSITTING METHOD) and they can offer to streamline my use instead of hindering my use

Then maybe vista and I might get on ...lol

I'm not bias just anti vista... lmao

*Rant*

Cheers

Share this post


Link to post
Share on other sites

Thanks a million! Now I noticed how this doesn't work with Vista. Would you happen to know how to do it for Vista?

Thanks again,

Try this

#include <GUIConstants.au3>

Const $My_Computer = 0x11

$Form1 = GUICreate("AForm1", 388, 279, 322, 198, BitOR($WS_MAXIMIZEBOX,$WS_MINIMIZEBOX,$WS_SYSMENU,$WS_CAPTION,$WS_POPUPWINDOW,$WS_GROUP,$WS_TABSTOP,$WS_BORDER,$WS_CLIPSIBLINGS))
$Obj1 = ObjCreate("Shell.Explorer.2")
$Obj1_ctrl = GUICtrlCreateObj($Obj1, 0, 0, 1276, 908)
GUISetState(@SW_SHOW)

$Obj1.navigate2($My_Computer)
While 1 
$nMsg = GUIGetMsg()
Switch $nMsg
    Case $GUI_EVENT_CLOSE
    Exit

EndSwitch
WEnd

For other Special Folders see http://www.autoitscript.com/forum/index.php?showtopic=42394

Share this post


Link to post
Share on other sites

Create an account or sign in to comment

You need to be a member in order to leave a comment

Create an account

Sign up for a new account in our community. It's easy!


Register a new account

Sign in

Already have an account? Sign in here.


Sign In Now
Sign in to follow this  
Followers 0