Windows programming

Moderators: None (Apply to moderate this forum)
Number of threads: 3711
Number of posts: 9173

This Forum Only
Post New Thread
Single Post View       Linear View       Threaded View      f

Edit Report
NT "Hot Key" Posted by Tom on 2 Nov 1999 at 10:15 AM
I run virtual Dos Boxes across a network. My Autoexec.nt<br>
logs me into many servers. I would like to assign a <br>
"hot key" (i.e. ALT + P) that would type my password for <br>
me. Can I do this?<br>
<br>



Edit Report
Re: NT &quot;Hot Key&quot; Posted by moonshadow on 11 Nov 1999 at 8:21 PM
I wrote an app that does something like that once, types a certain text to where the caret is, for that i used the keybd_event API(), straight forward.<br>
Now the hard part, keeping the keyboard focus in the old app when a task switch occurs, my app was on 95/98 only so i used a timer and the ThreadWalk API from the toolhelp sdk, AttachThreadInput() to every thread so that WM_SETFOCUS would have the correct hWnd in wParam (old focus) and not NULL. It's a lousy technique and I'm sure there are better ways! But I hope I atleast showed you of how NOT to do it :)<p>
Good luck


Edit Report
Just a thought Posted by moonshadow on 11 Nov 1999 at 8:26 PM
WM_ACTIVATEAPP has the thread losing the focus id in its LPARAM, so you might forget the timer and do something like this:<p>
case WM_ACTIVATEAPP:<br>
AttachThreadInput(GetCurrentThreadId(), lParam, (BOOL) wParam );<br>
return( 0 );<p>
case WM_SETFOCUS:<br>
SetFocus((HWND)wParam);<br>
keybd_event(....);<br>
return( 0 );<p>
Havent tried this but might actually work!





 

Recent Jobs

Official Programmer's Heaven Blogs
Web Hosting | Browser and Social Games | Gadgets

Popular resources on Programmersheaven.com
Assembly | Basic | C | C# | C++ | Delphi | Flash | Java | JavaScript | Pascal | Perl | PHP | Python | Ruby | Visual Basic
© Copyright 2011 Programmersheaven.com - All rights reserved.
Reproduction in whole or in part, in any form or medium without express written permission is prohibited.
Violators of this policy may be subject to legal action. Please read our Terms Of Use and Privacy Statement for more information.
Operated by CommunityHeaven, a BootstrapLabs company.