Sign in to follow this  
Followers 0
GoogleDude

Embeded Explorer windows

8 posts in this topic

#1 ·  Posted (edited)

How can I have an embeded windows explorer view of a paticular folder path in my very basic/simple gui? kinda like Windows Explorer does when you run "explorer.exe c:\windows". Only I want to embed that view into a gui.

I searched bu found maily a bunch of excel coms and media player coms.

thanks,

googledude

Edited by GoogleDude

Share this post


Link to post
Share on other sites



How can I have an embeded windows explorer view of a paticular folder path in my very basic/simple gui? kinda like Windows Explorer does when you run "explorer.exe c:\windows". Only I want to embed that view into a gui.

I searched bu found maily a bunch of excel coms and media player coms.

thanks,

googledude

Something like this perhaps

#include<guiconstants.au3>
#include<WindowsConstants.au3>

;opt("WinTitleMatchMode",3)
$hGui1 = GUICreate("GUI Embedder",800,600,-1,-1,BitOr($GUI_SS_DEFAULT_GUI ,$WS_CLIPCHILDREN))
GUISetState(@SW_SHOW)
$Folder = "C:\Program Files"
ShellExecuteWait($Folder);Coverjuke\Coverjuke.exe")

;allow time for window to be created
;might be better to have winwait
sleep(1000)

;$Title = WinGetTitle($Folder)
$Handle = WinGetHandle($Folder)

WinMove($Handle, "", 0, 0, 600,600)
;Sleep(100)
$origParent = DllCall("user32.dll", "int", "SetParent", "hwnd", $Handle, "hwnd",$hGui1)

While 1
    $nMSG = GUIGetMsg() 
    Switch $nMSG
    Case $GUI_EVENT_CLOSE
      ;set child back To Original parent or it will be destroyed with ouyr window
        DllCall("user32.dll", "int", "SetParent", "hwnd", $Handle, "hwnd", $origParent[0])
        Exit
    EndSwitch
WEnd

Serial port communications UDF Includes functions for binary transmission and reception.printing UDF Useful for graphs, forms, labels, reports etc.Add User Call Tips to SciTE for functions in UDFs not included with AutoIt and for your own scripts.Functions with parameters in OnEvent mode and for Hot Keys One function replaces GuiSetOnEvent, GuiCtrlSetOnEvent and HotKeySet.UDF IsConnected2 for notification of status of connected state of many urls or IPs, without slowing the script.

Share this post


Link to post
Share on other sites

#3 ·  Posted (edited)

Thanks for the reply. However when I run the above example it just opens a blank gui and a separate windows explorer window with said folder. I tried ajusting the sleep value but didnt make a difference. Is there any way of getting the folder window inside the gui? kinda like a wrapper maybe or something?

im using Vista SP1 with AutoIt v3.3.0.0

Thanks,

GoogleDude

Edited by GoogleDude

Share this post


Link to post
Share on other sites

Thanks for the reply. However when I run the above example it just opens a blank gui and a separate windows explorer window with said folder. I tried ajusting the sleep value but didnt make a difference. Is there any way of getting the folder window inside the gui? kinda like a wrapper maybe or something?

im using Vista SP1 with AutoIt v3.3.0.0

Thanks,

GoogleDude

Whatyou get is all I meant to happen. If you don't want the window borders around the explorer window then if I understand you all you have to do is shift the child window

#include<guiconstants.au3>
#include<WindowsConstants.au3>

Const $SM_CXFIXEDFRAME = 7;, $SM_CXVSCROLL = 2,Const $SM_CYCAPTION = 4
;opt("WinTitleMatchMode",3)
Global $guiwid = 800, $guiht = 600
$hGui1 = GUICreate("GUI Embedder", $guiwid, $guiht, -1, -1, BitOR($GUI_SS_DEFAULT_GUI, $WS_CLIPCHILDREN))
GUISetState(@SW_SHOW)
$Folder = "C:\Program Files"
ShellExecuteWait($Folder)

WinWaitActive($Folder)

$Handle = WinGetHandle($Folder)
;get height of title bar and borders
$wtitle = DllCall('user32.dll', 'int', 'GetSystemMetrics', 'int', $SM_CYCAPTION)
$wtitle = $wtitle[0]
$wside = DllCall('user32.dll', 'int', 'GetSystemMetrics', 'int', $SM_CXFIXEDFRAME)
$wside = $wside[0]

WinMove($Handle, "", -$wside, -$wtitle - $wside, $guiwid + 2 * $wside, $guiht + $wtitle + $wside*2)

$origParent = DllCall("user32.dll", "int", "SetParent", "hwnd", $Handle, "hwnd", $hGui1)


While 1
    $nMSG = GUIGetMsg()
    Switch $nMSG
        Case $GUI_EVENT_CLOSE
           ;set child back To Original parent or it will be destroyed with our window
            DllCall("user32.dll", "int", "SetParent", "hwnd", $Handle, "hwnd", $origParent[0])
            Exit
    EndSwitch
WEnd

Serial port communications UDF Includes functions for binary transmission and reception.printing UDF Useful for graphs, forms, labels, reports etc.Add User Call Tips to SciTE for functions in UDFs not included with AutoIt and for your own scripts.Functions with parameters in OnEvent mode and for Hot Keys One function replaces GuiSetOnEvent, GuiCtrlSetOnEvent and HotKeySet.UDF IsConnected2 for notification of status of connected state of many urls or IPs, without slowing the script.

Share this post


Link to post
Share on other sites

CODE
#include "gUiConstantSex.au3"

$oIE = ObjCreate("Shell.Explorer.2")

GUICreate(@MyDocumentsDir, 800, 600,-1, -1)

$GUIActiveX = GUICtrlCreateObj( $oIE, 0, 0 , 800 , 600 )

GUISetState ()

$oIE.navigate(@MyDocumentsDir)

While 1

If GUIGetMsg() = $GUI_EVENT_CLOSE Then Exit

Sleep (10)

Wend

Share this post


Link to post
Share on other sites

CODE
#include "gUiConstantSex.au3"

$oIE = ObjCreate("Shell.Explorer.2")

GUICreate(@MyDocumentsDir, 800, 600,-1, -1)

$GUIActiveX = GUICtrlCreateObj( $oIE, 0, 0 , 800 , 600 )

GUISetState ()

$oIE.navigate(@MyDocumentsDir)

While 1

If GUIGetMsg() = $GUI_EVENT_CLOSE Then Exit

Sleep (10)

Wend

:P That's a lot better. Except that it doesn't get fully drawn when I try it. When it's first shown the left hand side isn't drawn and if I minimize it then restore it the left-hand side is shown but no folders are shown.

Serial port communications UDF Includes functions for binary transmission and reception.printing UDF Useful for graphs, forms, labels, reports etc.Add User Call Tips to SciTE for functions in UDFs not included with AutoIt and for your own scripts.Functions with parameters in OnEvent mode and for Hot Keys One function replaces GuiSetOnEvent, GuiCtrlSetOnEvent and HotKeySet.UDF IsConnected2 for notification of status of connected state of many urls or IPs, without slowing the script.

Share this post


Link to post
Share on other sites

:P That's a lot better. Except that it doesn't get fully drawn when I try it. When it's first shown the left hand side isn't drawn and if I minimize it then restore it the left-hand side is shown but no folders are shown.

If you adjust your Windows Explorer Folder Options - select General, Tasks, "Use Windows classic folders" it will display OK, on WinXP anyway.

Share this post


Link to post
Share on other sites

If you adjust your Windows Explorer Folder Options - select General, Tasks, "Use Windows classic folders" it will display OK, on WinXP anyway.

You're right, but I don't like it. :P


Serial port communications UDF Includes functions for binary transmission and reception.printing UDF Useful for graphs, forms, labels, reports etc.Add User Call Tips to SciTE for functions in UDFs not included with AutoIt and for your own scripts.Functions with parameters in OnEvent mode and for Hot Keys One function replaces GuiSetOnEvent, GuiCtrlSetOnEvent and HotKeySet.UDF IsConnected2 for notification of status of connected state of many urls or IPs, without slowing the script.

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