|
error code 170 means that your application still has opened windows/hooks on its previous desktop, a simple solution is to call SetThreadDesktop as early as possible, in the constructor of your app class, for example.
|
|
|
|
|
so .... can any one of you deactivate these keys using vb and in the vb enviroment ? if anyone knows just email me (lutfi@alhafez.com)
thank u very much...........
|
|
|
|
|
Does anyone know hot to do this??
greetings!
|
|
|
|
|
Ya, you can do it using simple windows sdk. SendInput
Send the key value of alt and tab togather.
|
|
|
|
|
DWORD dwReserve=0;
ExitWindowsEx(EWX_REBOOT|EWX_FORCE, dwReserve);
|
|
|
|
|
Because we need NOT to reboot, but to simulate CTRL+ALT+DEL, as we pressed it.
|
|
|
|
|
Dear Sir:
Good idea and cool code snippets. But curiously enough, no Alt+Control+delete combine key simulation occurred (on W2k/XP)except that it flickered once when double clicked on altctrldel.exe.
Thank you!
|
|
|
|
|
You have to run it from a LocalSystem user context.
|
|
|
|
|
|
I do like you code!
==============================================
SkinMagic SDK Library for C/C++
The better solution for write skinnable application
http://www.appspeed.com
==============================================
|
|
|
|
|
Tried this on win2000 and this line returned null...
hdesk = OpenDesktop("Winlogon", 0, FALSE,DESKTOP_CREATEMENU |...)
|
|
|
|
|
I have used this in scripts and shortcuts.. You could put it in code..
WinExec("rundll32.exe user32.dll,LockWorkStation",SW_SHOW);
or
%windir%\System32\rundll32.exe user32.dll,LockWorkStation
Rob
|
|
|
|
|
This script will run only in 2k and onwords.
|
|
|
|
|
Hi, if the function have parameters , how to call it throw rundll32 ? how is the sentaxe ?
Thanks very much
|
|
|
|
|
I'm not sure what your asking.. If you want to test it on Windows 2k or above with out programming you can go to Start->Run and type the following in the field..
%windir%\System32\rundll32.exe user32.dll,LockWorkStation
If you are putting it into a executable.. simply run this..
WinExec("rundll32.exe user32.dll,LockWorkStation",SW_SHOW);
Rob
Whoever said nothing's impossible never tried slamming a revolving door!
|
|
|
|
|
Thanks for the answer.
I'm asking about other functions , NOT LockWorkStation
The function LockWorkStation DOSE NOT have any parameters ,So I'm asking about other function that have paramiters, How to pass the parameters to the function with this kind of call
Thanks
|
|
|
|
|
I have smashed my delete key, you saved me the money for a new keyboard.
/Magnus
- I don't necessarily agree with everything I say
|
|
|
|
|
I think it's important to mention that Admin rights are required to do this.
What's more you can't call SetThreadDesktop if the calling thread has any handle open in the current desktop.
Calling AfxBeginThread to open an empty thread with no handles opened is of no use, because AfxBeginThread seems to open handles a the desktop.
The only way to do this is calling CreateThread, and in this thread execute this code, with admin rights.
|
|
|
|
|
With this code, you can, for instance, hr, hmmm, hammm, let me see, oh yes!, no, not this, but then, hmmmm, oh sure!, no, not this too, hmmm....
Now, really, why would one want to Simulate Alt+Control+delete ?
I see dumb people
|
|
|
|
|
This code must be a must in remote-control tool, like RAdmin or BO2K
|
|
|
|
|
I know that VNC must have this code inside it, but, hey, VNC's routines can simulate ANY keypress. Creating a routine for specifically sending a Ctrl-Alt-Del is weird
I see dumb people
|
|
|
|
|
Daniel Turini wrote:
Creating a routine for specifically sending a Ctrl-Alt-Del is weird
not really - if you look at what VNC does, it has a seperate option on a menu to generate 'Send Ctrl-Alt-Delete' to the remote machine under VNC control, so I suspect its much the same..
I could use this for instance in our corporate sign-on policy which 'pops-up' when people use the Novell client to access our Network - they have to agree with the policy else it re-boots their machine (not nice) - using this I could force Ctrl-Alt-Delete and then 'W' to lock their workstation (not nice but slightly better)
to each his own I guess ... the technique for attaching to the desktop is interesting as well
|
|
|
|
|
Yes, what about remote admin??? Yes, very userfull, so one complex task can be solved in remote administration programming!
|
|
|
|
|
wow, cool.
I also have always been curious how to write a program that would simulate pressing RESET on PC.
I dare you!!!
Ultimate all-in-one XP-Style UI multiplatform solution: Tooltips, XP Menus, Hyperlinks, Drawing Graphics and formatted documents, plus powerful binary resource reuse. All Free 100%, visit www.tooltips.net now. The most powerful integrate UI library for developers in VC++, C#, Java, VB, Delphi, Borland C++, Borland C++ Builder, as well as any COM-compatible platform; Unified approach, cross-language OS, full .NET integration.
|
|
|
|
|
I also have always been curious how to write a program that would simulate pressing RESET on PC.
Why would you need a program to do that? Windows usually does that all by itself.
Todd Smith
|
|
|
|