Skip to main content
GameDev.net gamedev.net
🔒 Locked

Program Running in the Background

Started by Sky Feb 17, 2003 at 9:56 AM 3 replies 400+ views
Original Post
Sky
Sky
How can I make it so that a program is only running in the background? (so that the only way to close it is using cntrl alt delete)? and also when its like that how could i make it watch for a certain key press? [edited by - Sky on February 17, 2003 10:57:44 AM]
Sky
Sky
And also how do I use the lpszCmdParam in WinMain? (I need to convert what you pass by the command line into two integer values.)
Tybalt
Tybalt
To keep your program running, just don''t return from the WinMain function. I''m not entirly sure what you mean here.
TheWulf
TheWulf
if you dont create a window, it will only be listed in the ctrl-alt-del box (and other similar programs)

to grab the kb input, directx might be able to do that, or you could try hooking the system''s message proc. Writing a VxD will work, but that''s a little tricky (ie, 100% asm)

i use __argc/__argv (in msvc) for command line params, however, sscanf should be able to parse winmain''s command line, it''s exactly as was supplied on the command line, w/o any leading/trailing whitespace
niyaw
niyaw
RegisterHotKey.

although usually you''ll have a named event that one of the program threads wait on, and to kill the program you''d start it again with some command line argument, such as "-kill". the app would parse command line and if it sees that argument it will set the termination event. the other instance will then get the waiting thread woken up and quit.

Topic Locked

This topic has been locked by a moderator. New replies are not allowed.

Sign in to reply to this topic.