WinBatch Tech Support Home

Database Search

If you can't find the information using the categories below, post a question over in our WinBatch Tech Support Forum.

TechHome

FileMenu

Can't find the information you are looking for here? Then leave a message over on our WinBatch Tech Support Forum.

Clipboard Tricks

Keywords: 

Question:

What happens in the background during WinBatch setup that creates "Clipboard Tricks" to my Windows Explorer context sensitive menu? I like the new menu options and would like to write a program that installs context options onto other machines.

Answer:

It's kinda tricky.

Basically there is FileMenu.DLL which runs the stuff. A couple of entries into the registry tell Windows Explorer about FileMenu.dll

To make your own Add-On you would need Microsoft VC++ or equivalent and a bunch of work.

However a quick and dirty workaround is to add WinBatch scripts to the c:\Windows\SendTo folder, then they will magically show up under the SendTo menu item on all context menus.


Question:

We've come to rely a lot on Winbatch's Clipboard Tricks installation in the FIleMenus context menu. We're wondering if we can create a hotkey for the Path and Filename(s) function. We already have a hotkey utility that we use to create other customized hotkeys. Is there a way we can select the file in Windows Explorer and then run FileMenu.DLL using our hotkey utility and then have the selected file's Path and Filename pasted to the clipboard? If so, please provide an example.

Answer:

The FileMenu tool included with WinBatch cannot be distributed. It is only installed on system where WinBatch is licensed and installed. However you could feasily write a WinBatch script that determine which file is selected inthe Windows Explorer then Gets it full file path. Your script might look something like this:
;***************************************************************************
;** 
;**           Clipboard Tricks - Get Full Filename. 
;** 
;** Purpose:  Get Full Filename of a File Selected in Windows Explorer
;** Inputs: 
;** Outputs: 
;** Revisions:
;**           1.0 initial release 
;** Reference: 
;**       REQUIRES WinBatch 2013A or newer 
;**
;** Developer: Deana Falk 2014.02.20
;*************************************************************************** 

; Get a list of all explorer windows
explorers = IntControl(31,1,0,0,0)
; Loop thru each window looking for a window with a selected item
count = ItemCount( explorers, @tab )
If count == 0
   Pause('Notice','No Explorer windows open')
Else   
   For x = 1 to Count
      ; Get Window Handle from ID
      winid = ItemExtract( x, explorers, @tab )
      hwnd = DllHwnd( winid )
      ;Pause("Window handle of Explorer",cWndInfo(hwnd,0))
      ; Using the Windows Shell loop thru all the Windows until you find a matching handle
      objShell = CreateObject("Shell.Application")
      objInstances = objShell.windows
      If objInstances.Count != 0 ; make sure we have instances open.
         ForEach objWindow In objInstances
            If objWindow.hwnd == hwnd
               ; Get the selected item
               Colselected = objWindow.document.SelectedItems
               selcount = Colselected.Count
               ; Check for a selected item
               If selcount == 0
                  Pause('Notice','No File Selected in Explorer Window')
               Else
                  ForEach objSel In Colselected
                     daPath =  objSel.Path
                     Pause('Selected Item placed in Clipboard',daPath)
                     ClipPut(daPath)
                  Next
               Endif
            Endif
         Next
      Else
         Pause('Notice','No Explorer windows open')
      Endif
   Next
Endif
Exit

Article ID:   W14595
Filename:   Clipboard Tricks.txt
File Created: 2014:02:20:14:09:56
Last Updated: 2014:02:20:14:09:56