Get progress dialog in PackFiles function (WCX)

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

Moderators: Hacker, petermad, Stefan2, white

Post Reply
User avatar
MVV
Power Member
Power Member
Posts: 8711
Joined: 2008-08-03, 12:51 UTC
Location: Russian Federation

Get progress dialog in PackFiles function (WCX)

Post by *MVV »

Christian, is there any normal way to get progress dialog handle while packer plugin executes PackFiles function? I need to ask some questions so I need parent window handle (normal or background one if user sends operation to background). It looks ugly if a messagebox appears below its progress dialog.
User avatar
ghisler(Author)
Site Admin
Site Admin
Posts: 50475
Joined: 2003-02-04, 09:46 UTC
Location: Switzerland
Contact:

Post by *ghisler(Author) »

Now - just use GetActiveWindow(). This way it will also work with other programs using your plugin.
Author of Total Commander
https://www.ghisler.com
User avatar
MVV
Power Member
Power Member
Posts: 8711
Joined: 2008-08-03, 12:51 UTC
Location: Russian Federation

Post by *MVV »

Unfortunately GetActiveWindow doesn't work when I need it - it returns NULL when TC calls PackFiles and when user clicks 'Background' button and TC replaces regular progress dialog with background progress window.

So I invented another way to detect background window handle (regular progress dialog may be found by window class name because TC can't show more than once one). I don't need any other program support, it should work in TC, so I pass to callback progress procedure string wsprintf(reported, "%s\n\n\n\n:%08d:", source, dwTID) in order to be able to find corresponding background dialog with item #100 which text ends with my thread's identifier. :D
Post Reply