JusGellin Posted November 3, 2007 Posted November 3, 2007 I would like to embed two Windows File Explorers side by side. Can this be done? I used the example for IE Explorer, but I can't control the detail view. #include <GUIConstants.au3> $oWinExplorer = ObjCreate("Shell.Explorer") ; Create a simple GUI for our output GUICreate ( "Embedded Windows Explorer Test", 640, 580,(@DesktopWidth-640)/2, (@DesktopHeight-580)/2, BitOr($WS_OVERLAPPEDWINDOW, $WS_CLIPSIBLINGS, $WS_CLIPCHILDREN)) $GUIActiveX = GUICtrlCreateObj ( $oWinExplorer, 10, 40 , 600 , 360 ) GUISetState () ;Show GUI ; get file folder $oWinExplorer.navigate("D:\Index") ; Waiting for user to close the window While 1 $msg = GUIGetMsg() Select Case $msg = $GUI_EVENT_CLOSE ExitLoop EndSelect Wend GUIDelete () Exit Thanks
Achilles Posted November 3, 2007 Posted November 3, 2007 Look at _IECreateEmbedded in the helpfile... it might help you. My Programs[list][*]Knight Media Player[*]Multiple Desktops[*]Daily Comics[*]Journal[/list]
JusGellin Posted November 3, 2007 Author Posted November 3, 2007 Look at _IECreateEmbedded in the helpfile... it might help you.Thanks, that's the example I used. But all of that is for using the Web Browser. I want to just set something up using two Windows Explorers in its own contained window where I can use the file browsers as normal.
Achilles Posted November 3, 2007 Posted November 3, 2007 Well, I messed around with it a little and you can use the _IENavigate to go through you folders to... on my computer it wasn't working perfectly but it did work. Just something like _IENavigage($webItem, 'C:\') My Programs[list][*]Knight Media Player[*]Multiple Desktops[*]Daily Comics[*]Journal[/list]
JusGellin Posted November 4, 2007 Author Posted November 4, 2007 Well, I messed around with it a little and you can use the _IENavigate to go through you folders to... on my computer it wasn't working perfectly but it did work. Just something like _IENavigage($webItem, 'C:\')How do you mean? How could I fit it into the example I used? - Thanks
ptrex Posted November 4, 2007 Posted November 4, 2007 @JusGellin What he means is this : #include <GUIConstants.au3> #include <IE.au3> _IEErrorHandlerRegister () $oIE = _IECreateEmbedded () GUICreate("Embedded Web control Test", 640, 580, _ (@DesktopWidth - 640) / 2, (@DesktopHeight - 580) / 2, _ $WS_OVERLAPPEDWINDOW + $WS_VISIBLE + $WS_CLIPSIBLINGS) $GUIActiveX = GUICtrlCreateObj($oIE, 10, 40, 600, 360) $GUI_Button_Back = GUICtrlCreateButton("Back", 10, 420, 100, 30) $GUI_Button_Forward = GUICtrlCreateButton("Forward", 120, 420, 100, 30) $GUI_Button_Home = GUICtrlCreateButton("Home", 230, 420, 100, 30) $GUI_Button_Stop = GUICtrlCreateButton("Stop", 340, 420, 100, 30) GUISetState() ;Show GUI _IENavigate ($oIE, "C:\") ; Waiting for user to close the window While 1 $msg = GUIGetMsg() Select Case $msg = $GUI_EVENT_CLOSE ExitLoop Case $msg = $GUI_Button_Home _IENavigate ($oIE, "C:\") Case $msg = $GUI_Button_Back _IEAction ($oIE, "back") Case $msg = $GUI_Button_Forward _IEAction ($oIE, "forward") Case $msg = $GUI_Button_Stop _IEAction ($oIE, "stop") EndSelect WEnd regards ptrex Contributions :Firewall Log Analyzer for XP - Creating COM objects without a need of DLL's - UPnP support in AU3Crystal Reports Viewer - PDFCreator in AutoIT - Duplicate File FinderSQLite3 Database functionality - USB Monitoring - Reading Excel using SQLRun Au3 as a Windows Service - File Monitor - Embedded Flash PlayerDynamic Functions - Control Panel Applets - Digital Signing Code - Excel Grid In AutoIT - Constants for Special Folders in WindowsRead data from Any Windows Edit Control - SOAP and Web Services in AutoIT - Barcode Printing Using PS - AU3 on LightTD WebserverMS LogParser SQL Engine in AutoIT - ImageMagick Image Processing - Converter @ Dec - Hex - Bin -Email Address Encoder - MSI Editor - SNMP - MIB ProtocolFinancial Functions UDF - Set ACL Permissions - Syntax HighLighter for AU3ADOR.RecordSet approach - Real OCR - HTTP Disk - PDF Reader Personal Worldclock - MS Indexing Engine - Printing ControlsGuiListView - Navigation (break the 4000 Limit barrier) - Registration Free COM DLL Distribution - Update - WinRM SMART Analysis - COM Object Browser - Excel PivotTable Object - VLC Media Player - Windows LogOnOff Gui -Extract Data from Outlook to Word & Excel - Analyze Event ID 4226 - DotNet Compiler Wrapper - Powershell_COM - New
JusGellin Posted November 5, 2007 Author Posted November 5, 2007 That doesn't quite do what I want. I would like to have a detailed view of the Windows Explorer, but this only gives me folders. I finally figured out how to at least get the Windows Explorer part working like I wanted, but without the embedded part: Opt("WinTitleMatchMode", 3) RunWait("explorer.exe /e,d:\index") WinWait("D:\Index", "") WinMove("D:\Index", "", 600, 0, 600, 500) RunWait("explorer.exe /e,d:\index") WinWait("D:\Index", "") WinMove("D:\Index", "", 0, 0, 600, 500) What this does is put two Windows Explorer windows side by side on the desktop. I would lke to embed these both in a window(form) so I could move the one window anywhere on my desktop to use. So, how can I embed the above code in a window, if it is possible? Thanks again
Moderators SmOke_N Posted November 5, 2007 Moderators Posted November 5, 2007 (edited) Fun times...expandcollapse popup#include <GUIConstants.au3> $hGUI = GUICreate("MyExplorer", 1200, 500, -1, -1, BitOr($WS_MINIMIZEBOX, $WS_CAPTION, $WS_POPUP, $WS_SYSMENU, $WS_CLIPCHILDREN)) $Exp1 = _RunEmbExp("explorer.exe /e,d:\index", "[CLASS:ExploreWClass]", $hGUI, 600, 0, 600, 500) $Exp2 = _RunEmbExp("explorer.exe /e,d:\index", "[CLASS:ExploreWClass]", $hGUI, 0, 0, 600, 500) GUISetState() While 1 $msg = GUIGetMsg() If $msg = -3 Then GUISetState(@SW_HIDE, $hGUI) WinClose($Exp1) WinClose($Exp2) ExitLoop EndIf WEnd Func _RunEmbExp($sRun, $sClass, $hGUI, $nLeftGUI, $nTopGUI, $nRightGUI, $nBottomGUI, $nStyle = -2, $nExStyle = -2) Local $iPID = Run($sRun, '', @SW_HIDE) WinWait($sClass) Return _WinEmbedToGUI(WinGetHandle($sClass), $hGUI, $nLeftGUI, $nTopGUI, $nRightGUI, $nBottomGUI, $nStyle, $nExStyle) EndFunc Func _WinEmbedToGUI($hWnd, $hGUI, $nLeftGUI, $nTopGUI, $nRightGUI, $nBottomGUI, $nStyle = -2, $nExStyle = -2) Local $nExStyleEx = DllCall("user32.dll", "int", "GetWindowLong", "hwnd", $hWnd, "int", -20) If IsArray($nExStyleEx) = 0 Then Return SetError(1, 0, 0) DllCall("user32.dll", "int", "SetWindowLong", "hwnd", $hWnd, "int", -20, "int", BitOr($nExStyleEx[0], 0x00000040));WS_EX_MDICHILD DllCall("user32.dll", "int", "SetParent", "hwnd", $hWnd, "hwnd", $hGUI) WinSetState($hWnd, '', @SW_SHOW) WinMove($hWnd, "", $nLeftGUI, $nTopGUI, $nRightGUI, $nBottomGUI) If $nStyle = -2 And $nExStyle = -2 Then Return $hWnd Local $GWL_STYLE = -16, $GWL_EXSTYLE = -20 Local $SWP_NOMOVE = 0x2, $SWP_NOSIZE = 0x1 Local $SWP_SHOWWINDOW = 0x40, $SWP_NOZORDER = 0x4 Local $iFlags = BitOR($SWP_SHOWWINDOW, $SWP_NOSIZE, $SWP_NOMOVE, $SWP_NOZORDER) If $nStyle = -2 Then $nStyle = $WS_MINIMIZEBOX + $WS_CAPTION + $WS_POPUP + $WS_SYSMENU If $nExStyle = -2 Then $nExStyle = $nExStyleEx[0] DllCall("User32.dll", "int", "SetWindowLong", "hwnd", $hWnd, "int", $GWL_STYLE, "int", $nStyle) DllCall("User32.dll", "int", "SetWindowLong", "hwnd", $hWnd, "int", $GWL_EXSTYLE, "int", $nExStyle) DllCall("User32.dll", "int", "SetWindowPos", "hwnd", $hWnd, "hwnd", 0, "int", 0, "int", 0, _ "int", 0, "int", 0, "int", $iFlags) Return $hWnd EndFunc Edit: Didn't like how it showed each explorer being closed before closing so I hid the GUI on exit first. Edited November 5, 2007 by SmOke_N Common sense plays a role in the basics of understanding AutoIt... If you're lacking in that, do us all a favor, and step away from the computer.
JusGellin Posted November 5, 2007 Author Posted November 5, 2007 WOW!! I am so impressed! You certainly do know your stuff. Now I have a really useful tool.Thanks so much for helping me. Your code will give me something that I can study and learn from.I am so delighted.
Recommended Posts
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 accountSign in
Already have an account? Sign in here.
Sign In Now