Documentation help topics: %_dos & tcc /n

Aug 2, 2011
258
4
Berlin, Germany
  • %_dos:
The help says "Windows 7" -> "WIN7", but I get "WINDOWS7".

  • %_service:
"_service returns 1 if TCC was started as a service (TCC /N)."

I can't find more info to this in the help. How can I use "TCC /N"?
 

rconn

Administrator
Staff member
May 14, 2008
12,406
152
  • %_dos:
The help says "Windows 7" -> "WIN7", but I get "WINDOWS7".

WAD. I've corrected the documentation for the next build.

"_service returns 1 if TCC was started as a service (TCC /N)."


I can't find more info to this in the help. How can I use "TCC /N"?

It's not intended for general use. If you're running TCC as a service, you can add the /N option to notify TCC that it's a service. The only thing it affects is to ignore a CTRL_LOGOFF_EVENT if TCC is a service.
 
May 20, 2008
11,547
107
Syracuse, NY, USA
It's not intended for general use. If you're running TCC as a service, you can add the /N option to notify TCC that it's a service. The only thing it affects is to ignore a CTRL_LOGOFF_EVENT if TCC is a service.
I'm curious now. I have a mail server, started by the AUTOEXNT service, running in UI0 (on the services desktop). If I send a certain email through the server, it will start a TCC (as NT_AUTHORITY on that desktop). Will a logoff cause that instance of TCC (started without "/N") to receive CTRL_LOGOFF_EVENT and therefore terminate?
 

rconn

Administrator
Staff member
May 14, 2008
12,406
152
I'm curious now. I have a mail server, started by the AUTOEXNT service, running in UI0 (on the services desktop). If I send a certain email through the server, it will start a TCC (as NT_AUTHORITY on that desktop). Will a logoff cause that instance of TCC (started without "/N") to receive CTRL_LOGOFF_EVENT and therefore terminate?

Yes.

A logoff of any user will send CTRL_LOGOFF_EVENT to all console processes on the system.
 
May 20, 2008
3,515
4
Elkridge, MD, USA
Yes.
A logoff of any user will send CTRL_LOGOFF_EVENT to all console processes on the system.

You mean that if a user logs off, not only the console processes of that user receive the CTRL_LOGOFF_EVENT, but also all other users' console processes? Is there a way for a console process receiving CTRL_LOGOFF_EVENT to discern that it is from another user's logging off?
 

rconn

Administrator
Staff member
May 14, 2008
12,406
152
You mean that if a user logs off, not only the console processes of that user receive the CTRL_LOGOFF_EVENT, but also all other users' console processes?

That's what I mean.

Is there a way for a console process receiving CTRL_LOGOFF_EVENT to discern that it is from another user's logging off?

No.
 
May 20, 2008
11,547
107
Syracuse, NY, USA
Is it any different for WM_[QUERY]ENDSESSION (ENDSESSION_LOGOFF), which should be floating around at about the same time as CTRL_LOGOFF_EVENT? I don't thing those can cross desktops. How does TCC respond to them?
 

rconn

Administrator
Staff member
May 14, 2008
12,406
152
Is it any different for WM_[QUERY]ENDSESSION (ENDSESSION_LOGOFF), which should be floating around at about the same time as CTRL_LOGOFF_EVENT? I don't thing those can cross desktops. How does TCC respond to them?

Console apps don't see those messages.

TCC kludges around the WM_ENDSESSION problem by creating a hidden window that looks for WM_ENDSESSION, and runs TCEXIT before shutting down.
 
May 20, 2008
11,547
107
Syracuse, NY, USA
Console apps don't see those messages.

TCC kludges around the WM_ENDSESSION problem by creating a hidden window that looks for WM_ENDSESSION, and runs TCEXIT before shutting down.
But TCC has had a (top level) window for a long time (hasn't it?). Is it not enough to handle the ENDSESSION_LOGOFF lParam and not bother with CTRL_LOGOFF_EVENT?
I had thought you used TCC's window for more than that.
 

rconn

Administrator
Staff member
May 14, 2008
12,406
152
Is it not enough to handle the ENDSESSION_LOGOFF lParam and not bother with CTRL_LOGOFF_EVENT?

No. It's not possible to prevent a logoff or shutdown when an app gets a WM_ENDSESSION message; just to delay it slightly while doing some cleanup. (Remember that 5 second timeout before the app is killed by Windows regardless of what it's doing.)

And Windows will send the CTRL_LOGOFF_EVENT anyway to the console app's event handler, and kill it if it doesn't respond appropriately.
 
Similar threads
Thread starter Title Forum Replies Date
S Help topics f_attrib and f_wattrib Support 0
S Help topics f_attrib and f_wattrib Support 0
C Add link to ewriter help to program group... Support 3
samintz How to? Search for %(command) in Help? Support 1
Joe Caverly Favorites in eWriter Help Support 6
Joe Caverly Quick Search in eWriter Help Support 1
vefatica Online help? Support 2
fishman@panix.com HELP!! I just updated to Version 28 and as usual I cannot make extended directory search work. Support 2
JohnQSmith New online help file wrong logo Support 7
Jay Sage Documentation Function @DRIVE Missing in Help Lists Support 0
Charles Dye More help nits Support 0
D Documentation Typo in COPY help Support 0
FreezerBurnt Help making a CMD and TCC compatible batch file Support 7
Joe Caverly Documentation COMMANDS in Version 27 help Support 8
K_Meinhard How to? Help window position Support 7
U Command help on file names Support 5
D Documentation Help "Startup" page does not describe global lists Support 0
vefatica Help disappears? Support 6
rchapmanitt Help Purchasing Support 2
Charles Dye Documentation Help nits: @ZIPFILECRC Support 0
C version help Support 3
C Documentation Help Nit. REN / RENAME Support 0
Dmitry L. Kobyakov Documentation Error in the Help: the WINDOW command Support 0
vefatica Help for @PID Support 2
vefatica Need help with XML Support 3
Alpengreis Documentation Minor issue in help file for view /E Support 1
R Documentation Advanced Directives Help Support 0
R Documentation Help Nit with SETP Support 0
R wmic command help Support 9
R Documentation Help Nit > bdebugger View Menu Support 0
R Documentation A couple of Help nits Support 0
R Documentation Help typo Support 1
MikeBaas How to? I need help with RD Support 5
R Documentation v25 Help Comments Support 1
Joe Caverly DIRectory Colorization in v25 Help File Support 0
vefatica Help nit Support 0
D error in help documentation? Support 0
Joe Caverly _EXPANSION in help file Support 0
K_Meinhard Help file error Support 1
Joe Caverly JOBMONITOR in Help File Support 1
A Documentation [Help file] OPTION "//" synopsis formatting issue Support 0
D The local HELP viewer... Support 0
Chen Touboul Overtyping issue - i press the Insert key, help till press enter for new line in TCC Support 2
C Documentation Help nix ZIP /M Support 0
Joe Caverly v24 Help File - DATEMONITOR Support 1
Joe Caverly 7zip command links to zip help Support 0
K_Meinhard Help problems Support 3
Charles Dye Documentation Help Nits Forever: Checksum functions Support 0
Joe Caverly SAVECONSOLE in Help File Support 0
Joe Caverly CMDebug v23 Help: /FEEDBACK /UPDATE Support 0

Similar threads