Show current filename on title bar

English support forum

Moderators: Hacker, Stefan2, white

Post Reply
Galizza
Junior Member
Junior Member
Posts: 16
Joined: 2018-09-07, 05:21 UTC

Show current filename on title bar

Post by *Galizza »

 
Hi, i'm using an autohotkey script to show current filename on title bar using
PostMessage 1075, 2017, , , ahk_class TTOTAL_CMD = cm_CopyNamesToClip
this works perfectly when no files are selected, but when multiple files are
selected fails. Is it possibe to show current filename without path on title bar
when multiple files are selected ? Thanks :!:
 
Edited
 
Last edited by Galizza on 2022-05-14, 10:45 UTC, edited 5 times in total.
User avatar
Stefan2
Power Member
Power Member
Posts: 3559
Joined: 2007-09-13, 22:20 UTC
Location: Europa

Re: Show current filename on title bar

Post by *Stefan2 »

- "current filename on title bar"
- copy to clipboard only current filename without path

different things?



See text file "TOTALCMD.inc":
cm_CopyNamesToClip=2017;Copy one or many filenames to clipboard
cm_CopyFullNamesToClip=2018;Copy one or many filenames to clipboard with full path



 
User avatar
Horst.Epp
Power Member
Power Member
Posts: 5004
Joined: 2003-02-06, 17:36 UTC
Location: Germany

Re: Show current filename on title bar

Post by *Horst.Epp »

I prefer to only show the current folder in the Title bar.
I makes no sense to update the title for every change of the cursor in the file list.

Code: Select all

#NoEnv ; Recommended for performance and compatibility with future AutoHotkey releases. 
; #Warn ; Enable warnings to assist with detecting common errors. 
SendMode Input ; Recommended for new scripts due to its superior speed and reliability. 
SetWorkingDir %A_ScriptDir% ; Ensures a consistent starting directory. 

#Persistent 

SetTimer timerRoutine, 250 
Return 

#IfWinActive ; turns off ifWinActive 

timerRoutine: 
   if WinActive( "ahk_class TTOTAL_CMD" ) 
      { 
      SendMessage, 1074, 17 
      WinGetText, PathInTC, ahk_id %ErrorLevel% 
      StringTrimRight, PathInTC, PathInTC, 3 
      pathToDisplay = %PathInTC%                
      WinGetTitle currentTitle 
      if ( currentTitle != pathToDisplay ) 
         WinSetTitle %pathToDisplay% 
      } 
Return
Windows 11 Home x64 Version 21H2 (OS Build 22000.778)
TC 10.50RC4 x64 / x86
Everything 1.5.0.1315a (x64)
Galizza
Junior Member
Junior Member
Posts: 16
Joined: 2018-09-07, 05:21 UTC

Re: Show current filename on title bar

Post by *Galizza »

2Horst.Epp & Stefan2 thanks :!:

I was able to solve it using %N & Autohotkey
Post Reply