| View previous topic :: View next topic |
| Author |
Message |
HenrikHusted Junior Member

Joined: 24 Mar 2003 Posts: 39
|
Posted: Tue Apr 22, 2003 5:48 am Post subject: 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 |
|
| Back to top |
|
 |
hpg Junior Member

Joined: 16 Mar 2003 Posts: 79
|
Posted: Tue Apr 22, 2003 10:07 am Post subject: |
|
|
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  _________________ hpg666@hotmail.com (hpg :-) |
|
| Back to top |
|
 |
HenrikHusted Junior Member

Joined: 24 Mar 2003 Posts: 39
|
Posted: Tue Apr 22, 2003 12:21 pm Post subject: |
|
|
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 |
|
| Back to top |
|
 |
HenrikHusted Junior Member

Joined: 24 Mar 2003 Posts: 39
|
Posted: Tue Apr 22, 2003 12:42 pm Post subject: |
|
|
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
| Code: | | ::SetWindowLongPtr( hParentHwnd, GWLP_WNDPROC, (LONG_PTR)MySubClassFunc ); | 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 |
|
| Back to top |
|
 |
ghisler(Author) Site Admin


Joined: 04 Feb 2003 Posts: 24602 Location: Switzerland
|
Posted: Thu Apr 24, 2003 10:24 am Post subject: |
|
|
| Quote: | | Ohh... can I unsubclass my window |
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.
> 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
http://www.ghisler.com |
|
| Back to top |
|
 |
HenrikHusted Junior Member

Joined: 24 Mar 2003 Posts: 39
|
Posted: Mon Apr 28, 2003 2:05 pm Post subject: |
|
|
I call | Code: | | ::GetWindowLong( hWndParent, GWLP_WNDPROC ); | in ListLoad() and store the address. But the WNDPROC address doesn't seem to change.
.H |
|
| Back to top |
|
 |
ghisler(Author) Site Admin


Joined: 04 Feb 2003 Posts: 24602 Location: Switzerland
|
Posted: Mon Apr 28, 2003 2:46 pm Post subject: |
|
|
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
http://www.ghisler.com |
|
| Back to top |
|
 |
HenrikHusted Junior Member

Joined: 24 Mar 2003 Posts: 39
|
Posted: Tue Apr 29, 2003 7:25 am Post subject: |
|
|
| Quote: | | Btw, why do you call it with hWndParent? Lister doesn't subclass itself, it subclasses YOUR window! |
I knew it was something basic..
Now it works, thanks for the help.
.Henrik |
|
| Back to top |
|
 |
|