Computing.Net > Forums > Programming > VB6: force app to stay in focus

Computer Problems? Computing.Net has over 1,000,000 posts about all things technology related! Over 90% answered within 24 hours! Click here to start participating now! Also, be sure to check out the New User Guide.

VB6: force app to stay in focus

Reply to Message Icon

Name: byrnesit
Date: August 5, 2006 at 07:49:48 Pacific
OS: WIN XP
CPU/Ram: PM1.7/1024
Product: Dell Latitude
Comment:

Hi Guys
Im trying to make a program in VB6 that will run and stay in focus no matter what.

Basically it will be used to control access to a computer, kind of like the lock computer function in windows NT/2k/XP etc but it will be used with a swipe card system and be used to charge for time-based access.

The problem i face is that the windows key and CTRL+ALT+DEL along with other various key combos (ie: ALT+ESC) will make the program loose focus and bring up the start menu.

I can keep the program on top but i cant stop access to start menu.

I only want the windows key, C+A+D etc to be disabled when the program is running otherwise i could do registry hacks.

I have tried making it a screensaver and that still allows things to happen.

Any ideas?
Thanks
Matt



Sponsored Link
Ads by Google

Response Number 1
Name: SamRock
Date: August 10, 2006 at 04:42:14 Pacific
Reply:

This is an API function.

Something like SetWindowsPos() (not sure),
where u can specific the Z-Order of the window.

Make it top most. That should solve the problem.

Sam

Samuel Roshan


0

Response Number 2
Name: siteforge (by Greg Apel)
Date: September 7, 2006 at 01:33:35 Pacific
Reply:

heya byrnesit,

I assume you are creating an app in "Kisok" mode, where no one can exit, or get access to the Windows operating system.

If you do this, you'll have to set up some sort of "administrative exit" with a textbox prompting for a password code to exit. Otherwise, you'll be trapped too!

Then, you can trap the keystrokes using user32 and kernel32 API calls.

This works with Windows NT 4.0 SP3 and later, but Win9x and ME are unsupported. Have a look:

http://vbnet.mvps.org/index.html?code/hooks/lowlevelkeyboardproc.htm


0

Sponsored Link
Ads by Google
Reply to Message Icon

Related Posts

See More







Post Locked

This post is quite old and has been locked from receiving new replies. Please create a new posting instead.


Go to Programming Forum Home


Sponsored links

Ads by Google


Results for: VB6: force app to stay in focus

Save a webpage to disk in VB6 www.computing.net/answers/programming/save-a-webpage-to-disk-in-vb6/13154.html

Keeping window in foreground www.computing.net/answers/programming/keeping-window-in-foreground/6684.html

how to programm in C++ (for null le www.computing.net/answers/programming/how-to-programm-in-c-for-null-le/12576.html