API help for Lister plugin
Moderators: Hacker, petermad, Stefan2, white
-
- Junior Member
- Posts: 39
- Joined: 2003-03-24, 10:47 UTC
API help for Lister plugin
Hi all,
Some keys in a lister plugin has special meaning.
In a normal lister window the user can switch viewing mode by means of the 1,2,3,4 etc keys. Also the N and P keys are used to switch to the next and previous files.
I want my lister plugin to handle all keys but at the moment I'm not getting any WM_KEYDOWN messages on those special tcmd keys. Is there any way to tell tcmd to pass on all windows messages?
.Henrik
Some keys in a lister plugin has special meaning.
In a normal lister window the user can switch viewing mode by means of the 1,2,3,4 etc keys. Also the N and P keys are used to switch to the next and previous files.
I want my lister plugin to handle all keys but at the moment I'm not getting any WM_KEYDOWN messages on those special tcmd keys. Is there any way to tell tcmd to pass on all windows messages?
.Henrik
For '0'...'9' just use the WM_CHAR command with the correct VK code
For 'n' and 'P' use:
SetFocus( ParentWin );
keybd_event('N', 0,0,0);
keybd_event('N', 0,KEYEVENTF_KEYUP,0);
---
I encountered the same problems with my hpg_ed plugin
For 'n' and 'P' use:
SetFocus( ParentWin );
keybd_event('N', 0,0,0);
keybd_event('N', 0,KEYEVENTF_KEYUP,0);
---
I encountered the same problems with my hpg_ed plugin

hpg666@hotmail.com (hpg 

-
- Junior Member
- Posts: 39
- Joined: 2003-03-24, 10:47 UTC
Actually my problem is the exact opposite
I never get the WM_CHAR messages for '0'...'9', tcmd handles them before I get a change to do anything.
It's a bit odd, I create a normal child window using ::CreateWindowEx(...) and I get every WM_CHAR messages except for the ones tcmd handles.
hmprf, I must have overlooked something
Back to the debugger.
.Henrik

I never get the WM_CHAR messages for '0'...'9', tcmd handles them before I get a change to do anything.
It's a bit odd, I create a normal child window using ::CreateWindowEx(...) and I get every WM_CHAR messages except for the ones tcmd handles.
hmprf, I must have overlooked something

.Henrik
-
- Junior Member
- Posts: 39
- Joined: 2003-03-24, 10:47 UTC
From the help files:
"Lister will subclass your window to catch some hotkeys like 'n' or 'p'."
Ohh... can I unsubclass my window
[edit]
I can use to make all WM_* go to MySubClassFunc, then it's my job to use CallWindowProc(...) to send messages to the Lister so it can update itself.
Is this a good way of doing it? Doesn't seem that clean a solution. Plus I need a list of WM_* that the Lister uses.
.Henrik
"Lister will subclass your window to catch some hotkeys like 'n' or 'p'."
Ohh... can I unsubclass my window

[edit]
I can use
Code: Select all
::SetWindowLongPtr( hParentHwnd, GWLP_WNDPROC, (LONG_PTR)MySubClassFunc );
Is this a good way of doing it? Doesn't seem that clean a solution. Plus I need a list of WM_* that the Lister uses.
.Henrik
- ghisler(Author)
- Site Admin
- Posts: 50386
- Joined: 2003-02-04, 09:46 UTC
- Location: Switzerland
- Contact:
No you can't. But you can subclass your window again later. TC will subclass your window when the function ListLoad returns. You could set a timer, and check in the WM_TIMER handler via GetWindowLong whether the window has been subclassed. When this happens, just re-subclass it, but save the window function set by TC. This way the messages will first go to your subclass function, then you pass it on with CallWindowProc() to my own subclass function.Ohh... can I unsubclass my window
> Plus I need a list of WM_* that the Lister uses.
Hmm, why? Just pass the commands on which you don't handle yourself.
Author of Total Commander
https://www.ghisler.com
https://www.ghisler.com
-
- Junior Member
- Posts: 39
- Joined: 2003-03-24, 10:47 UTC
I call in ListLoad() and store the address. But the WNDPROC address doesn't seem to change.
.H
Code: Select all
::GetWindowLong( hWndParent, GWLP_WNDPROC );
.H
- ghisler(Author)
- Site Admin
- Posts: 50386
- Joined: 2003-02-04, 09:46 UTC
- Location: Switzerland
- Contact:
It's changed AFTER ListLoad, because TC can subclass the window only when it has its handle! Btw, why do you call it with hWndParent? Lister doesn't subclass itself, it subclasses YOUR window!
Author of Total Commander
https://www.ghisler.com
https://www.ghisler.com
-
- Junior Member
- Posts: 39
- Joined: 2003-03-24, 10:47 UTC