How to? 2 GUI questions and return HWND using TakeCommandIPC

Mar 9, 2012
22
0
hi

i have been trying to figure out:

1- is there a global hot key to restore tcmd from tray?
2- is there a shortcut key to switch between current tab and the command input? note: not using ctrl-tab and arrowkeys to select the command input window!

if there is no solution then 2 it can be done using a plugin.

Can anyone provide code sample using TakeCommandIPC to get handle of tcmd and i can use

Code:
FoundWindow = FindWindowEx(tcmdHandle, 0, 'Scintilla ', nil);
 
PostMessage( FoundWindow , WM_NEXTDLGCTL, 0, 0L) ;


to set focus

with my regards and thanks
ehab

Take Command v13.03.48
 
Mar 9, 2012
22
0
i spent couple of hours finding answers.

for those interested:

1- use Autohotkey
Code:
^!n::Run TCMD
^!c::Run "C:\Program Files\JPSoft\TCMD13\tcmd.exe"

2- use the sdk sample and in
Code:
DLLExports INT WINAPI key( LPKEYINFO ki )
{
    switch ( ki->nKey )
        {
            case CTL_HOME : // change to your own binding
                AttachThreadInput(GetWindowThreadProcessId(GetForegroundWindow(),NULL),    GetCurrentThreadId(),TRUE);
                HWND inWindowHandle = FindWindowEx(GetForegroundWindow(),NULL,_T("XTPDockingPaneTabbedContainer"), NULL);
                HWND top_child = GetWindow(inWindowHandle, GW_CHILD);
                SetForegroundWindow(top_child);
                SetFocus(top_child);
                AttachThreadInput(GetWindowThreadProcessId(GetForegroundWindow(),NULL),GetCurrentThreadId(),FALSE);
                ki->nKey = 0;
              break;
        }
    return 0;
}

there is always another way, i hope this helps those need to switch to Command Input quickly and maybe the developers will add such a feature in future.

regards
ehab
 

rconn

Administrator
Staff member
May 14, 2008
12,345
150
1- is there a global hot key to restore tcmd from tray?
2- is there a shortcut key to switch between current tab and the command input? note: not using ctrl-tab and arrowkeys to select the command input window!

#1 - No.

#2 - There is no shortcut key to take you straight to the command input window, though Alt-F6 will toggle between command input, folder view, list view, and tab window. Nobody's ever requested it, and since you would have had to either use the mouse or the ctrl-tab dialog to switch away from the command input window it didn't seem unreasonable to expect you to switch back the same way.)

Can anyone provide code sample using TakeCommandIPC to get handle of tcmd and i can use

Code:
FoundWindow = FindWindowEx(tcmdHandle, 0, 'Scintilla ', nil);
 
PostMessage( FoundWindow , WM_NEXTDLGCTL, 0, 0L) ;

to set focus

This is how it's called in TCC:

Code:
// returns the TCMD window handle if we're running in a TCMD tab window
HWND QueryParentWindow( void )
{
  TCHAR szBuffer[128];
 
  szBuffer[0] = _TEXT('\0');
if ( TakeCommandIPC( L"hwnd", szBuffer ) != -1 ) {
#if _WIN == 64
  return (HWND)_wtoi64( szBuffer );
#else
  return (HWND)_wtoi( szBuffer );
#endif
}
}
 
Mar 9, 2012
22
0
Thanks Rex

i will add my request for global hot key and key to switch between current tab and command input.

appreciated the example.

Alt-F6 should honor hidden controls.
 
Similar threads
Thread starter Title Forum Replies Date
U Can not get/start Take Command gui Support 1
Alpengreis [TCMD v25.00.24] Small space problem with the DE translation in Prefs-GUI Support 1
Paul Hsieh Take Command does not launch GUI at all for me anymore. Support 3
M Starting Windows GUI programs from the command line... Support 10
Y Wait for GUI app to finish Support 3
MBaas GUI-Tool for "File/Open" or tree (for use in batch-files) Support 3
C start/tab of a GUI program hangs TCMD Support 6
vefatica Questions about aliases. Support 1
vefatica Long file names - a few questions Support 2
C DIFFER questions.... Support 66
Mezlo menu batch file questions Support 25
S FORUM questions Support 2
C z_newmove.btm questions Support 6
S Documentation Questions re: ON Support 13
C TPIPE questions.... Support 5
mikea Questions re: Internal ZIP command Support 5
S PDIR and @LABEL questions Support 4
S Questions about new build announcements Support 0
C tpipe questions Support 5
aedthuio Some questions Support 10
C @shfolder questions Support 7
gschizas Licensing questions Support 3
S Documentation File reading questions Support 4
M Just some questions about TCC "hanging" and PIDs... Support 4
S Questions about @winapi/@capi Support 8
M Questions about @Assoc and @FType... Support 18
M A questions about @Files "+d" Support 35
mikea TCC v12 startup questions Support 15
S ON and REBOOT questions Support 3
S xxxMONITOR command questions Support 1
mikea BDEBUGGER/IDE questions Support 16
P Installer questions/gripes Support 2
C General questions Support 9
vefatica Vista questions Support 4
H IDE v10 questions Support 2
S V10 questions Support 8
C Few questions and suggestions Support 2
nikbackm IFTP questions Support 3
vefatica Is EOF an implied RETURN? Support 3
Joe Caverly Why does TCCRT return VIEW as an internal command? Support 6
D Can the argument to RETURN be a function expansion? Support 3
A Inconsistent return code for TCC scripts Support 4
J How to? Speedup of gosub/return Support 8
vefatica Can a subroutine return a 64-bit integer? Support 4
S Return of FTP copy bug in 16.02.48 Support 12
M How to? Get the return code from an external program... Support 8
A WAD function return values with parentheses prevent evaluation of additional functions Support 31
Stefano Piccardi How to? return values from @python Support 2
A How to? return to completion mask after auto-completion Support 14
M echo %@index[1234,.,-1] return -21 in new version Support 3

Similar threads