ESC key handling by Lister

Discuss and announce Total Commander plugins, addons and other useful tools here, both their usage and their development.

Moderators: white, Hacker, petermad, Stefan2

Post Reply
SPeller
Junior Member
Junior Member
Posts: 65
Joined: 2003-09-06, 16:52 UTC
Location: Russia

ESC key handling by Lister

Post by *SPeller »

Hi all!

How I can emulate the ESC key to close the lister? I tried this code:

Code: Select all

    Perform(WM_KEYDOWN, VK_ESCAPE, (VK_ESCAPE shl 16) or VK_ESCAPE);
    Perform(
      WM_KEYUP, VK_ESCAPE, Integer($C0000000 or (VK_ESCAPE shl 16) or VK_ESCAPE));
and even this:

Code: Select all

    keybd_event(VK_ESCAPE, 0, 0, 0);
    Perform(WM_KEYDOWN, VK_ESCAPE, (VK_ESCAPE shl 16) or VK_ESCAPE);
    keybd_event(VK_ESCAPE, 0, KEYEVENTF_KEYUP, 0);
    Perform(
      WM_KEYUP, VK_ESCAPE, Integer($C0000000 or (VK_ESCAPE shl 16) or VK_ESCAPE));
But lister do not want to close. What I should do?

PS: Sorry for my english.
User avatar
Clo
Moderator
Moderator
Posts: 5731
Joined: 2003-12-02, 19:01 UTC
Location: Bordeaux, France
Contact:

Other shortcut?

Post by *Clo »

2SPeller
:) Hello !
- I don't know if it's helpful, but Alt+F4 closes the Lister only -and not TC - when a Lister window is displayed.
- It's corresponding with the usual [X] "Close" win-button in the title-bar…
- Maybe could you try to emulate that shortcut instead ?

:mrgreen: Kind regards,
Claude
Claude
#31505 Traducteur Français de TC French translator Aide en Français Tutoriels Français English Tutorials
mutex
Junior Member
Junior Member
Posts: 39
Joined: 2004-02-22, 12:47 UTC
Location: Kazakhstan

Post by *mutex »

PostMessage(ListerWin, WM_KEYDOWN, VK_ESCAPE, 0);
SPeller
Junior Member
Junior Member
Posts: 65
Joined: 2003-09-06, 16:52 UTC
Location: Russia

Post by *SPeller »

Î, ñïàñèáî áîëüøîå! À òî ÿ óæ äóìàë ÷òî íèêàê.. )
User avatar
ghisler(Author)
Site Admin
Site Admin
Posts: 48088
Joined: 2003-02-04, 09:46 UTC
Location: Switzerland
Contact:

Post by *ghisler(Author) »

2SPeller
Please only write in English in this forum, so everyone can understand what you want to say. Thanks!
Author of Total Commander
https://www.ghisler.com
User avatar
Black Dog
Power Member
Power Member
Posts: 1024
Joined: 2003-02-05, 22:17 UTC
Location: Odessa
Contact:

Post by *Black Dog »

[face=courier]On 14-10-2004 02:10:17 +0000 SPeller wrote:

S> Î, ñïàñèáî áîëüøîå! À òî ÿ óæ äóìàë ÷òî íèêàê.. )

Thank you very much, I almost despaired to manage it.. )[/face]
SPeller
Junior Member
Junior Member
Posts: 65
Joined: 2003-09-06, 16:52 UTC
Location: Russia

Post by *SPeller »

Please only write in English
OK, I am sorry. I said 'thank you' :)
poiuytr
Senior Member
Senior Member
Posts: 243
Joined: 2003-02-23, 17:33 UTC

Post by *poiuytr »

mutex wrote:PostMessage(ListerWin, WM_KEYDOWN, VK_ESCAPE, 0);
Or that way

Code: Select all

PostMessage(ListerWin, WM_CLOSE, 0, 0 );
But when you post WM_CLOSE to Lister in QuickView mode it crashes, so VK_ESCAPE is better.
Post Reply