WM_COPYDATA "CD" in right Panel
Moderators: petermad, Stefan2, white, Hacker
WM_COPYDATA "CD" in right Panel
When i send WM_COPYDATA "CD" command it every open path in left panel.
How to open in right Panel?
How to open in right Panel?
Hurdet,
String that you send with WM_COPYDATA as lpData has following format:
Here [] means optional part. If "S" is specified, left panel means source and right means target. If "T" is specified, dirs are opened in new tabs. Finally, "\xEF\xBB\xBF" part means that your path are in UTF-8 encoding. Don't forget that cbData value must contain string length including terminating null character.
Good luck!right_path
String that you send with WM_COPYDATA as lpData has following format:
Code: Select all
#EF#BB#BF ['<left_path>'] #0D #EF#BB#BF ['<right_path>'] #00 ['S'] ['T'] #00
Code: Select all
["\xEF\xBB\xBF"] ["<left_path>"] "\x0D" ["\xEF\xBB\xBF"] ["<right_path>"] "\x00" ["S"] ["T"] "\x00"
Good luck!right_path
Last edited by MVV on 2013-05-24, 09:31 UTC, edited 2 times in total.
Of course it doesn't work, "CD" shouldn't be in this string.
Try this:
Try this:
Code: Select all
char data[]="\rC:\\Windows\0";
COPYDATASTRUCT cds;
cds.dwData='DC';
cds.lpData=data;
cds.cbData=sizeof(data);
SendMessage(hTcWnd, WM_COPYDATA, 0, (LPARAM)&cds);
You know, <left_path> and <right_path> are just placeholders, you should replace them with paths (or empty strings). Try just "\rC:\\Windows\0" like in my example. It should change right panel's path to C:\Windows. Then simply replace C:\Windows with your path.
As I wrote (check string format), you must specify left and right paths separated by '\r' character, and you may omit any path if you don't need to change it.
As I wrote (check string format), you must specify left and right paths separated by '\r' character, and you may omit any path if you don't need to change it.
-
- Junior Member
- Posts: 33
- Joined: 2007-07-09, 21:03 UTC
Sorry for kicking this up, but I managed to get this working in my application environment with a lot of help.
code:
The above code opens in left panel: 'd:\test' and in right panel 'c:\windows'. Using '\r' does not work, I have to send it as a [13] character code.
Is there someone who could give an example on how to
- put the focus on the left panel
- open a .tab file located in "d:\tabs\test.tab" (if this is possible)
code:
Code: Select all
str data="d:\test\0[13]C:\Windows\0"
COPYDATASTRUCT cds;
cds.dwData='D'<<8|'C';
cds.lpData=data;
cds.cbData=data.len+2;
SendMessage(w WM_COPYDATA 0 &cds)
Is there someone who could give an example on how to
- put the focus on the left panel
- open a .tab file located in "d:\tabs\test.tab" (if this is possible)
- Balderstrom
- Power Member
- Posts: 2148
- Joined: 2005-10-11, 10:10 UTC
@dragonetti
Please refer to this thread: New WM_COPYData Examples
Syntax and explanations for AHK, AutoIT -- which make it fairly easy once setup to pass various commands directly to TC.
Please refer to this thread: New WM_COPYData Examples
Syntax and explanations for AHK, AutoIT -- which make it fairly easy once setup to pass various commands directly to TC.
-
- Junior Member
- Posts: 33
- Joined: 2007-07-09, 21:03 UTC
Thank you for the reply, I already tried to find the answer in that thread.
Because I couldn't formulate a correct syntax from that thread, I decided to up this thread (and because the syntax structure used in this thread was/is very similar to the syntax I use in my environment).
I will ask again in that example thread if my attempts keep failing.
Thank you.
Because I couldn't formulate a correct syntax from that thread, I decided to up this thread (and because the syntax structure used in this thread was/is very similar to the syntax I use in my environment).
I will ask again in that example thread if my attempts keep failing.
Thank you.
- Balderstrom
- Power Member
- Posts: 2148
- Joined: 2005-10-11, 10:10 UTC
You could do this, with AHK at least:
If you have multiple instances of TC running then you will want to differentiate between them, and get the ID instead.
e.g.
where, this Regex "^[^\[]+" will match a TC window that doesn't begin with a bracket: '[2] Total Commander'
Thus will match the first instance of TC.
Code: Select all
SendMessage, 0x433, 4002, 0x0,, ahk_class TTOTAL_CMD
e.g.
Code: Select all
#SingleInstance, Force
#Warn
#NoEnv
SetTitleMatchMode, Regex
wID:=WinExist("^[^\[]+ ahk_class TTOTAL_CMD")
SendMessage, 0x433, 4002, 0x0,, ahk_id %wID%
Thus will match the first instance of TC.
dragonetti,
Which environment/language do you use?
Balderstrom,
I think it is not correct to find a handle for TC window w/o brackets in its title. You may have multiple instances and one with brackets may be active, and it is logical to change dir in it but not in inactive/minimzied first instance.
Which environment/language do you use?
Balderstrom,
I think it is not correct to find a handle for TC window w/o brackets in its title. You may have multiple instances and one with brackets may be active, and it is logical to change dir in it but not in inactive/minimzied first instance.
-
- Junior Member
- Posts: 33
- Joined: 2007-07-09, 21:03 UTC
Thank you for the replies.
The environment I work in is 'quick macros' . The program let's you record macros but also let's program macros/mini applications in it's own language.
from the author:
http://www.quickmacros.com/images/ss/debug.png
This code worked perfectly to navigate to the desired directories in their desired target panels (Left / Right)
Sorry that I can't be more specific, but I hope this gives you some clarification.
The environment I work in is 'quick macros' . The program let's you record macros but also let's program macros/mini applications in it's own language.
from the author:
A screenshot that can give you a little impression about the language/syntax:Quick Macros is programmed using C++ (>50%) and QM language (<50%). Most of code is mine, but parts are from various libraries, for example PCRE for regular expressions, scintilla for editor, mailbee for email.
The language is not based on other languages. Something is similar to C++, something to some other languages.
http://www.quickmacros.com/images/ss/debug.png
This code worked perfectly to navigate to the desired directories in their desired target panels (Left / Right)
I have no C++ experience but the quick macros language can make use of it to a certain extent. And in some parts it may look a bit like it.str data="d:\test\0[13]C:\Windows\0"
COPYDATASTRUCT cds;
cds.dwData='D'<<8|'C';
cds.lpData=data;
cds.cbData=data.len+2;
SendMessage(w WM_COPYDATA 0 &cds)
Sorry that I can't be more specific, but I hope this gives you some clarification.