Opentabs & Ahk

English support forum

Moderators: white, Hacker, petermad, Stefan2

Post Reply
User avatar
sas2000
Power Member
Power Member
Posts: 682
Joined: 2003-02-07, 04:32 UTC
Location: Galiza

Opentabs & Ahk

Post by *sas2000 »

  
I am sure i am missing something here :roll: , but how can i use opentabs command in a Ahk script ?. Thanks.
 
User avatar
m^2
Power Member
Power Member
Posts: 1413
Joined: 2006-07-12, 10:02 UTC
Location: Poland
Contact:

Post by *m^2 »

Nope, opentabs doesn't have own number.
It's probably more like CD...
I found something like this... :D

Code: Select all

sendWM_COPYDATA('C'|('D'<<8),strcat(strcat(strcpy(t= malloc(strlen(argv[i+1])+strlen(argv[i+2])+2),argv[i+1]),"\r"),argv[i+2]),CharUpper(argv[i]+2));
Ok, it's not that hard, forget the line above ;)
You send TC WM_COPYDATA.
COPYDATASTRUCT fields meaning:
lpData - string, a path to the directory
dwData - constant number, 'C'|( 'D'<<8 )...this is the critical thing. opentabs has more than 4 characters, so it won't fit in DWORD. Christian?
User avatar
sas2000
Power Member
Power Member
Posts: 682
Joined: 2003-02-07, 04:32 UTC
Location: Galiza

Post by *sas2000 »

 
I've found a workaround, it isn't perfect but it works.

Code: Select all

[User]
menu1=Load tabs 
cmd1=opentabs
param1=C:\TOTALCMD\Tabs.tab
Now we can use it in any Ahk script.

Code: Select all

PostMessage 1075, 701, , , ahk_class TTOTAL_CMD
With the existence of em_xyz commands i thought that i'll never need user defined menus again :wink: .

 
 2Christian

param1 doesn't work if %Commander_Path% is used.
 
User avatar
m^2
Power Member
Power Member
Posts: 1413
Joined: 2006-07-12, 10:02 UTC
Location: Poland
Contact:

Post by *m^2 »

Nah, they are useful. They let you assign icons in the menu to your user commands. (hint by fenixproductions)
User avatar
Sombra
Power Member
Power Member
Posts: 811
Joined: 2005-12-27, 22:23 UTC
Location: Zaragoza, Spain

Post by *Sombra »

2sas2000
param1 doesn't work if %Commander_Path% is used.
Confirmed, you are right, even with double %.

In meanwhile, perhaps you could use:

Code: Select all

[User]
menu1=Load tabs
cmd1=OpenTabs %COMMANDER_PATH%\Tabs.tab
param1=<empty>
I can read English, but... I write like Tarzan. (sorry)
User avatar
ghisler(Author)
Site Admin
Site Admin
Posts: 48021
Joined: 2003-02-04, 09:46 UTC
Location: Switzerland
Contact:

Post by *ghisler(Author) »

2m^2
What you write is correct. The lpData value contains the first path, a line break, then the second path (or empty), terminated by a 0 character. After that, there can be optional parameters:
T means open in new tab
S means that the first parameter is passed to the source side and the second to the target instead of left and right.
Author of Total Commander
https://www.ghisler.com
User avatar
m^2
Power Member
Power Member
Posts: 1413
Joined: 2006-07-12, 10:02 UTC
Location: Poland
Contact:

Post by *m^2 »

Yes, but how about opentabs, loadbar etc?
User avatar
ghisler(Author)
Site Admin
Site Admin
Posts: 48021
Joined: 2003-02-04, 09:46 UTC
Location: Switzerland
Contact:

Post by *ghisler(Author) »

Sorry, currently these cannot be used from the outside except for the described em_xyz command method.
Author of Total Commander
https://www.ghisler.com
User avatar
m^2
Power Member
Power Member
Posts: 1413
Joined: 2006-07-12, 10:02 UTC
Location: Poland
Contact:

Post by *m^2 »

ghisler(Author) wrote:Sorry, currently these cannot be used from the outside except for the described em_xyz command method.
Thank you for the answer. Let me suggest it as a future upgrade.
User avatar
nsp
Power Member
Power Member
Posts: 1803
Joined: 2005-12-04, 08:39 UTC
Location: Lyon (FRANCE)
Contact:

Post by *nsp »

m^2 wrote:
ghisler(Author) wrote:Sorry, currently these cannot be used from the outside except for the described em_xyz command method.
Thank you for the answer. Let me suggest it as a future upgrade.
The only way to have %commander_path% interpreted with opentab is to use a user command :

Code: Select all

[em_Lbar]
button=
cmd=OPENBAR
param=%A

the %A is mandatory !


It works fine from command line and from CopyData message But %P\%N as parameter only works from button...

For info this is a command i use in powerpro, it could be easily modified for ahk.
changBar.powerpro barname

Code: Select all

args barname
local bbThing = binary.from_ascii(?"em_lbar %commander_path%\bars"++barname++".bar")
local TC_CD = 0x4443
local TC_EM = 0x4D45
local TC_CM = 0x4D43
local TCHandle = win.handle("c=TTOTAL_CMD")
bbThing.sendcopydata( TCHandle,TC_EM))
I've asked the 1th of Dec. 20061201 for command consistency but no response at all !
Post Reply