Welcome!

By registering with us, you'll be able to discuss, share and private message with other members of our community.

SignUp Now!

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

May
12,998
174
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.
 
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.
 
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.
 
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

Back
Top