haimd
February 5th, 2002, 03:48 AM
Hi all,
I have to disable Ctrl+Alt+Del from within my process, does anyone know how to do it?
Thx
Haim
I have to disable Ctrl+Alt+Del from within my process, does anyone know how to do it?
Thx
Haim
|
Click to See Complete Forum and Search --> : Ctrl+Alt+Del disabling haimd February 5th, 2002, 03:48 AM Hi all, I have to disable Ctrl+Alt+Del from within my process, does anyone know how to do it? Thx Haim NMTop40 February 5th, 2002, 05:46 AM That would be on Windows, of course, because Ctrl-Alt-Del means nothing on UNIX. Hopefully it is not possible to do. This question is always being asked in the Visual C++ forum. I suppose on UNIX you would also want to prevent the user from opening another shell and calling kill -9 on your process. Can't be done (I hope). The best things come to those who rate thew February 5th, 2002, 02:50 PM #1) One way to do this would be to register your program as a service. This would mean your program would not show up in the task list. Thus you're not really disableing the "three finger solute" but geting around it's ability to terminate your program. RegisterServiceCtrlHandlerEx( LPCTSTR lpServiceName, // name of service LPHANDLER_FUNCTION_EX lpHandlerProc, // handler function LPVOID lpContext // user data ); #2)Now let's go on to the second way to disable CTRL-ALT-DEL. Yeah! There's another way! This time we're gonna fool the computer by letting it think our program is a screensaver! A screensaver? Yes, a screensaver! Because when a screensaver is active you can't press CTRL-ALT-DEL, the task list just won't pop up! This method actually disables CTRL-ALT-DEL entirely, the previous method just made your program dissappear from the list. There's also a disadvantage here, because when another program crashes and your program disabled CTRL-ALT-DEL, you won't be able to terminate that other program! Anyway, let's take a look at the declarations BOOL SystemParametersInfo( UINT uiAction, // system parameter to retrieve or set UINT uiParam, // depends on action to be taken PVOID pvParam, // depends on action to be taken UINT fWinIni // user profile update option ); You won't need the declarations we used easlier anymore, except when you want to combine the two methods, which ensures maximum-securrity. You see we make use of the SystemParametersInfo 'cos we're gonna change a system parameter, the parameter "SPI_GETSCREENREADER" as a matter of fact. Don't forget to set the fWinIni parameter to SPIF_SENDCHANGE so the modification is both set and broadcast out to the current instance of the OS.. Have fun.. nydhami February 15th, 2002, 07:55 AM you can find the code for this on codeproject.com haimd February 17th, 2002, 09:58 AM Hi, Thx for the pointer. However, I didn't find the article. May indicate the exact url? Thx, Haim Ulberon February 18th, 2002, 05:41 AM why are you telling him how to do this? Most likely, i have 5 bucks that says that person is either A: writing a virus of some sort or B: spyware. "To have a lack of imagination, not only shows your lack of intelligence, but also keeps the human race in the shadow of weakness" -Ulberon thedarkavenger February 20th, 2002, 09:31 AM What if your other half of the guess is wrong? Anyway so what if he is writing a virus??? Suppose you dint give him the help and he is indeed writing a virus, then he would have still found other ways to write the virus.Do not judge anything by first sight. And even if he does do something evil like that he will be punished. Remember knowledge is power and never deny anybody of it. ----Zen Saying jwycoff February 23rd, 2002, 05:01 AM I appreciate your view that sharing knowledge is important, but please don't get carried away with spouting ideologic zen sayings. The internet offers so much anonymity that many people do not feel resposible for their actions, either directly or indirectly. A programmer who places a virus in the network will most likely not see the victims of his attack, in the same way that a bomber pilot won't see his victims. Knowledge is power, and in the wrong hands, power can be a dangerous thing. A programmer that wontonly shares initimate knowledge of computer systems' weaknesses can do as much damage as a chemist who decides to share his knowledge of how to create deadly poisons from household ingredients. If he were to give this knowledge to just anyone who asked, most would consider such actions completely irresponsible. Yes, some person may want this knowledge in order to create an anitdote to the poison, but the likelihood of this is minimal. Similarly, as programmers, we should all try to use our best judgement when deciding what information to share with whom. Maybe you view this attitude as "uncool", but I hope you can also respect people with these attiudes, just as yours also deserves respect. Best regards, Jason Please rate my answer, whether good or bad, so I can improve the answers I give. Thanks! thew February 25th, 2002, 04:13 PM >> If he were to give this knowledge to just >> anyone who asked, most would consider such >> actions completely irresponsible. If he want's to create a virus which hides itself from the task manager than this isn't a very good way to go about it. I rather suspect that our boy is trying to write a program which isn't supposed to be disabled by users which is what a system programmer is supposed to do and the reason Microsoft put the services functionality in NT in the first place. The information which I gave out is a solution to a clasic problem which I've encountered often in writing code for large material handleing facilities populated by drones who's fingers are larger than any individual key. >> Maybe you view this attitude as "uncool", but >> I hope you can also respect people with these >> attiudes, just as yours also deserves respect. I don't respect people who hoard their knowledge and play god with it. Rather I respect people who are willing to throw someone a life line when they ask for it. People who share what the know and recipricate are ultimately the people who grow and learn, demi-gods and false prophets, who needs them. codeguru.com
Copyright Internet.com Inc., All Rights Reserved. |