Sign in to follow this  
Followers 0

Explorer Frame UDF - Updated 1-21-11

16 posts in this topic

#1 ·  Posted (edited)

Update 1/21/11 - Add support for custom icons (Thanks Yashied). Right now file types '.exe', '.ico', '.lnk' will work. Can anyone think of other file types that might have a custom icons?

Update 12/21/10 - Removed extra _FLTA call. thanks jaberwocky6669

- Added extra styles to Listview. Changed formating of Drive Labels. Thanks Yashied

- TAB stop still not working and still searching for memory leak pointed out by Yashied.

- fixed another potential bug when trying to navigate to empty media like CDROM. Thanks Melba23

*- New GUIFrame has been updated to support x64 so be sure to get the new one.

Updated 12/19/10 - fixed bug displaying empty drives in 'My Computer'. (Thanks Melba23 Posted Image)

Ever since Melba23 released GUIFrame I have been wanting to rewrite my Explorer Listview UDF for frames. So here it is.

This UDF takes any frame created by GUIFrame and turns it into a MS-Windows like Explorer window. Each frame is populated with a Listview, address bar, back button and status bar.

These are the tasks the UDF will handle for the following Ctrls:

Listview:

- Double click navigation

- Column Header Right Click menu for selecting which columns to display

- Sorting functions for all columns

- formating of date displays

- Parent folder ( [..] ) is automatically added to each directory navigated to.

Comboboxes:

- type any directory into the address bar and press enter to navigate

- directory navigation is auto added to the combobox drop down menu

Status bars:

- Status bar folder stats are automatically updated

All history navigation is also handeled. In future I wont to work on a way to have back and fwd navigation. currently only back.

Special thanks go to Melba23 for GUIFrame. Thank You!

Zip file includes two examples and UDF. Please let me know if you have any trouble of any kind or any ideas. I love all feedback. Thanks for looking.

post-8949-0-37010100-1292784328_thumb.gi

ExpFrame 1-21-11.zip

Previous Downloads:125

GUIFrame can be found

Example 1

#include "ExpFrame.au3"

;Create GUI
$hGUI_1 = GUICreate("GUI Frames", 600, 200, 100, 100, $WS_OVERLAPPEDWINDOW)

;Create Frames
$iFrame_A = _GUIFrame_Create($hGUI_1)

;Set min sizes for the frames
_GUIFrame_SetMin($iFrame_A, 100, 100)

;Create Explorer Listviews
_GUIFrame_Switch($iFrame_A, 1)
$LocalList = _ExpFrame_Create(_GUIFrame_GetHandle($iFrame_A, 1))
_GUIFrame_Switch($iFrame_A, 2)
$LocalList2 = _ExpFrame_Create(_GUIFrame_GetHandle($iFrame_A, 2), 'c:\')

;Register functions for Windows Message IDs needed.
GUIRegisterMsg($WM_SIZE, "_ExpFrame_WMSIZE_Handler")
GUIRegisterMsg($WM_NOTIFY, "_ExpFrame_WMNotify_Handler")
GUIRegisterMsg($WM_COMMAND, '_ExpFrame_WMCOMMAND_Handler')

; Set resizing flag for all created frames
_GUIFrame_ResizeSet(0)

GUISetState(@SW_SHOW, $hGUI_1)

While 1
    $nMsg = GUIGetMsg()
    _ExpFrame_GUIGetMsg($nMsg);<< Dont forget to pass msg to _ExpFrame_GUIGetMsg!!
    Switch $nMsg
        Case $GUI_EVENT_CLOSE
            Exit
    EndSwitch
WEnd
Edited by Beege

[center][u]UDF's[/u][/center][center][font=Tahoma]Explorer Frame UDF |[u] [/u][u]ITaskBarList UDF[/u] | AU3 [u]Syntax Highlighter UDF[/u] | Scrolling Line Graph UDF | Tray Icon Bar Graph UDF | Explorer ListView UDF [/font][/center][center][font=Tahoma][u]Wiimote[/u] | WinSnap UDF | Text-to-Speech UDF | iTunes UDF | Google Functions | [u]Flicker Free Labels[/u] | [/font][u]Embedded Directory's[/u] | [u]Easy Plugin Compiler[/u][/center][center][font=Tahoma]| [/font][/center][center][u]Programs[/u][/center][center][font=Tahoma][u]Snipster[/u] | [u]FTP Explorer [/u]| [/font][font=Tahoma]Network Meter |Resistance Calculator [/font][/center][center]Instructables: [font=Arial, Helvetica, sans-serif]Bluetooth Wireless Voltage Meter using Wiimote + Pic Chip + AutoIt[/font][/center][center]"Only those who have the patience to do simple things perfectly will acquire the skill to do difficult things easily" - Johann von Schiller[/center]

Share this post


Link to post
Share on other sites



#2 ·  Posted

Beege,

Cracking UDF! :x

However, to pay you back for your various bug reports and feature requests on GUIFrame.... :P

I have a system with a number of card readers and your UDF demands that I have some media in them to work. I have managed to get round it by amending your __DirSetMyComputer function to avoid trying to access these drives when they have no media like this:

Func __DirSetMyComputer($iIndex)

    If $g_aExpFrames[$iIndex][$g_sCurrentDir] <> 'My Computer' Then __Columns_GetWidths($iIndex)
    $g_aExpFrames[$iIndex][$g_sCurrentDir] = 'My Computer'
    _GUICtrlListView_DeleteAllItems($g_aExpFrames[$iIndex][$g_hListView])
    __Columns_SetWidths($iIndex, True)

    Local $drives = DriveGetDrive("ALL")
    Local $iIcon, $sItem, $iItem, $sName, $iSpace, $iAvailable, $iTotalAvailable, $iTotalSize, $iIconIndex = 0
    For $i = 1 To $drives[0]

        $sName = DriveGetLabel($drives[$i] & '\') & ' (' & StringUpper($drives[$i]) & ')'
        $sItem = $sName
        $iIcon = __GUIImageList_GetFileIconIndex($drives[$i] & '\')

        If DriveStatus($drives[$i] & '\') <> "NOTREADY" Then ; <<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<

            $iSpace = DriveSpaceTotal($drives[$i]) * 1048576;Space
            $iAvailable = DriveSpaceFree($drives[$i]) * 1048576; Avalible
            $iTotalSize += $iSpace
            $iTotalAvailable += $iAvailable

            If BitAND($g_aExpFrames[$iIndex][$g_iCompCol], 1) Then $sItem &= '|' & __FormatSize($iSpace)
            If BitAND($g_aExpFrames[$iIndex][$g_iCompCol], 2) Then $sItem &= '|' & __FormatSize($iAvailable)
            If BitAND($g_aExpFrames[$iIndex][$g_iCompCol], 4) Then $sItem &= '|' & DriveGetType($drives[$i]);type
            If BitAND($g_aExpFrames[$iIndex][$g_iCompCol], 8) Then;Attributes
                If DriveGetType($drives[$i] & '\') <> 'CDROM' Then $sItem &= '|' & FileGetAttrib($drives[$i] & '\')
            EndIf

        EndIf ; <<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<

        $iItem = GUICtrlCreateListViewItem('', $g_aExpFrames[$iIndex][$g_ListView])
        GUICtrlSetData($iItem, $sItem);Use GUICtrlSetData to avoid columns being auto resized.
        _GUICtrlListView_SetItem($g_aExpFrames[$iIndex][$g_ListView], $sName, $iIconIndex, 0, $iIcon);set icon index
        $iIconIndex += 1
    Next

    _GUICtrlStatusBar_SetText($g_aExpFrames[$iIndex][$g_hStatusbar], @TAB & $drives[0] & ' Drives, ' & __FormatSize($iTotalAvailable) & ' Free of ' & __FormatSize($iTotalSize) & @TAB, 0, 0)
    __ComboHistoryAdd($g_aExpFrames[$iIndex][$g_idCombo], $g_aExpFrames[$iIndex][$g_sCombo], 'My Computer')

    Return 1

With that small fix I have no more problems. You will know whether that might cause problems elsewhere - I hope not because it is a very simple solution. :shifty:

Sorry to come up with a problem so quickly, but I could not get it to work and see how good it is unless I fixed it! :nuke:

M23


Any of my own code posted anywhere on the forum is available for use by others without any restriction of any kind._______My UDFs:

ChooseFileFolder ---- Single and multiple selections from specified path treeview listing
Date_Time_Convert - Easily convert date/time formats, including the language used
ExtMsgBox ------------- A highly customisable replacement for MsgBox
GUIExtender ----------- Extend and retract multiple sections within a GUI
GUIFrame -------------- Subdivide GUIs into many adjustable frames
GUIListViewEx -------- Insert, delete, move, drag, sort and edit ListView items
GUITreeViewEx ------ Check/clear parent and child checkboxes in a TreeView
Marquee ---------------- Scrolling tickertape GUIs
NoFocusLines --------- Remove the dotted focus lines from buttons, sliders, radios and checkboxes
Notify -------------------- Small notifications on the edge of the display
Scrollbars -------------- Automatically sized scrollbars with a single command
StringSize -------------- Automatically size controls to fit text
Toast -------------------- Small GUIs which pop out of the notification area

Share this post


Link to post
Share on other sites

#3 ·  Posted

Melba23,

Thank you very much for the feedback and bug report. I will make those changes right away! Cant have a error the very second it starts! Posted Image


[center][u]UDF's[/u][/center][center][font=Tahoma]Explorer Frame UDF |[u] [/u][u]ITaskBarList UDF[/u] | AU3 [u]Syntax Highlighter UDF[/u] | Scrolling Line Graph UDF | Tray Icon Bar Graph UDF | Explorer ListView UDF [/font][/center][center][font=Tahoma][u]Wiimote[/u] | WinSnap UDF | Text-to-Speech UDF | iTunes UDF | Google Functions | [u]Flicker Free Labels[/u] | [/font][u]Embedded Directory's[/u] | [u]Easy Plugin Compiler[/u][/center][center][font=Tahoma]| [/font][/center][center][u]Programs[/u][/center][center][font=Tahoma][u]Snipster[/u] | [u]FTP Explorer [/u]| [/font][font=Tahoma]Network Meter |Resistance Calculator [/font][/center][center]Instructables: [font=Arial, Helvetica, sans-serif]Bluetooth Wireless Voltage Meter using Wiimote + Pic Chip + AutoIt[/font][/center][center]"Only those who have the patience to do simple things perfectly will acquire the skill to do difficult things easily" - Johann von Schiller[/center]

Share this post


Link to post
Share on other sites

#5 ·  Posted (edited)

Nicely done Beege. But there are a few comments:

  • Why do you use icons from the system image list? As a result, custom icons does not displayed (.exe, .ico, .lnk, etc). Look at _WinAPI_ShellExtractAssociatedIcon() function from WinAPIEx UDF.
  • If you are using a system image list, you should use LVS_SHAREIMAGELISTS flag (I think).
  • ExpFrame UDF will work only in x86 OS. It's inherited from GUIFrame UDF (_WinAPI_SetWindowLong()).
  • There is a small memory leak.
  • Does not work TAB key (WS_TABSTOP).
  • You should not use Sleep(1). This dramatically reduces the processing speed.
  • What happen if the disk label is "System (XP)"? May be better to replace

    $sChangeDir = StringMid($sItemText, StringInStr($sItemText, '(') + 1, 2) & '\'

    to

    $sChangeDir = StringMid($sItemText, StringInStr($sItemText, ':') - 1, 2) & '\'
Edited by Yashied

Share this post


Link to post
Share on other sites

#6 ·  Posted

Nicely done Beege. But there are a few comments:

  • Why do you use icons from the system image list? As a result, custom icons does not displayed (.exe, .ico, .lnk, etc). Look at _WinAPI_ShellExtractAssociatedIcon() function from WinAPIEx UDF.
  • If you are using a system image list, you should use LVS_SHAREIMAGELISTS flag (I think).
  • ExpFrame UDF will work only in x86 OS. It's inherited from GUIFrame UDF (_WinAPI_SetWindowLong()).
  • There is a small memory leak.
  • Does not work TAB key (WS_TABSTOP).
  • You should not use Sleep(1). This dramatically reduces the processing speed.
  • What happen if the disk label is "System (XP)"? May be better to replace

    $sChangeDir = StringMid($sItemText, StringInStr($sItemText, '(') + 1, 2) & '\'

    to

    $sChangeDir = StringMid($sItemText, StringInStr($sItemText, ':') - 1, 2) & '\'
Yashied, Thankyou very much for the feedback!

- Very good point about the custom icons. I will start looking into other ways to implement that.

- $LVS_SHAREIMAGELISTS will be added to the style.

- Do you know of any way I can make this x64 compatible?

- Any suggestion on how I can find the memory leak? How did you spot that btw?

- The sleep(1) is only executed every 250ms so it really shouldn't be causing a performance hit. Its just there to keep the GUI from not responding when Im populating a large directory. Come to think of it, that might have been a bit of code from my "FTP Explorer" program. I think Ill remove it..

- I'm a little confused about the TABs but will look more at it tonight.

- I Will defiantly make the changes about the $changedir string. Good idea! Thanks


[center][u]UDF's[/u][/center][center][font=Tahoma]Explorer Frame UDF |[u] [/u][u]ITaskBarList UDF[/u] | AU3 [u]Syntax Highlighter UDF[/u] | Scrolling Line Graph UDF | Tray Icon Bar Graph UDF | Explorer ListView UDF [/font][/center][center][font=Tahoma][u]Wiimote[/u] | WinSnap UDF | Text-to-Speech UDF | iTunes UDF | Google Functions | [u]Flicker Free Labels[/u] | [/font][u]Embedded Directory's[/u] | [u]Easy Plugin Compiler[/u][/center][center][font=Tahoma]| [/font][/center][center][u]Programs[/u][/center][center][font=Tahoma][u]Snipster[/u] | [u]FTP Explorer [/u]| [/font][font=Tahoma]Network Meter |Resistance Calculator [/font][/center][center]Instructables: [font=Arial, Helvetica, sans-serif]Bluetooth Wireless Voltage Meter using Wiimote + Pic Chip + AutoIt[/font][/center][center]"Only those who have the patience to do simple things perfectly will acquire the skill to do difficult things easily" - Johann von Schiller[/center]

Share this post


Link to post
Share on other sites

#7 ·  Posted

In your function __DirSetCurrent you have a variable declared after it's first use:

$aList = __FLTA($sDirectory)
Local $aList = __FLTA($sDirectory)

jaberwocky6669, Thank you for pointing that out! Don't know how I did that.Posted Image


[center][u]UDF's[/u][/center][center][font=Tahoma]Explorer Frame UDF |[u] [/u][u]ITaskBarList UDF[/u] | AU3 [u]Syntax Highlighter UDF[/u] | Scrolling Line Graph UDF | Tray Icon Bar Graph UDF | Explorer ListView UDF [/font][/center][center][font=Tahoma][u]Wiimote[/u] | WinSnap UDF | Text-to-Speech UDF | iTunes UDF | Google Functions | [u]Flicker Free Labels[/u] | [/font][u]Embedded Directory's[/u] | [u]Easy Plugin Compiler[/u][/center][center][font=Tahoma]| [/font][/center][center][u]Programs[/u][/center][center][font=Tahoma][u]Snipster[/u] | [u]FTP Explorer [/u]| [/font][font=Tahoma]Network Meter |Resistance Calculator [/font][/center][center]Instructables: [font=Arial, Helvetica, sans-serif]Bluetooth Wireless Voltage Meter using Wiimote + Pic Chip + AutoIt[/font][/center][center]"Only those who have the patience to do simple things perfectly will acquire the skill to do difficult things easily" - Johann von Schiller[/center]

Share this post


Link to post
Share on other sites

#8 ·  Posted

Do you know of any way I can make this x64 compatible?

_WinAPI_SetWindowLongEx() from WinAPIEx UDF.

How did you spot that btw?

I just opened/returned the System32 folder many times. Windows Task Manager showed an increase of the memory.

Share this post


Link to post
Share on other sites

#9 ·  Posted

Yashied,

Is it as simple as replacing _WinAPI_SetWindowLong with _WinAPI_SetWindowLongEx in the GUIFrame UDF? Or do I also have to cast the new WndProc pointer in a different form? And if so, how? :x

M23


Any of my own code posted anywhere on the forum is available for use by others without any restriction of any kind._______My UDFs:

ChooseFileFolder ---- Single and multiple selections from specified path treeview listing
Date_Time_Convert - Easily convert date/time formats, including the language used
ExtMsgBox ------------- A highly customisable replacement for MsgBox
GUIExtender ----------- Extend and retract multiple sections within a GUI
GUIFrame -------------- Subdivide GUIs into many adjustable frames
GUIListViewEx -------- Insert, delete, move, drag, sort and edit ListView items
GUITreeViewEx ------ Check/clear parent and child checkboxes in a TreeView
Marquee ---------------- Scrolling tickertape GUIs
NoFocusLines --------- Remove the dotted focus lines from buttons, sliders, radios and checkboxes
Notify -------------------- Small notifications on the edge of the display
Scrollbars -------------- Automatically sized scrollbars with a single command
StringSize -------------- Automatically size controls to fit text
Toast -------------------- Small GUIs which pop out of the notification area

Share this post


Link to post
Share on other sites

#10 ·  Posted (edited)

Is it as simple as replacing _WinAPI_SetWindowLong with _WinAPI_SetWindowLongEx in the GUIFrame UDF?

Yes.

And replace

DllCallbackRegister("_GUIFrame_SepWndProc", "int", "hwnd;uint;wparam;lparam")

to

DllCallbackRegister("_GUIFrame_SepWndProc", "lresult", "hwnd;uint;wparam;lparam")
Edited by Yashied

Share this post


Link to post
Share on other sites

#11 ·  Posted

Yashied,

Thanks. I have aready amended the UDF code and aim put out the new version later today. :P

I have extracted the function rather than add the whole #include file - still crediting you as the author of course. Are you happy with that? :x

M23


Any of my own code posted anywhere on the forum is available for use by others without any restriction of any kind._______My UDFs:

ChooseFileFolder ---- Single and multiple selections from specified path treeview listing
Date_Time_Convert - Easily convert date/time formats, including the language used
ExtMsgBox ------------- A highly customisable replacement for MsgBox
GUIExtender ----------- Extend and retract multiple sections within a GUI
GUIFrame -------------- Subdivide GUIs into many adjustable frames
GUIListViewEx -------- Insert, delete, move, drag, sort and edit ListView items
GUITreeViewEx ------ Check/clear parent and child checkboxes in a TreeView
Marquee ---------------- Scrolling tickertape GUIs
NoFocusLines --------- Remove the dotted focus lines from buttons, sliders, radios and checkboxes
Notify -------------------- Small notifications on the edge of the display
Scrollbars -------------- Automatically sized scrollbars with a single command
StringSize -------------- Automatically size controls to fit text
Toast -------------------- Small GUIs which pop out of the notification area

Share this post


Link to post
Share on other sites

#13 ·  Posted

Beege,

New GUIFrame version posted. One problem sorted at least! :x

M23


Any of my own code posted anywhere on the forum is available for use by others without any restriction of any kind._______My UDFs:

ChooseFileFolder ---- Single and multiple selections from specified path treeview listing
Date_Time_Convert - Easily convert date/time formats, including the language used
ExtMsgBox ------------- A highly customisable replacement for MsgBox
GUIExtender ----------- Extend and retract multiple sections within a GUI
GUIFrame -------------- Subdivide GUIs into many adjustable frames
GUIListViewEx -------- Insert, delete, move, drag, sort and edit ListView items
GUITreeViewEx ------ Check/clear parent and child checkboxes in a TreeView
Marquee ---------------- Scrolling tickertape GUIs
NoFocusLines --------- Remove the dotted focus lines from buttons, sliders, radios and checkboxes
Notify -------------------- Small notifications on the edge of the display
Scrollbars -------------- Automatically sized scrollbars with a single command
StringSize -------------- Automatically size controls to fit text
Toast -------------------- Small GUIs which pop out of the notification area

Share this post


Link to post
Share on other sites

#14 ·  Posted

Beege,

New GUIFrame version posted. One problem sorted at least! :x

M23

Thats Excellent! Thanks Melba23Posted Image


[center][u]UDF's[/u][/center][center][font=Tahoma]Explorer Frame UDF |[u] [/u][u]ITaskBarList UDF[/u] | AU3 [u]Syntax Highlighter UDF[/u] | Scrolling Line Graph UDF | Tray Icon Bar Graph UDF | Explorer ListView UDF [/font][/center][center][font=Tahoma][u]Wiimote[/u] | WinSnap UDF | Text-to-Speech UDF | iTunes UDF | Google Functions | [u]Flicker Free Labels[/u] | [/font][u]Embedded Directory's[/u] | [u]Easy Plugin Compiler[/u][/center][center][font=Tahoma]| [/font][/center][center][u]Programs[/u][/center][center][font=Tahoma][u]Snipster[/u] | [u]FTP Explorer [/u]| [/font][font=Tahoma]Network Meter |Resistance Calculator [/font][/center][center]Instructables: [font=Arial, Helvetica, sans-serif]Bluetooth Wireless Voltage Meter using Wiimote + Pic Chip + AutoIt[/font][/center][center]"Only those who have the patience to do simple things perfectly will acquire the skill to do difficult things easily" - Johann von Schiller[/center]

Share this post


Link to post
Share on other sites

#15 ·  Posted

Update! Posted Image


[center][u]UDF's[/u][/center][center][font=Tahoma]Explorer Frame UDF |[u] [/u][u]ITaskBarList UDF[/u] | AU3 [u]Syntax Highlighter UDF[/u] | Scrolling Line Graph UDF | Tray Icon Bar Graph UDF | Explorer ListView UDF [/font][/center][center][font=Tahoma][u]Wiimote[/u] | WinSnap UDF | Text-to-Speech UDF | iTunes UDF | Google Functions | [u]Flicker Free Labels[/u] | [/font][u]Embedded Directory's[/u] | [u]Easy Plugin Compiler[/u][/center][center][font=Tahoma]| [/font][/center][center][u]Programs[/u][/center][center][font=Tahoma][u]Snipster[/u] | [u]FTP Explorer [/u]| [/font][font=Tahoma]Network Meter |Resistance Calculator [/font][/center][center]Instructables: [font=Arial, Helvetica, sans-serif]Bluetooth Wireless Voltage Meter using Wiimote + Pic Chip + AutoIt[/font][/center][center]"Only those who have the patience to do simple things perfectly will acquire the skill to do difficult things easily" - Johann von Schiller[/center]

Share this post


Link to post
Share on other sites

#16 ·  Posted

Its great and all but it cannot open files here is the sollution

just a simple shellexecute

ExpFrame_Mod.au3.au3


It seams your application just crashed

0xDODA

0xDODA

It seams your application just crashed

0x0D3DODADA1

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