Probelmm with TC7 Help on Vista

Bug reports will be moved here when the described bug has been fixed

Moderators: Hacker, petermad, Stefan2, white

User avatar
Lefteous
Power Member
Power Member
Posts: 9536
Joined: 2003-02-09, 01:18 UTC
Location: Germany
Contact:

Post by *Lefteous »

Quite funny to see people discussing about how to _close_ the help file. This seems to be the number one use case of the help file :twisted:
Who cares about the content?
User avatar
Flint
Power Member
Power Member
Posts: 3501
Joined: 2003-10-27, 09:25 UTC
Location: Belgrade, Serbia
Contact:

Post by *Flint »

roentgen666 wrote:We should have a contest... you will lose with such method for sure
Certainly not - in Russian environment. To use your methode with Russian Windows it is necessary to press: Alt+Space, Ctrl+Shift (to switch the keyboard layout; Alt+Shift alternatively), then Alt+P (the Russian key for closing is located there).

In any case, this discussion is useless. The question is: Is it possible to close CHM by Esc without external tools, and if yes - how to do it? One can suggest not to use CHM, another can suggest to press Alt+Space/C, third can suggest to press Alt+F4, but all these are not the answer to the original question.

Lefteous wrote:Quite funny to see people discussing about how to _close_ the help file. This seems to be the number one use case of the help file
Who cares about the content?
Changing the content is not a problem. If you wish to change it - you just change it, and it becomes changed. :D So, there is just nothing to discuss. ;)
Flint's Homepage: Full TC Russification Package, VirtualDisk, NTFS Links, NoClose Replacer, and other stuff!
 
Using TC 11.03 / Win10 x64
User avatar
Lefteous
Power Member
Power Member
Posts: 9536
Joined: 2003-02-09, 01:18 UTC
Location: Germany
Contact:

Post by *Lefteous »

If you wish to change it - you just change it, and it becomes changed.
Yes of course - I'm the help file author and all my change requests are applied immediately :lol:
User avatar
Flint
Power Member
Power Member
Posts: 3501
Joined: 2003-10-27, 09:25 UTC
Location: Belgrade, Serbia
Contact:

Post by *Flint »

Lefteous wrote:Yes of course - I'm the help file author
You know what I mean.
Flint's Homepage: Full TC Russification Package, VirtualDisk, NTFS Links, NoClose Replacer, and other stuff!
 
Using TC 11.03 / Win10 x64
User avatar
Lefteous
Power Member
Power Member
Posts: 9536
Joined: 2003-02-09, 01:18 UTC
Location: Germany
Contact:

Post by *Lefteous »

You know what I mean.
Changing the html help engine is not a problem. If you wish to change it - you just change it, and it becomes changed. Just write a letter to steve@microsoft.com :-D So, there is just nothing to discuss. ;-)
User avatar
ghisler(Author)
Site Admin
Site Admin
Posts: 50390
Joined: 2003-02-04, 09:46 UTC
Location: Switzerland
Contact:

Post by *ghisler(Author) »

Perhaps someone will write a HLP file viewer plugin for lister? Then TC could simply sow the HLP files by itself!

Are the specifications for HLP available?
Author of Total Commander
https://www.ghisler.com
User avatar
Thoemmeli
Junior Member
Junior Member
Posts: 3
Joined: 2006-12-27, 11:13 UTC
Location: Allenwinden, CH

Post by *Thoemmeli »

There is a way to close CHM / HTML Help with Esc:

Use Windows Hooks to hook into the Keyboard messages and close the HTML Help whenever the Total Command help is the active window.

Here is some pseudo code (I have an example that works, but with C# and a hooking library from MSDN Magazine):
(Sorry for the lazy formatting and incompletness)

Code: Select all

IntPtr m_hhook = SetWindowsHookEx(WH_KEYBOARD_LL, KeyboardHook, instanceOfModule, 0);

int KeyboardHook(int code, IntPtr wParam, IntPtr lParam)
{
  if (code < 0)
    return CallNextHookEx(m_hhook, code, wParam, lParam);

  CloseChmIfActive(lParam);

  // Yield to the next hook in the chain
  return CallNextHookEx(m_hhook, code, wParam, lParam);

}

void CloseChmIfActive(IntPtr lParam)
{
  KBDLLHOOKSTRUCT kbdStruct = (KBDLLHOOKSTRUCT)Marshal.PtrToStructure(lParam, typeof(KBDLLHOOKSTRUCT));
  if (kbdStruct.vkCode == 27) // Esc
  {
     FindAndCloseHelpForm();
   }
}

void FindAndCloseHelpForm()
{
  int handle = FindWindow("HH Parent", "Total Commander");
  if (handle == 0) return false;
  int foregroundHandle = GetForegroundWindow();
  if (handle == foregroundHandle)
  {
    // Post a message to Application to end its existence.
    Win32.SendMessage(handle, WM_SYSCOMMAND, SC_CLOSE, 0);
  }
}
Good luck
Thomas
Don't try to bend the spoon - there is no spoon.
User avatar
ghisler(Author)
Site Admin
Site Admin
Posts: 50390
Joined: 2003-02-04, 09:46 UTC
Location: Switzerland
Contact:

Post by *ghisler(Author) »

That's indeed an interesting idea, I will try it!
Author of Total Commander
https://www.ghisler.com
User avatar
ghisler(Author)
Site Admin
Site Admin
Posts: 50390
Joined: 2003-02-04, 09:46 UTC
Location: Switzerland
Contact:

Post by *ghisler(Author) »

I have added this code now. You can test it with the old sample CHM help file from here:

https://plugins.ghisler.com/655_pub_b1/totalcmd_chm.zip

Sorry, currently I don't have a newer CHM file available for testing.
Author of Total Commander
https://www.ghisler.com
User avatar
Lefteous
Power Member
Power Member
Posts: 9536
Joined: 2003-02-09, 01:18 UTC
Location: Germany
Contact:

Post by *Lefteous »

I have tested this and it works fine (both Escape and Shift+Escape).
User avatar
djk
Power Member
Power Member
Posts: 1651
Joined: 2003-03-17, 11:33 UTC
Location: Poland
Contact:

Post by *djk »

Yes, it works ok now.
DJK
Totally addicted to Total Commander
totalcmd.pl
en.totalcmd.pl
User avatar
Flint
Power Member
Power Member
Posts: 3501
Joined: 2003-10-27, 09:25 UTC
Location: Belgrade, Serbia
Contact:

Post by *Flint »

Works fine, but only till first change of the language! Steps to reproduce:

0. I have TotalCmd.chm in the TC installation directory and WCMD_RUS.HLP in the Language subdir. Initially, the language of TC is English.
1. I start TC, press F1 (CHM help is opened), then Esc - the help is closed.
2. Now I go to Configuration -> Language and select the Russian, press OK.
3. I press F1 - Russian HLP file is opened. Close it with e.g. the same Esc.
4. Again to Configuration -> Language and select the English language (internal); OK.
5. Press F1 - CHM help is opened, but it cannot be closed with Esc anymore. TC restart is needed.

(You can experiment with German help file instead of the Russian: unpack it from the TC installation archive, rename into WCMD_DEU.HLP and put into the Language subdir.)
Flint's Homepage: Full TC Russification Package, VirtualDisk, NTFS Links, NoClose Replacer, and other stuff!
 
Using TC 11.03 / Win10 x64
User avatar
ghisler(Author)
Site Admin
Site Admin
Posts: 50390
Joined: 2003-02-04, 09:46 UTC
Location: Switzerland
Contact:

Post by *ghisler(Author) »

I fear that this is impossible, because the old CHM window is still hooked, not the new one. I will try to find a solution, but I cannot promise anything. You will probably need to close and restart TC.
Author of Total Commander
https://www.ghisler.com
User avatar
Flint
Power Member
Power Member
Posts: 3501
Joined: 2003-10-27, 09:25 UTC
Location: Belgrade, Serbia
Contact:

Post by *Flint »

The problem is fixed in beta4.
Flint's Homepage: Full TC Russification Package, VirtualDisk, NTFS Links, NoClose Replacer, and other stuff!
 
Using TC 11.03 / Win10 x64
User avatar
ghisler(Author)
Site Admin
Site Admin
Posts: 50390
Joined: 2003-02-04, 09:46 UTC
Location: Switzerland
Contact:

Post by *ghisler(Author) »

Thanks!
Author of Total Commander
https://www.ghisler.com
Post Reply