Jump to content

This site uses cookies. By continuing to browse the site you are agreeing to our use of cookies. Find out more here. X
X


Photo

Explorer Frame UDF - Updated 1-21-11


  • Please log in to reply
15 replies to this topic

#1 Beege

Beege

    Universalist

  • MVPs
  • 895 posts

Posted 19 December 2010 - 07:01 PM

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.

screenshot.gif
Attached File  ExpFrame 1-21-11.zip   13.49KB   778 downloads
Previous Downloads:125
GUIFrame can be found HERE

Example 1
AutoIt         
#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, 22 January 2011 - 12:23 AM.








#2 Melba23

Melba23

    I'm old - what's your excuse?

  • Moderators
  • 21,259 posts

Posted 19 December 2010 - 07:43 PM

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:
AutoIt         
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
StringSize - Automatically size controls to fit text                                                               ExtMsgBox - A user customisable replacement for MsgBox
Toast - Small GUIs which pop out of the Systray                                                                Marquee - Scrolling tickertape GUIs
Scrollbars - Automatically sized scrollbars with a single command                                   GUIFrame - Subdivide GUIs into many adjustable frames
GUIExtender - Extend and retract multiple sections within a GUI                                      NoFocusLines - Remove the dotted focus lines from buttons, sliders, radios and checkboxes
ChooseFileFolder - Single and multiple selections from specified path tree structure      Notify - Small notifications on the edge of the display
Date_Time_Convert - Easily convert date/time formats, including the language               GUIListViewEx - Insert, delete, move, drag, sort and edit ListView items

#3 Beege

Beege

    Universalist

  • MVPs
  • 895 posts

Posted 19 December 2010 - 07:53 PM

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

#4 jaberwacky

jaberwacky

    RegExp("\m/")

  • Active Members
  • PipPipPipPipPipPip
  • 3,119 posts

Posted 20 December 2010 - 01:42 AM

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

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


#5 Yashied

Yashied

    Happy in Moscow

  • MVPs
  • 2,574 posts

Posted 20 December 2010 - 07:52 AM

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, 20 December 2010 - 08:09 AM.


#6 Beege

Beege

    Universalist

  • MVPs
  • 895 posts

Posted 20 December 2010 - 09:12 PM

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

#7 Beege

Beege

    Universalist

  • MVPs
  • 895 posts

Posted 20 December 2010 - 09:14 PM

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

#8 Yashied

Yashied

    Happy in Moscow

  • MVPs
  • 2,574 posts

Posted 20 December 2010 - 09:28 PM

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.

#9 Melba23

Melba23

    I'm old - what's your excuse?

  • Moderators
  • 21,259 posts

Posted 21 December 2010 - 09:12 AM

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
StringSize - Automatically size controls to fit text                                                               ExtMsgBox - A user customisable replacement for MsgBox
Toast - Small GUIs which pop out of the Systray                                                                Marquee - Scrolling tickertape GUIs
Scrollbars - Automatically sized scrollbars with a single command                                   GUIFrame - Subdivide GUIs into many adjustable frames
GUIExtender - Extend and retract multiple sections within a GUI                                      NoFocusLines - Remove the dotted focus lines from buttons, sliders, radios and checkboxes
ChooseFileFolder - Single and multiple selections from specified path tree structure      Notify - Small notifications on the edge of the display
Date_Time_Convert - Easily convert date/time formats, including the language               GUIListViewEx - Insert, delete, move, drag, sort and edit ListView items

#10 Yashied

Yashied

    Happy in Moscow

  • MVPs
  • 2,574 posts

Posted 21 December 2010 - 09:23 AM

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, 21 December 2010 - 09:25 AM.


#11 Melba23

Melba23

    I'm old - what's your excuse?

  • Moderators
  • 21,259 posts

Posted 21 December 2010 - 09:33 AM

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
StringSize - Automatically size controls to fit text                                                               ExtMsgBox - A user customisable replacement for MsgBox
Toast - Small GUIs which pop out of the Systray                                                                Marquee - Scrolling tickertape GUIs
Scrollbars - Automatically sized scrollbars with a single command                                   GUIFrame - Subdivide GUIs into many adjustable frames
GUIExtender - Extend and retract multiple sections within a GUI                                      NoFocusLines - Remove the dotted focus lines from buttons, sliders, radios and checkboxes
ChooseFileFolder - Single and multiple selections from specified path tree structure      Notify - Small notifications on the edge of the display
Date_Time_Convert - Easily convert date/time formats, including the language               GUIListViewEx - Insert, delete, move, drag, sort and edit ListView items

#12 Yashied

Yashied

    Happy in Moscow

  • MVPs
  • 2,574 posts

Posted 21 December 2010 - 12:13 PM

Are you happy with that? :x

Of course.

:P

Edited by Yashied, 21 December 2010 - 12:13 PM.


#13 Melba23

Melba23

    I'm old - what's your excuse?

  • Moderators
  • 21,259 posts

Posted 21 December 2010 - 03:40 PM

Beege,

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

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

#14 Beege

Beege

    Universalist

  • MVPs
  • 895 posts

Posted 21 December 2010 - 06:37 PM

Beege,

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

M23


Thats Excellent! Thanks Melba23Posted Image

#15 Beege

Beege

    Universalist

  • MVPs
  • 895 posts

Posted 22 January 2011 - 12:24 AM

Update! Posted Image

#16 sycam0inc

sycam0inc

    Adventurer

  • Active Members
  • PipPip
  • 100 posts

Posted 23 May 2013 - 02:47 AM

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

 

just a simple shellexecute

Attached Files


It seams your application just crashed

0xDODA

0xDODA

It seams your application just crashed

0x0D3DODADA1





0 user(s) are reading this topic

0 members, 0 guests, 0 anonymous users