TC release 9.1: Internal Viewer Doesn't work for Videos

English support forum

Moderators: white, Hacker, petermad, Stefan2

User avatar
tuska
Power Member
Power Member
Posts: 3742
Joined: 2007-05-21, 12:17 UTC

ActiveMovie Window | activemovie window error

Post by *tuska »

ghisler(Author) wrote:I couldn't reproduce this on Windows 7, but it seems to happen on Windows 10 - I will investigate.
2ghisler(Author)
Thanks for investigation!

After F3 for a fraction of a second I can see the video in the Lister then a new separate window opens -> "ActiveMovie Window"
and in that the video is played.

The Lister window is empty but below I see buttons for 'playback' and 'command menu' as well as the bar
that moves to the right when playing the video.

Ctrl + Q fades almost the entire screen and thus the open TC window -> with the new separate window: "ActiveMovie Window".
The other TC-window is completely empty in this case.

As already mentioned a "TOTALCMD64_90a_64-bit_final.EXE" opened works as expected.
TC 9.12RC2 - 64 bit, Windows 10 Pro (x64) Version 1703 (Build 15063.674)

After a google search I found this "activemovie window error" and I will try to find a solution too.

2Horst.Epp
Thank you for your hint!
I am not sure if I should choose this option or wait for the automatic update which will probably be soon.
User avatar
Horst.Epp
Power Member
Power Member
Posts: 6450
Joined: 2003-02-06, 17:36 UTC
Location: Germany

Re: ActiveMovie Window | activemovie window error

Post by *Horst.Epp »

tuska wrote:
ghisler(Author) wrote:I couldn't reproduce this on Windows 7, but it seems to happen on Windows 10 - I will investigate.
2ghisler(Author)
Thanks for investigation!

After F3 for a fraction of a second I can see the video in the Lister then a new separate window opens -> "ActiveMovie Window"
and in that the video is played.

The Lister window is empty but below I see buttons for 'playback' and 'command menu' as well as the bar
that moves to the right when playing the video.

Ctrl + Q fades almost the entire screen and thus the open TC window -> with the new separate window: "ActiveMovie Window".
The other TC-window is completely empty in this case.

As already mentioned a "TOTALCMD64_90a_64-bit_final.EXE" opened works as expected.
TC 9.12RC2 - 64 bit, Windows 10 Pro (x64) Version 1703 (Build 15063.674)

After a google search I found this "activemovie window error" and I will try to find a solution too.

2Horst.Epp
Thank you for your hint!
I am not sure if I should choose this option or wait for the automatic update which will probably be soon.
For me there is no empty Lister window.
F3 is playing mp4 in a windows called PreviewApp but this is inside the Lister.
Ctrl-Q plays the video inside the other TC side as it should be.
Using About in this windows shows that it is played by the Windows Media player.
Windows 11 Home x64 Version 23H2 (OS Build 22631.3374)
TC 11.03 x64 / x86
Everything 1.5.0.1371a (x64), Everything Toolbar 1.3.2, Listary Pro 6.3.0.69
QAP 11.6.3.2 x64
User avatar
ghisler(Author)
Site Admin
Site Admin
Posts: 48028
Joined: 2003-02-04, 09:46 UTC
Location: Switzerland
Contact:

Post by *ghisler(Author) »

Unfortunately I cannot fix it because it's a Windows 10 bug. I will have to re-implement the viewer as a DirectX player, but this is very complex and will take weeks.

So what is the bug? The player doesn't load in any windows which are set to support multiple screens with different scale factors (DPI). This is clearly an oversight by Microsoft.

Workaround:
If you don't use multiple screens with different scale factors, you can turn off this mode:
wincmd.ini
[Configuration]
DpiPerScreen=0

Otherwise you will have to view the files externally, or live with the blurry resizing on the secondary screen(s).
Author of Total Commander
https://www.ghisler.com
User avatar
tuska
Power Member
Power Member
Posts: 3742
Joined: 2007-05-21, 12:17 UTC

Re: Internal Viewer and Quick View Panel Ctrl+Q

Post by *tuska »

2ghisler(Author)

With DpiPerScreen=0 it works again as shown under TC 9.0a on my computer (with a single screen),
and works for all versions listed below that did not work before as well as for TC 9.12RC2 ...
tuska wrote:

Code: Select all

.MP4 .............. Internal Viewer with file under cursor - F3 ! CTRL + Q
----------------------------------------------------------------! ---------------------------------------------
TC 9.0a ........... opens Lister-window and plays the video ....! plays the video inside of the other TC-window
TC 9.10 and .. ) opens Lister-window with F3 - NO video is shown in lister, but in a separate "ActiveMovie Window",
TC 9.11RC1 ... ) CTRL+Q opens a separate "ActiveMovie Window" and plays the video

I use IrfanView as internal viewer (%COMMANDER_PATH%\Tools\IrfanView-portable-64bit\IrfanView\i_view64.exe).
TC - 64 bit, Windows 10 Pro (x64) Version 1703 (Build 15063.674)
Thanks a lot for your endeavours!
User avatar
tuska
Power Member
Power Member
Posts: 3742
Joined: 2007-05-21, 12:17 UTC

Video codecs -> K-Lite Codec Pack | Windows 1709

Post by *tuska »

Only for completion from a user's point of view:

Also with this constellation it is necessary to fill in in wincmd.ini under section [Configuration] this value: DpiPerScreen=0
to get Ctrl+Q and Lister (F3) work correctly for [quick] view of video files.

- TC 9.12RC2 - 64 bit, Windows 10 Pro (x64) Version 1709 (Build 16299.19) Fall Creators Update
- Video codecs from -> K-Lite Codec Pack: http://www.codecguide.com/download_k-lite_codec_pack_full.htm
- IrfanView Version 4.50 - 64 bit
User avatar
ghisler(Author)
Site Admin
Site Admin
Posts: 48028
Joined: 2003-02-04, 09:46 UTC
Location: Switzerland
Contact:

Post by *ghisler(Author) »

Irfanview isn't relevant here - it just depends on whether the codec supports different DPI per screen or not. Apparently the Windows mp4 codec and the k-lite codecs don't support it, but the Windows avi codecs do.
Author of Total Commander
https://www.ghisler.com
User avatar
tuska
Power Member
Power Member
Posts: 3742
Joined: 2007-05-21, 12:17 UTC

DpiPerScreen=0 | Lister | mp4 video

Post by *tuska »

16.11.17 Release Total Commander 9.12 release candidate 4 (32/64) - HISTORY.TXT
13.11.17 Fixed: Windows 10 creators update: mp4 video would play outside of Lister window, unless DpiPerScreen=0 was set
............ (reason: it was creating a playback window in a separate thread) (32/64)
Thank you for the fix!
TC 9.12RC4 - 64 bit, Windows 10 Pro (x64) Version 1709 (Build 16299.64)
User avatar
ghisler(Author)
Site Admin
Site Admin
Posts: 48028
Joined: 2003-02-04, 09:46 UTC
Location: Switzerland
Contact:

Post by *ghisler(Author) »

This was actually very difficult to fix!

Let me first explain why the error occurs: Total Commander calls SetThreadDpiAwarenessContext to tell Windows that it supports multiple monitors with different DPI scale factors. As the name says, this is only working for the current thread, so it has to be called also in background threads if they create windows.

Now the mp4 playback function in Windows creates its own window to render the video in it. It does this from a background thread which it creates by itself. But since the above function wasn't called, the window is created as DPI unaware. Therefore Windows places it outside of the (DPI aware) Lister window!

Not working solutions:

First I tried calling SetProcessDpiAwarenessContext. This worked, but once it had been called, it was impossible to disable! But it is necessary to disably DPI aware mode for some functions like saving/loading the position in a way compatible with older Total Commander versions.

Then I tried with MANIFEST settings - then it worked with DpiPerScreen=1, but produced the same bug with DpiPerScreen=0.

Now the solution:

Somehow I needed to call SetThreadDpiAwarenessContext when the video player created its thread, but before it created the window and started playing. But programs are not informed when background threads are created.

However, DLLs are informed about each created thread! DllMain is called with DLL_THREAD_ATTACH parameter just when the thread is created. So I modified the ZIP packer dll to call SetThreadDpiAwarenessContext for each new thread. This makes the video player create its window in DPI aware mode!
Author of Total Commander
https://www.ghisler.com
Post Reply