AutoHotkey Community

It is currently May 27th, 2012, 6:25 am

All times are UTC [ DST ]




Post new topic Reply to topic  [ 8 posts ] 
Author Message
PostPosted: May 18th, 2009, 10:28 pm 
Offline

Joined: May 12th, 2008, 2:23 pm
Posts: 30
Location: Germany
Fast Explorer Context Menu Extension DLL

Quote:
This handy utility allows you to manage context menus items of file objects displayed in a file manager like Windows Explorer or any other application that deals with shell's application programming interface. It's a very simple way to make your often used file actions quickly accessible.
Fast Explorer handles both static and dynamic context menu items and can assist with even more...
With Fast Explorer you can create new context menu items, submenus (cascaded menus), dividers, and optionally specify menu bitmaps and hint text.
For an ultimate control over dynamic context menu items added from within Fast Explorer you can define your own look & feel using the custom-drawing feature.

Fast Explorer-driven context menu items can be associated with any file type registered in Windows shell, including the wide range of predefined shell objects:
All files; All files and file folders; All non-associated files; All folders; All file folders; File folder background; Entire network; All network shares; All network servers; All printers; All drives; Audio CD in drive; DVD drive
and a set of perceived types, like Image, Text, Audio, Video, Compressed, or System.

You'll need to place the FEShlExt.dll in the script-directory (download here, feredist.zip)
Documentation

Example:
Code:
#include FE.ahk
#singleInstance force

;load the COM dll
;set autobuild on: builds the menu everytime sth changes
FE_load(true)

;add root item, make it a submenu
;FE_addItem(id,parent,submenu,application,parameters,caption,hint,iconfile,iconindex,checked,filetype)
rNo := FE_addItem("root",0,1,"","","Test Context Menu","","shell32.dll",24,1,"*")

;add items to the root menu
FE_addItem("deleteme","root",0,A_WinDir "\regedit.exe","", "Registry Editor", "", "", 0,1,"*")
FE_addItem("hex",rNo,0,A_WinDir "\notepad.exe","`%1", "Notepad", "", "notepad.exe",0,1,"*")

;add custom Settings
FE_addCustomSetting("Enabled","true")
FE_addCustomSetting("FirstLevelDefault","true")
FE_addCustomSetting("BackgroundFix","true")
FE_addDebugSetting("DebugLogging","false")

;delete one item
FE_deleteItem("deleteme")

;build the menu, not needed if autobuild is turned on
;FE_buildMenu()

return


#9::
OnExit:
   FE_unload()
   ExitApp


QuickHelp:
Code:
"Parent" specifies a parent menu item (submenu) that this item belongs to;
"Application" holds a full path to an application associated with the context menu item;
"Parameters" specifies application parameters, for example: %1;
"Caption" is a display name of this context menu item;
"Hint" holds a descriptive text displayed in status bar of Windows Explorer;
"IconFile" points to an executable (binary) or an image file that holds the menu item icon (for example, .EXE, .DLL, .ICO or .PNG files);
"IconIndex" is 0 for an image file or specifies an icon index for a binary file;
"Checked" can be set to 0 to hide this menu item and its child items (if any);
"FileType" specifies a Registry key name that identifies the file type this menu item is displayed for.


CustomOptions
Code:
Enabled=<False|True>
FirstLevelDefault=<False|True>
BackgroundFix=<False|True>
TextIndent=<number, pixel>
TextFontFace=<fontname>
TextFontSize=<number>
NormalTextColor=<colorId>
SelectedTextColor=<colorId>
NormalBackColor=<colorId>
SelectedBackColor=<colorId>
NormalIconBackColor=<colorId>
SelectedIconBackColor=<colorId>

"Enabled" can be set to False if FEShlExt.dll should ignore these settings;
if "FirstLevelDefault" is True, the look & feel settings won't be applied to menu items displayed in the top level context menu;
"BackgroundFix" specifies that a workaround fix should be applied for displaying context menu items for the "File folder background" file type; it's recommended to set it to True;
"TextIndent" specifies in pixels an indent of caption text from the left;
"TextFontFace" specifies a menu item font; if its value is empty, the default font is used;
"TextFontSize" specifies a menu item font size; if it's empty, you know what;
Color-properties are used to customize colors of particular menu item parts; the colorId value has $BBGGRR format, while $20000000 means default color.

FE.ahk
Code:
FE_load(autobuild=false)
{
   Global FE_Autobuild

   FE_Autobuild := autobuild
   Run, regsvr32 "%A_ScriptDir%\FEShlExt.dll" /s
}

FE_unload()
{
   Run, regsvr32 "%A_ScriptDir%\FEShlExt.dll" /u /s
}

FE_addItem(id,parent,submenu,application,parameters,caption,hint,iconfile,iconindex,checked,filetype)
{
   Global

   itemCnt++

   item[%id%] := itemCnt
   item[%itemCnt%]ID := id

   if parent is not integer
   {
      parent := item[%parent%]
   }

   item[%itemCnt%]Parent := Parent
   item[%itemCnt%]Application := Application
   item[%itemCnt%]Parameters := Parameters
   item[%itemCnt%]Caption := Caption
   item[%itemCnt%]Hint := Hint
   item[%itemCnt%]IconFile := IconFile
   item[%itemCnt%]IconIndex := IconIndex
   item[%itemCnt%]Checked := Checked
   item[%itemCnt%]FileType := FileType
   item[%itemCnt%]SubMenu := SubMenu

   if FE_Autobuild
      FE_buildMenu()

   return % itemCnt
}

FE_deleteItem(id)
{
   Global

   no := item[%id%]
   if no !=
   {
      Loop, % itemCnt - no
      {
         i := A_Index + no
         j := i-1

         FE_int_copyItem(i,j)
      }

      itemCnt--
   }

   if FE_Autobuild
      FE_buildMenu()
}

FE_int_copyItem(from,to)
{
   Global
   local tList

   tList = ID,Parent,Application,Caption,Hint,IconFile,IconIndex,Checked,FileType,SubMenu
   Loop, parse, tList, `,
   {
      it := item[%from%]%A_LoopField%
      item[%to%]%A_LoopField% := it
   }
}

FE_addCustomSetting(option,value)
{
   Global

   csCnt++

   cs[%csCnt%]Option := option
   cs[%csCnt%]Value := value

   if FE_Autobuild
      FE_buildMenu()
}

FE_addDebugSetting(option,value)
{
   Global

   dsCnt++

   ds[%dsCnt%]Option := option
   ds[%dsCnt%]Value := value

   if FE_Autobuild
      FE_buildMenu()
}

FE_buildMenu()
{
   Global
   local iniFile, i, section, tList, tOption, tValue

   iniFile = %A_ScriptDir%\FastExplorer.ini
   FileDelete, %iniFile%

   section = Dynamic Items
   Loop, %itemCnt%
   {
      i := A_Index
      tList = Parent,Application,Caption,Hint,IconFile,IconIndex,Checked,FileType,SubMenu
      Loop, parse, tList, `,
      {
         it := item[%i%]%A_LoopField%

         IniWrite, %it%, %iniFile%, %section%, %A_LoopField%%i%
      }
   }
   IniWrite, %itemCnt%, %iniFile%, %section%, Count
   section = Custom-drawn Menu Properties
   Loop, %csCnt%
   {
      i := A_Index

      tOption := cs[%i%]Option
      tValue := cs[%i%]Value

      IniWrite, %tValue%, %iniFile%, %section%, %tOption%
   }

   section = Debug Options
   Loop, %dsCnt%
   {
      i := A_Index

      tOption := ds[%i%]Option
      tValue := ds[%i%]Value

      IniWrite, %tValue%, %iniFile%, %section%, %tOption%
   }

}


Inspired by this thread


Report this post
Top
 Profile  
Reply with quote  
 Post subject: a few questions
PostPosted: March 4th, 2010, 1:58 am 
I just wanted to say thanks for this. It looks awesome... if I can get it to work. :oops:

For those of us who aren't familiar with where to add items and such could you possibly give a few examples? Like if I wanted to add an entry to the desktop context menu or perhaps the .ahk file type context menu? or EVERY context menu?

I realize I'm probably going to get at least one comment about if I don't know... don't touch, as playing around in the registry can cause issues but in general I have had good experiences with the forum and most people are very friendly and helpful. I'm someone will carry on that trend.

Thanks again in advance.

P.S.-even in the example script I get no context menu changes. I am running xp sp3.


Report this post
Top
  
Reply with quote  
 Post subject:
PostPosted: March 9th, 2010, 9:36 pm 
Doesn't do anything for me either :(

XP SP3 - AHK_Lw 1.0.48.5

Maybe needs some kind of system refresh message?


Report this post
Top
  
Reply with quote  
 Post subject:
PostPosted: March 9th, 2010, 10:10 pm 
Hmm, because of all the [] in the code, I assumed it was for AHK_L, but it wasn't. Simply setting FE_load(false) and uncommenting FE_buildMenu() did the trick.

Very nice stuff.

8)


Report this post
Top
  
Reply with quote  
PostPosted: February 27th, 2011, 8:04 am 
Offline

Joined: December 2nd, 2010, 12:25 am
Posts: 73
Location: Ontario, Canada
Quote:
You'll need to place the FEShlExt.dll in the script-directory (download here, feredist.zip)
Documentation


Link is Dead does anyone have FEShlExt.dll?

Thanks


Report this post
Top
 Profile  
Reply with quote  
 Post subject:
PostPosted: February 27th, 2011, 9:20 am 
You can get the last (?) version from Softpedia.

HTH


Report this post
Top
  
Reply with quote  
 Post subject:
PostPosted: February 27th, 2011, 11:54 am 
Offline

Joined: October 13th, 2009, 10:09 pm
Posts: 1389
I could've used this sometime earlier, now I wrote my own :D
It's a bit different in places, it uses the registry instead of an ini file, and it directly sends messages to my program instead of running programs, so I think it's not usable for a general audience. However, if you want to check out the source and modify it to your needs, feel free to get it on the 7plus SVN.


Report this post
Top
 Profile  
Reply with quote  
 Post subject:
PostPosted: February 28th, 2011, 9:47 am 
Offline

Joined: December 2nd, 2010, 12:25 am
Posts: 73
Location: Ontario, Canada
n-l-i-d wrote:
You can get the last (?) version from Softpedia.

HTH


Thanks a bunch. I searched the net for some time and was unable to locate it.


Report this post
Top
 Profile  
Reply with quote  
Display posts from previous:  Sort by  
Post new topic Reply to topic  [ 8 posts ] 

All times are UTC [ DST ]


Who is online

Users browsing this forum: Apollo, Bing [Bot], JamixZol, rbrtryn, Stigg, Yahoo [Bot] and 26 guests


You can post new topics in this forum
You can reply to topics in this forum
You cannot edit your posts in this forum
You cannot delete your posts in this forum
You cannot post attachments in this forum

Search for:
Powered by phpBB® Forum Software © phpBB Group