topbanner_forum
  *

avatar image

Welcome, Guest. Please login or register.
Did you miss your activation email?

Login with username, password and session length
  • Monday March 18, 2024, 9:33 pm
  • Proudly celebrating 15+ years online.
  • Donate now to become a lifetime supporting member of the site and get a non-expiring license key for all of our programs.
  • donate

Last post Author Topic: Open Containing Folder  (Read 34319 times)

SleepingWolf

  • Supporting Member
  • Joined in 2007
  • **
  • Posts: 118
    • View Profile
    • Read more about this member.
    • Donate to Member
Open Containing Folder
« on: October 25, 2008, 01:57 PM »
I have a useful context-menu extension created (with instructions from the web) via a registry key; it says "Open Containing Folder" so that right-clicking a file (or shortcut) and selecting that menu item opens explorer at that folder in the directory structure.

I have often wondered if it would be possible to get similar functionality for program windows - right clicking on the title bar will show an extra menu item: "Locate program" that would open explorer at the containing folder.

Also, by extension, other processes could be listed in a listbox (or better) GUI item and selected to open explorer there (or other file manager of course). I would love to try Skrommelling it (in Autohotkey) but I feel it would almost certainly be beyond me so feel it best to throw the idea out there to your tender mercies!
-------------------------------------------

Question everything, use a fact-checker.
Respect yourself and respect others.
Peace out!

mouser

  • First Author
  • Administrator
  • Joined in 2005
  • *****
  • Posts: 40,896
    • View Profile
    • Mouser's Software Zone on DonationCoder.com
    • Read more about this member.
    • Donate to Member
Re: Open Containing Folder
« Reply #1 on: October 25, 2008, 02:26 PM »
this is one of those great simple ideas.   :up:

Deozaan

  • Charter Member
  • Joined in 2006
  • ***
  • Points: 1
  • Posts: 9,746
    • View Profile
    • Read more about this member.
    • Donate to Member
Re: Open Containing Folder
« Reply #2 on: October 25, 2008, 02:30 PM »
I don't want to sound like a stick in the mud, but if you're right clicking a file (with the exception of a shortcut) wouldn't you already be exploring that directory?

mouser

  • First Author
  • Administrator
  • Joined in 2005
  • *****
  • Posts: 40,896
    • View Profile
    • Mouser's Software Zone on DonationCoder.com
    • Read more about this member.
    • Donate to Member
Re: Open Containing Folder
« Reply #3 on: October 25, 2008, 02:40 PM »
what he means is, let's say you have a program running on your screen, like notepad or maybe some program started at windows boot time.  so now he's saying it would be nice to have an easy way to jump to that program's directory on disk.

i guess there are process explorers that will do this -- just seems like one of those ideas that should be built into windows so that you could click on a window of a running program somewhere and say "take me to this program's home directory".

SleepingWolf

  • Supporting Member
  • Joined in 2007
  • **
  • Posts: 118
    • View Profile
    • Read more about this member.
    • Donate to Member
Re: Open Containing Folder
« Reply #4 on: October 25, 2008, 02:57 PM »
You're both right. The existing Context-Menu item is most useful for shortcuts.

Process explorers (prcView mainly here)  generally give you option to copy path to clipboard ---> perhaps a clip-board monitor could open copied paths automatically.
-------------------------------------------

Question everything, use a fact-checker.
Respect yourself and respect others.
Peace out!

cmpm

  • Charter Member
  • Joined in 2006
  • ***
  • default avatar
  • Posts: 2,026
    • View Profile
    • Donate to Member
Re: Open Containing Folder
« Reply #5 on: October 26, 2008, 01:26 PM »
one of these may do it

http://search.techre...ch/window+title.html

some of these hits seem to suggest they can

SleepingWolf

  • Supporting Member
  • Joined in 2007
  • **
  • Posts: 118
    • View Profile
    • Read more about this member.
    • Donate to Member
Re: Open Containing Folder
« Reply #6 on: October 28, 2008, 04:00 PM »
one of these may do it

http://search.techrepubli.../search/window+title.html

some of these hits seem to suggest they can


Thanks cmpm, I need to read them in detail, but the ones I've checked either need .NET or seem downright un-downloadable as the download links are well hidden.

I'd prefer an open-source Autohotkey solution; wouldn't you?
-------------------------------------------

Question everything, use a fact-checker.
Respect yourself and respect others.
Peace out!

cmpm

  • Charter Member
  • Joined in 2006
  • ***
  • default avatar
  • Posts: 2,026
    • View Profile
    • Donate to Member
Re: Open Containing Folder
« Reply #7 on: October 29, 2008, 07:31 AM »
Yes I would prefer that too.
That was all I could find with some various search strings.

If the icon in the title bar was actually an icon shortcut that would help.

There should be a way to add the command to to the right click title bar menu. Or make it an address bar. Then Skrommels 'Captain' could be used to paste the text into 'run'.

https://www.donation...l/index.html#Captain

---

this is close but still dealing with the shortcuts

http://www.megaleech...t/taxonomy/term/1761
« Last Edit: October 29, 2008, 09:22 AM by cmpm »

AndyM

  • Charter Member
  • Joined in 2006
  • ***
  • Posts: 616
    • View Profile
    • Donate to Member
Re: Open Containing Folder
« Reply #8 on: October 29, 2008, 04:51 PM »
Macro Express might do what you want. 
www.macros.com

SleepingWolf

  • Supporting Member
  • Joined in 2007
  • **
  • Posts: 118
    • View Profile
    • Read more about this member.
    • Donate to Member
Re: Open Containing Folder
« Reply #9 on: October 30, 2008, 02:20 PM »
this is one of those great simple ideas.

Yes, Mouser, that's why I thinkthat someone will have solved it before.


Macro Express might do what you want.

Thanks, AndyM. Unfortunately, Macro express seems to be an expensive equivalent of AutoHotkey. Sure it may be able to do it, but then so might AHK and so might Macro Scheduler that I was trying before -so why pay for the possibility of a solution when it may be AHK-solvable with the advantage of using less tools with less of a syntax learning curve? Unless you have experience of a greater (and more relevant) command set...?

No, I think AHK COULD be made to do the trick. I'm also sure that it will take me a while and that maybe someone here would relish the challenge -and may even have solved a similar problem before -hence my reasons for posting.
-------------------------------------------

Question everything, use a fact-checker.
Respect yourself and respect others.
Peace out!

cmpm

  • Charter Member
  • Joined in 2006
  • ***
  • default avatar
  • Posts: 2,026
    • View Profile
    • Donate to Member
Re: Open Containing Folder
« Reply #10 on: October 30, 2008, 08:35 PM »
Yeah, I think it would be a great convenience.
But not worth a hefty price for a small function.

I found this for $50.
It does everything but what this thread is about.

http://www.actualtools.com/

I found programs that put the time or calendar or both in it.
Also found one that will scroll a text file across the title bar for entertainment.
Found some that will scroll news or stocks.

But no target or address function without copy paste.

AndyM

  • Charter Member
  • Joined in 2006
  • ***
  • Posts: 616
    • View Profile
    • Donate to Member
Re: Open Containing Folder
« Reply #11 on: October 30, 2008, 10:29 PM »
Macro Express might do what you want. 
www.macros.com
Oh no!  This reply was meant for another thread (something about clicking on buttons or controls).  Sorry! :-[

AndyM

  • Charter Member
  • Joined in 2006
  • ***
  • Posts: 616
    • View Profile
    • Donate to Member
Re: Open Containing Folder
« Reply #12 on: October 30, 2008, 10:42 PM »
But I atone.  Here's an ahk script from Skrommel that displays the .exe file and path next to the mouse for whatever window the mouse is hovering over.

You could use the GetModuleFileNameEx(p_pid) subroutine to get the path and open the folder, and put it in an .ahk or .exe file to use as a context menu choice.
;WinProcPath.ahk
; Show the filename of the windows below the mouse
;Skrommel @ 2007

#SingleInstance,Force
#NoEnv

Loop
{
  MouseGetPos,x,y,winid,ctrlid
  WinGet,pid,Pid,ahk_id %winid%
  path:=GetModuleFileNameEx(pid)
  ToolTip,%path%
  Sleep,100
}


GetModuleFileNameEx(p_pid) ;by shimanov at www.autohotkey
{
   If A_OSVersion in WIN_95,WIN_98,WIN_ME
   {
     WinGet,name,ProcessName,ahk_id %p_pid%
     Return,name
   }
   h_process:=DllCall("OpenProcess","uint",0x10|0x400,"int",false,"uint",p_pid) ;  PROCESS_VM_READ=0x0010  PROCESS_QUERY_INFORMATION=0x0400
   If (ErrorLevel or h_process=0)
      Return
   name_size=255
   VarSetCapacity(name,name_size)
   result:=DllCall("psapi.dll\GetModuleFileNameExA","uint",h_process,"uint",0,"str",name,"uint",name_size)
   DllCall("CloseHandle",h_process)
   Return,name
}
« Last Edit: October 30, 2008, 10:47 PM by AndyM »

cmpm

  • Charter Member
  • Joined in 2006
  • ***
  • default avatar
  • Posts: 2,026
    • View Profile
    • Donate to Member
Re: Open Containing Folder
« Reply #13 on: October 31, 2008, 09:24 AM »
This script has the target following the mouse in a box.
I don't know how to use it except for just showing the directory.
No way to drop in run or open the folder.

The script is missing something or I am.

AndyM

  • Charter Member
  • Joined in 2006
  • ***
  • Posts: 616
    • View Profile
    • Donate to Member
Re: Open Containing Folder
« Reply #14 on: October 31, 2008, 08:38 PM »
This script has the target following the mouse in a box.

And isn't the folder which contains that target the one you want to open?

The script has a subroutine that identifies the executable associated with that window.  One could build on that to write a script to do what you want. 

Writing the subroutine would have been way beyond me, but if I spent the time, I think I could use it to write an ahk script that would do what you want.  It would be a stretch but  if I wanted the utility bad enough I would spend the time and enjoy it as a learning experience.

But I have too much going on at the moment to get sidetracked, so either someone else can do it (Skrommel?), or you could have your own learning experience. ;D
« Last Edit: October 31, 2008, 08:46 PM by AndyM »

cmpm

  • Charter Member
  • Joined in 2006
  • ***
  • default avatar
  • Posts: 2,026
    • View Profile
    • Donate to Member
Re: Open Containing Folder
« Reply #15 on: October 31, 2008, 09:53 PM »
Thanks AndyM, it is interesting and got me into AHK.

Yes that does show the target of whatever you are on.
Like you, other things to do as well.
But worth the time for the learning.

A program by lanux128 'CopyCap' does what Captain does also.

https://www.donation...14275.0;attach=31748

Both good programs and good folks.

cmpm

  • Charter Member
  • Joined in 2006
  • ***
  • default avatar
  • Posts: 2,026
    • View Profile
    • Donate to Member
Re: Open Containing Folder
« Reply #16 on: November 01, 2008, 08:41 AM »
Found one.
Uses .Net 3.5 though and it does work.
It's called 'Titlebar'. Free.

http://www.r-nsoft.com/download.html

Version Tracker had it on their site


lanux128

  • Global Moderator
  • Joined in 2005
  • *****
  • Posts: 6,277
    • View Profile
    • Donate to Member
Re: Open Containing Folder
« Reply #17 on: November 01, 2008, 09:26 AM »
actually this feature can be included as part of CopyCap. the code by AndyM/Shimanov can be inserted easily into my script, which i have done so. please try out and let me know. :)

CopyCap+LocateFolder.png

Note: this script might require 'psapi.dll'.

ewemoa

  • Honorary Member
  • Joined in 2008
  • **
  • Posts: 2,922
    • View Profile
    • Donate to Member
Re: Open Containing Folder
« Reply #18 on: November 01, 2008, 09:43 AM »
Seems to work nicely here :)

(I changed MButton to XButton1 as I was already using MButton for something else [1].  In my tired state, I didn't think of any good approaches to work around the issue of multiple programs using the same mouse button -- any ideas on that front?  Is it easy to detect whether something else is already using a particular mouse button for something in AHK (or anything else for that matter)? [2])


[1] Either I configured VirtuaWin to do this or it does it by default -- don't remember...

[2] Ah, I guess Captain has an option to change the hotkey.
« Last Edit: November 01, 2008, 09:48 AM by ewemoa »

cmpm

  • Charter Member
  • Joined in 2006
  • ***
  • default avatar
  • Posts: 2,026
    • View Profile
    • Donate to Member
Re: Open Containing Folder
« Reply #19 on: November 01, 2008, 09:44 AM »
It works good lanux.

If there is a program running with the middle click button taken it won't though.
Such as ipoint.

But that function in ipoint could be changed to a different mouse click i suppose. It's the default setup for ipoint that has the middle click tile open windows.

lanux128

  • Global Moderator
  • Joined in 2005
  • *****
  • Posts: 6,277
    • View Profile
    • Donate to Member
Re: Open Containing Folder
« Reply #20 on: November 01, 2008, 11:21 AM »
i'm glad to see that it works. as for the hotkey, the script will show the menu only if the middle-click is on the titlebar elsewhere middle-click should work as normal. :)

@ewemoa: hotkey detection is a bit tricky with AHK but it could made configurable instead.

@cmpm: i'm not familiar with ipoint but does the function to tile open windows requires middle-click on the caption/titlebar?

Note: just to clarify things, i've tested the script with the latest version - 1.0.47.06 so if it doesn't work, please provide more details such as AHK version, Windows version and the conflicting programs. :)

cmpm

  • Charter Member
  • Joined in 2006
  • ***
  • default avatar
  • Posts: 2,026
    • View Profile
    • Donate to Member
Re: Open Containing Folder
« Reply #21 on: November 01, 2008, 11:47 AM »
No, just middle click anywhere and ipoint will tile the windows, including the title bar.

ipoint is microsoft's software for their mice
you knew that probably

Anyway ipoint disables CopyCap and Captain as far as using the middle click on the title bar. Which can easily be worked around by changing one of the programs function for the middle click.

So it's not a big deal. Thought I would mention it in case it wasn't working for someone.

lanux128

  • Global Moderator
  • Joined in 2005
  • *****
  • Posts: 6,277
    • View Profile
    • Donate to Member
Re: Open Containing Folder
« Reply #22 on: November 01, 2008, 12:03 PM »
Anyway ipoint disables CopyCap and Captain as far as using the middle click on the title bar. Which can easily be worked around by changing one of the programs function for the middle click.

okay, now i understand. the iPoint program has a higher priority in intercepting the mouse-clicks than AHK. so if you're in mood for some testing, you can place the following line in the AHK script and see if that solves the problem.

#InstallMouseHook


cmpm

  • Charter Member
  • Joined in 2006
  • ***
  • default avatar
  • Posts: 2,026
    • View Profile
    • Donate to Member
Re: Open Containing Folder
« Reply #23 on: November 01, 2008, 12:15 PM »
ehh, no go
i put it after
'#NoTrayIcon'
is their a different place for it?

lanux128

  • Global Moderator
  • Joined in 2005
  • *****
  • Posts: 6,277
    • View Profile
    • Donate to Member
Re: Open Containing Folder
« Reply #24 on: November 01, 2008, 12:24 PM »
well it seems that iPoint retains the upper-hand but at least we tried. :)