Board index » delphi » Preventing alt-tab switching

Preventing alt-tab switching

Is there any way to prevent a windows user from using the alt-tab key
sequence to switch to another program?  I tried intercepting wm_SysChar
but this doesn't seem to be getting called.  I guess what I really need
is to run my main form system modal but I can't seem to figure out how to
do that.
Any help will be greatly appreciated.

  __/__/__/__/__/  __/        __/__/__/    r...@zeus.towson.edu
      __/         __/        __/    __/     S72U...@TOE01.towson.edu
     __/         __/        __/__/__/       Towson State University
    __/         __/        __/  __/         Towson Maryland
   __/         __/__/__/  __/    __/    5 lines right on the button..........

 

Re:Preventing alt-tab switching


Travis L. Reno (r...@zeus.towson.edu) wrote:
: Is there any way to prevent a windows user from using the alt-tab key
: sequence to switch to another program?  

Read the Windows API documentation for the SetSystemModalWindow (from memory)
API call.

Aaron

Re:Preventing alt-tab switching


In article
<Pine.ULT.3.91.950814160655.16023B-100...@zeus.towson.edu>,
r...@zeus.towson.edu says...

Quote

>Is there any way to prevent a windows user from using the alt-tab key
>sequence to switch to another program?  I tried intercepting
wm_SysChar
>but this doesn't seem to be getting called.  I guess what I really need
>is to run my main form system modal but I can't seem to figure out how
to
>do that.
>Any help will be greatly appreciated.

Not to be combative, but why prevent a user from using his full Windows
capabilities?  That would just plain{*word*211}me off if I were using your
application.  Running your main form modal won't change anything
anyway, since users can alt-tab away from programs that have modal
dialogs.

I assume you want to prevent them from alt-tabbing away because you
have some pending processing waiting.  I'd suggest handling any pending
issues as your application loses focus, not making your users pay the
price for your program's needs.

Todd

--
=====================================================
Todd Fast (that's right...just like the adjective)    tf...@eden.com
"His mind is somewhat too much taken up with his mind." - John Earle
=====================================================

Re:Preventing alt-tab switching


Mr A Wigley (w...@aurora.cc.monash.edu.au) wrote:
: Travis L. Reno (r...@zeus.towson.edu) wrote:
: : Is there any way to prevent a windows user from using the alt-tab key
: : sequence to switch to another program?  

: Read the Windows API documentation for the SetSystemModalWindow (from memory)
: API call.

: Aaron

Also from memory, there is a demo file that discusses how to do this.  it
is at ftp.microsoft.com/softlib/mslfiles.  For some reason they did it with
a system wide hook.

Brad

**********************************************************************
   Brad Millard                       www.lascruces.com/~jbm
   jmill...@nmsu.edu
   j...@lascruces.com
**********************************************************************

Other Threads