ShutdownPlugin not called when I X the console? (just curious)

May 20, 2008
11,529
102
Syracuse, NY, USA
The short question is "Is that WAD?".

Here's why I ask. I'm reworking an old plugin (4AUTOTRAY). In the new version, the tray icon is always present and the left-click behavior and right-click menu change depending on whether TCC is minimized or restored. So I want to get rid of the tray icon when TCC exits. Doing that in ShutdownPlugin doesn't work (neither does a simple Beep) and the tray icon hangs around until I swipe it.

It's no problem because it works if I do it in DllMain when dwReason == DLL_PROCESS_DETACH. I was just curious.
 

rconn

Administrator
Staff member
May 14, 2008
12,404
152
ShutdownPlugin will always be called when you exit TCC, in any fashion.

With the proviso that Windows will kill the process after three or four seconds when you X it, and if you have a TCEXIT or slow ShutdownPlugin's, then it may not get a chance to run.
 
May 20, 2008
11,529
102
Syracuse, NY, USA
Hmmm! Here's ShutdownPlugin.

Code:
BOOL WINAPI ShutdownPlugin( BOOL b4ntExit )
{
    Beep(440,100);
    return 0;
}

If I issue EXIT I hear the beep. If I X the console I don't. Either way there are no delays.
 
May 20, 2008
11,529
102
Syracuse, NY, USA
So, after putting Beep(440,100); in ShutdownPlugin, I built the example from the most recent SDK. Same story ... I hear the beep if I EXIT, I don't hear the beep if I X the console.
 
May 20, 2008
11,529
102
Syracuse, NY, USA
OK, I know what's going on. I'm embarrassed to say exactly what but it deals with some experimental stuff in another plugin that monkeys with the TCC.EXE class window.

And, FWIW, the SDK sample (2019 version) built OK with no changes but to avoid "Procedure not found - InitializePlugin" I had to add the .DEF file to Properties\Linker\Input because, without it, the names were exported decorated. I've run into that often. Isn't there another way to export undecorated names?
 
Similar threads
Thread starter Title Forum Replies Date
M Yet another strange something re something called "@TCONVERT" Support 8
B Bdebugger / IDE editor doesn't display called batch file Support 1
T TCEXIT sometimes not called in TCMD Support 0
C TCEXIT not called since TCC v9 Support 5
vefatica Console not redrawn in BTM or with multiple commands Support 4
vefatica Console popup windows don't work correctly Support 0
vefatica Cancelling selection in the console? Support 7
G Console exe up / down history Support 8
vefatica Console cursor height in Win 10 Support 3
vefatica BTM, elevated, console window caption? Support 4
vefatica TCEXIT not executed if I X the console Support 4
vefatica TYPE resets console tab settings Support 14
vefatica Undesired scrolling in Windows 10 enhanced console. Support 2
L WAD In console, tabs are rendered with non-uniform tab-stop spacing Support 16
P No linefeed on last line of console window Support 2
fishman@panix.com TCC v22 & the Windows 10 Console Support 5
C TCMD not hiding the console Support 1
jaltman tcmd 21.0.19 win10 16179 console window loses content Support 2
vefatica Console output slower that before Support 8
L Fixed console line length in Take Command 19? Support 3
P Color directories in Win10 build 10586 console Support 11
Mordachai How to capture all console output from a TCMD session? Support 4
I Windows 10 console does not allow alt-F4 alias to complete Support 1
M Console-Mode (*.exe) works in TCC, not in TCMD Support 2
vefatica ON CLOSE, GOTO, and X-ing the console Support 5
I Attach console Support 3
C Screens of different size and hidden console Support 8
G Bug? TCC 16.03.55 Console Palette Support 4
C TCMD: Problem attaching console Support 4
vefatica OT: Windows console history? Support 7
D Console window titles / tab caption Support 4
vefatica ON <closing the console> Support 5
J Screen Capture (Console Mode) Support 5
vefatica Complete console caption as TCMD's caption? Support 1
Mordachai How to get a TC interface instead of a console for .btm, .bat, ? Support 10
fpefpe How to? Fonts / Size in console window Support 5
A How to? Is it possible to freeze one side of the console? Support 19
Stefano Piccardi How to? keep console from scrolling Support 6
noahcoad @ruby closes console Support 2
noahcoad Start new console without focus Support 3
vefatica TCSH crashes only when in a TCC console Support 2
vefatica Very strange console font corruption Support 3
p.f.moore Is the TakeCommandIPC interface available from other console programs? Support 3
J How to? 'tab' characters in the console and clipboard 'copy' Support 1
vefatica Console not closing ... problem gone Support 1
T Wrong prompt in Windows command console Support 3
vefatica Console not closing Support 1
E Redirect output from "start"-ed console Support 5
vefatica Hidden console doesn't close Support 34
J Console editor for TCC12 Support 10

Similar threads