CSDN首页 空间 新闻 论坛 Blog 下载 读书 网摘 搜索 .NET Java 视频 接项目 求职 在线学习 买书 程序员 通知
可用分押宝游戏火热进行中... 专题改版:Java Web 专题
CSDN社区
搜索 收藏 打印 关闭
CSDN社区 >  C++ Builder >  Windows SDK/API

W2K下如何禁止用户的进程切换?

楼主binbin(破坏分子)2003-02-02 13:12:15 在 C++ Builder / Windows SDK/API 提问

俺知道屏蔽CTRL+ALT+DEL不那么容易,但是否有简单的办法屏蔽ALT+TAB之类的切换.  
  俺想在俺的程序结束前不让用户切换到其他程序.  
  俺发现EA的游戏就是这样,应该可以实现. 问题点数:100、回复次数:12Top

1 楼binbin(破坏分子)回复于 2003-02-04 00:23:07 得分 0

真的放假了???  
  人呢???Top

2 楼ilikeff8(迷茫)回复于 2003-02-04 01:32:25 得分 2

1   拦截消息  
  2   修改注册表Top

3 楼ilikeff8(迷茫)回复于 2003-02-04 01:48:28 得分 5

8.禁止用户使用“任务管理器”  
  用户可以使用“任务管理器”对话框来启动和结束本地进程,查看和管理其他计算机上的进程,改变进程的优先级。通过修改注册表,可以禁止用户使用“任务管理器”。新建一个双字节(REG_DWORD)值项HKEY_CURRENT_USER\Software\Microsoft\   Windows\CurrentVersion\Policies\System\DisableTaskMgr,修改其值为1。    
  Top

4 楼RamjetZhang(万花从中一点红,玉树临风王小桃是也)回复于 2003-02-04 15:23:58 得分 3

不过我觉得这样不好,剥夺用户的自由会带来不必要麻烦Top

5 楼huzhangyou(信仰(http://www.libing.net.cn))回复于 2003-02-05 13:06:29 得分 3

把他们给hook掉Top

6 楼shclhs(hello)回复于 2003-02-05 13:11:59 得分 2

你好毒辣啊,想让你的程序独占系统,如果是网吧类的软件还可以,可要是其它的谁会用啊!!!!呵呵呵呵。  
   
   
  学习Top

7 楼binbin(破坏分子)回复于 2003-02-05 14:08:22 得分 0

请谈技术而非其他,thx  
  在做多媒体演示时不想意外切换到其他程序.Top

8 楼binbin(破坏分子)回复于 2003-02-06 01:42:34 得分 0

这是CSDN中有关SystemParametersInfo参数的说明,可是俺怎么也找不到  
  PI_SETSWITCHTASKDISABLE的定义,无法编译.  
   
  SPI_SETSWITCHTASKDISABLE  
   
  Windows   NT   5.0   and   later:   Enables   or   disables   ALT+TAB   and   ALT+ESC   task   switching.   Set   the   uiParam   parameter   to   1   to   enable   the   feature,   or   zero   to   disable   it.   By   default,   task   switching   is   enabled.Top

9 楼huzhangyou(信仰(http://www.libing.net.cn))回复于 2003-02-06 10:18:01 得分 2

如果使用这个的话  
  请看这个  
  SystemParametersInfo    
  BOOL   =   SystemParametersInfo(   UINT   uiAction,   UINT   uiParam,   PVOID   pvParam,   UINT   fWinIni)  
  UINT   uiAction,   //   system   parameter   to   query   or   set  
  uiAction的详细信息为:  
  SPI_GETACCESSTIMEOUT   Retrieves   information   about   the   time-out   period   associated   with   the   accessibility   features.   The   pvParam   parameter   must   point   to   anACCESSTIMEOUT   structure   that   receives   the   information.   Set   the   cbSize   member   of   this   structure   and   the   uiParam   parameter   to   sizeof(ACCESSTIMEOUT).    
  SPI_GETACTIVEWINDOWTRACKING   Windows   NT   5.0   and   later,   Windows   98:   Indicates   whether   active   window   tracking   (activating   the   window   the   mouse   is   on)   is   on   or   off.   The   pvParam   parameter   must   point   to   a   BOOL   variable   that   receives   TRUE   for   on,   or   FALSE   for   off.    
  SPI_GETACTIVEWNDTRKZORDER   Windows   NT   5.0   and   later,   Windows   98:   Indicates   whether   windows   activated   through   active   window   tracking   will   be   brought   to   the   top.   The   pvParam   parameter   must   point   to   a   BOOL   variable   that   receives   TRUE   for   on,   or   FALSE   for   off.    
  SPI_GETACTIVEWNDTRKTIMEOUT   Windows   NT   5.0   and   later,   Windows   98:   Indicates   the   active   window   tracking   delay,   in   milliseconds.   The   pvParam   parameter   must   point   to   a   DWORD   variable   that   receives   the   time.    
  SPI_GETANIMATION   Retrieves   the   animation   effects   associated   with   user   actions.   The   pvParam   parameter   must   point   to   an   ANIMATIONINFO   structure   that   receives   the   information.   Set   the   cbSize   member   of   this   structure   and   the   uiParam   parameter   to   sizeof(ANIMATIONINFO).    
  SPI_GETBEEP   Indicates   whether   the   warning   beeper   is   on.  
  The   pvParam   parameter   must   point   to   a   BOOL   variable   that   receives   TRUE   if   the   beeper   is   on,   or   FALSE   if   it   is   off.  
   
     
  Top

10 楼huzhangyou(信仰(http://www.libing.net.cn))回复于 2003-02-06 10:18:41 得分 2

接上  
   
  SPI_GETBORDER   Retrieves   the   border   multiplier   factor   that   determines   the   width   of   a   window's   sizing   border.   The   pvParam   parameter   must   point   to   an   integer   variable   that   receives   this   value.    
  SPI_GETCOMBOBOXANIMATION   Windows   NT   5.0   and   later,   Windows   98:   Indicates   whether   the   slide-open   effect   for   combo   boxes   is   enabled.   The   pvParam   parameter   must   point   to   a   BOOL   variable   that   receives   TRUE   for   enabled,   or   FALSE   for   disabled.    
  SPI_GETDEFAULTINPUTLANG   Returns   the   keyboard   layout   handle   for   the   system   default   input   language.   The   pvParam   parameter   must   point   to   the   32-bit   variable   that   receives   this   value.    
  SPI_GETDRAGFULLWINDOWS   Determines   whether   dragging   of   full   windows   is   enabled.   The   pvParam   parameter   must   point   to   a   BOOL   variable   that   receives   TRUE   if   enabled,   or   FALSE   otherwise.    
  Windows   95:   This   flag   is   supported   only   if   Windows   Plus!   is   installed.   See   SPI_GETWINDOWSEXTENSION.  
   
  SPI_GETFASTTASKSWITCH   This   flag   is   obsolete.   Previous   versions   of   the   system   use   this   flag   to   determine   whether   ALT+TAB   fast   task   switching   is   enabled.   For   Windows   95,   Windows   98,   and   Windows   NT   version   4.0,   fast   task   switching   is   always   enabled.   See   SPI_GETSWITCHTASKDISABLE.    
  SPI_GETFILTERKEYS   Retrieves   information   about   the   FilterKeys   accessibility   feature.   The   pvParam   parameter   must   point   to   aFILTERKEYS   structure   that   receives   the   information.   Set   the   cbSize   member   of   this   structure   and   the   uiParam   parameter   to   sizeof(FILTERKEYS).    
  SPI_GETFONTSMOOTHING   Indicates   whether   the   font   smoothing   feature   is   enabled.   This   feature   uses   font   anti-aliasing   to   make   font   curves   appear   smoother   by   painting   pixels   at   different   gray   levels.    
  The   pvParam   parameter   must   point   to   a   BOOL   variable   that   receives   TRUE   if   the   feature   is   enabled,   or   FALSE   if   it   is   not.  
   
  Windows   95:   This   flag   is   supported   only   if   Windows   Plus!   is   installed.   See   SPI_GETWINDOWSEXTENSION.  
   
  SPI_GETFOREGROUNDFLASHCOUNT   Windows   NT   5.0   and   later,   Windows   98:   Indicates   the   number   of   timesSetForegroundWindow   will   flash   the   taskbar   button   when   rejecting   a   foreground   switch   request.   The   pvParam   parameter   must   point   to   a   DWORD   variable   that   receives   the   value.    
  SPI_GETFOREGROUNDLOCKTIMEOUT   Windows   NT   5.0   and   later,   Windows   98:   Indicates   the   amount   of   time   following   user   input,   in   milliseconds,   during   which   the   system   will   not   allow   applications   to   force   themselves   into   the   foreground.   The   pvParam   parameter   must   point   to   a   DWORD   variable   that   receives   the   time.    
  SPI_GETGRADIENTCAPTIONS   Windows   NT   5.0   and   later,   Windows   98:   Indicates   whether   the   gradient   effect   for   window   title   bars   is   enabled.   The   pvParam   parameter   must   point   to   a   BOOL   variable   that   receives   TRUE   for   enabled,   or   FALSE   for   disabled.   For   more   information   about   the   gradient   effect,   see   the   GetSysColor   function.    
  SPI_GETGRIDGRANULARITY   Retrieves   the   current   granularity   value   of   the   desktop   sizing   grid.   The   pvParam   parameter   must   point   to   an   integer   variable   that   receives   the   granularity.    
  SPI_GETHIGHCONTRAST   Windows   95   and   later,   Windows   NT   5.0   and   later:   Retrieves   information   about   the   HighContrast   accessibility   feature.   The   pvParam   parameter   must   point   to   aHIGHCONTRAST   structure   that   receives   the   information.   Set   the   cbSize   member   of   this   structure   and   the   uiParam   parameter   to   sizeof(HIGHCONTRAST).    
  SPI_GETICONMETRICS   Retrieves   the   metrics   associated   with   icons.   The   pvParam   parameter   must   point   to   anICONMETRICS   structure   that   receives   the   information.   Set   the   cbSize   member   of   this   structure   and   the   uiParam   parameter   to   sizeof(ICONMETRICS).    
  SPI_GETICONTITLELOGFONT   Retrieves   the   logical   font   information   for   the   current   icon-title   font.   The   uiParam   parameter   specifies   the   size   of   aLOGFONT   structure,   and   the   pvParam   parameter   must   point   to   the   LOGFONT   structure   to   fill   in.    
  SPI_GETICONTITLEWRAP   Determines   whether   icon-title   wrapping   is   enabled.   The   pvParam   parameter   must   point   to   a   BOOL   variable   that   receives   TRUE   if   enabled,   or   FALSE   otherwise.    
  SPI_GETKEYBOARDDELAY   Retrieves   the   keyboard   repeat-delay   setting,   which   is   a   value   in   the   range   from   0   (approximately   250   ms   delay)   through   3   (approximately   1   second   delay).   The   actual   delay   associated   with   each   value   may   vary   depending   on   the   hardware.   The   pvParam   parameter   must   point   to   an   integer   variable   that   receives   the   setting.    
  SPI_GETKEYBOARDPREF   Windows   95   and   later,   Windows   NT   5.0   and   later:   Determines   whether   the   user   relies   on   the   keyboard   instead   of   the   mouse,   and   wants   applications   to   display   keyboard   interfaces   that   would   otherwise   be   hidden.   The   pvParam   parameter   must   point   to   a   BOOL   variable   that   receives   TRUE   if   the   user   relies   on   the   keyboard;   or   FALSE   otherwise.    
  SPI_GETKEYBOARDSPEED   Retrieves   the   keyboard   repeat-speed   setting,   which   is   a   value   in   the   range   from   0   (approximately   30   repetitions   per   second)   through   31   (approximately   2.5   repetitions   per   second).   The   actual   repeat   rates   are   hardware-dependent   and   may   vary   from   a   linear   scale   by   as   much   as   20%.   The   pvParam   parameter   must   point   to   a   DWORD   variable   that   receives   the   setting.    
  SPI_GETLISTBOXSMOOTHSCROLLING   Windows   NT   5.0   and   later,   Windows   98:   Indicates   whether   the   smooth-scrolling   effect   for   list   boxes   is   enabled.   The   pvParam   parameter   must   point   to   a   BOOL   variable   that   receives   TRUE   for   enabled,   or   FALSE   for   disabled.    
  SPI_GETLOWPOWERACTIVE   Determines   whether   the   low-power   phase   of   screen   saving   is   enabled.   The   pvParam   parameter   must   point   to   a   BOOL   variable   that   receives   TRUE   if   enabled,   or   FALSE   if   disabled.  
  Windows   98:   This   flag   is   supported   for   16-bit   and   32-bit   applications.    
   
  Windows   95:   This   flag   is   supported   for   16-bit   applications   only.    
   
  Windows   NT:   This   flag   is   supported   for   32-bit   applications   on   Windows   NT   versions   5.0   and   later.   It   is   not   supported   for   16-bit   applications.  
   
  SPI_GETLOWPOWERTIMEOUT   Retrieves   the   time-out   value   for   the   low-power   phase   of   screen   saving.   The   pvParam   parameter   must   point   to   an   integer   variable   that   receives   the   value.    
  Windows   98:   This   flag   is   supported   for   16-bit   and   32-bit   applications.    
   
  Windows   95:   This   flag   is   supported   for   16-bit   applications   only.    
   
  Top

11 楼huzhangyou(信仰(http://www.libing.net.cn))回复于 2003-02-06 10:19:59 得分 2

继续  
   
  Windows   NT:   This   flag   is   supported   for   32-bit   applications   on   Windows   NT   versions   5.0   and   later.   It   is   not   supported   for   16-bit   applications.  
   
  SPI_GETMENUDROPALIGNMENT   Determines   whether   pop-up   menus   are   left-aligned   or   right-aligned,   relative   to   the   corresponding   menu-bar   item.   The   pvParam   parameter   must   point   to   a   BOOL   variable   that   receives   TRUE   if   left-aligned,   or   FALSE   otherwise.    
  SPI_GETMINIMIZEDMETRICS   Retrieves   the   metrics   associated   with   minimized   windows.   The   pvParam   parameter   must   point   to   a   MINIMIZEDMETRICS   structure   that   receives   the   information.   Set   the   cbSize   member   of   this   structure   and   the   uiParam   parameter   to   sizeof(MINIMIZEDMETRICS).    
  SPI_GETMOUSE   Retrieves   the   two   mouse   threshold   values   and   the   mouse   acceleration.   The   pvParam   parameter   must   point   to   an   array   of   three   integers   that   receives   these   values.   Seemouse_event   for   further   information.    
  SPI_GETMOUSEHOVERHEIGHT   Windows   NT   4.0   and   later,   Windows   98:   Gets   the   height,   in   pixels,   of   the   rectangle   within   which   the   mouse   pointer   has   to   stay   forTrackMouseEvent   to   generate   a   WM_MOUSEHOVER   message.   The   pvParam   parameter   must   point   to   a   UINT   variable   that   receives   the   height.    
  SPI_GETMOUSEHOVERTIME   Windows   NT   4.0   and   later,   Windows   98:   Gets   the   time,   in   milliseconds,   that   the   mouse   pointer   has   to   stay   in   the   hover   rectangle   for   TrackMouseEvent   to   generate   a   WM_MOUSEHOVER   message.   The   pvParam   parameter   must   point   to   a   UINT   variable   that   receives   the   time.    
  SPI_GETMOUSEHOVERWIDTH   Windows   NT   4.0   and   later,   Windows   98:   Gets   the   width,   in   pixels,   of   the   rectangle   within   which   the   mouse   pointer   has   to   stay   forTrackMouseEvent   to   generate   a   WM_MOUSEHOVER   message.   The   pvParam   parameter   must   point   to   a   UINT   variable   that   receives   the   width.    
  SPI_GETMOUSEKEYS   Retrieves   information   about   the   MouseKeys   accessibility   feature.   The   pvParam   parameter   must   point   to   aMOUSEKEYS   structure   that   receives   the   information.   Set   the   cbSize   member   of   this   structure   and   the   uiParam   parameter   to   sizeof(MOUSEKEYS).    
  SPI_GETMOUSESPEED   Windows   NT   5.0   and   later,   Windows   98:   Retrieves   the   current   mouse   speed.   The   mouse   speed   determines   how   far   the   pointer   will   move   based   on   the   distance   the   mouse   moves.   The   pvParam   parameter   must   point   to   an   integer   that   receives   a   value   which   ranges   between   1   (slowest)   and   20   (fastest).   A   value   of   10   is   the   default.   The   value   can   be   set   by   an   end   user   using   the   mouse   control   panel   application   or   by   an   application   using   SPI_SETMOUSESPEED.    
  SPI_GETMOUSETRAILS   Windows   95   and   later:   Indicates   whether   the   Mouse   Trails   feature   is   enabled.   This   feature   improves   the   visibility   of   mouse   cursor   movements   by   briefly   showing   a   trail   of   cursors   and   quickly   erasing   them.  
  The   pvParam   parameter   must   point   to   an   integer   variable   that   receives   a   value.   If   the   value   is   zero   or   1,   the   feature   is   disabled.   If   the   value   is   greater   than   1,   the   feature   is   enabled   and   the   value   indicates   the   number   of   cursors   drawn   in   the   trail.   The   uiParam   parameter   is   not   used.    
   
  SPI_GETNONCLIENTMETRICS   Retrieves   the   metrics   associated   with   the   nonclient   area   of   nonminimized   windows.   The   pvParam   parameter   must   point   to   a   NONCLIENTMETRICS   structure   that   receives   the   information.   Set   the   cbSize   member   of   this   structure   and   the   uiParam   parameter   to   sizeof(NONCLIENTMETRICS).    
  SPI_GETPOWEROFFACTIVE   Determines   whether   the   power-off   phase   of   screen   saving   is   enabled.   The   pvParam   parameter   must   point   to   a   BOOL   variable   that   receives   TRUE   if   enabled,   or   FALSE   if   disabled.  
  Windows   98:   This   flag   is   supported   for   16-bit   and   32-bit   applications.    
   
  Windows   95:   This   flag   is   supported   for   16-bit   applications   only.    
   
  Windows   NT:   This   flag   is   supported   for   32-bit   applications   on   Windows   NT   versions   5.0   and   later.   It   is   not   supported   for   16-bit   applications.  
   
  SPI_GETPOWEROFFTIMEOUT   Retrieves   the   time-out   value   for   the   power-off   phase   of   screen   saving.   The   pvParam   parameter   must   point   to   an   integer   variable   that   receives   the   value.    
  Windows   98:   This   flag   is   supported   for   16-bit   and   32-bit   applications.    
   
  Windows   95:   This   flag   is   supported   for   16-bit   applications   only.    
   
  Windows   NT:   This   flag   is   supported   for   32-bit   applications   on   Windows   NT   versions   5.0   and   later.   It   is   not   supported   for   16-bit   applications.  
   
  SPI_GETSCREENREADER   Windows   95   and   later,   Windows   NT   5.0   and   later:   Determines   whether   a   screen   reviewer   utility   is   running.   A   screen   reviewer   utility   directs   textual   information   to   an   output   device,   such   as   a   speech   synthesizer   or   Braille   display.   When   this   flag   is   set,   an   application   should   provide   textual   information   in   situations   where   it   would   otherwise   present   the   information   graphically.    
  The   pvParam   parameter   is   a   pointer   to   a   BOOL   variable   that   receives   TRUE   if   a   screen   reviewer   utility   is   running,   or   FALSE   otherwise.  
   
  SPI_GETSCREENSAVEACTIVE   Determines   whether   screen   saving   is   enabled.   The   pvParam   parameter   must   point   to   a   BOOL   variable   that   receives   TRUE   if   screen   saving   is   enabled,   or   FALSE   otherwise.    
  SPI_GETSCREENSAVERRUNNING   Windows   NT   5.0   and   later,   Windows   98:   Determines   whether   a   screen   saver   is   currently   running   on   the   window   station   of   the   calling   process.   The   pvParam   parameter   must   point   to   a   BOOL   variable   that   receives   TRUE   if   a   screen   saver   is   currently   running,   or   FALSE   otherwise.   Note   that   only   the   interactive   window   station,   "WinSta0",   can   have   a   screen   saver   running.    
  SPI_GETSCREENSAVETIMEOUT   Retrieves   the   screen   saver   time-out   value,   in   seconds.   The   pvParam   parameter   must   point   to   an   integer   variable   that   receives   the   value.    
  SPI_GETSERIALKEYS   Windows   95   and   later:   Retrieves   information   about   the   SerialKeys   accessibility   feature.   The   pvParam   parameter   must   point   to   aSERIALKEYS   structure   that   receives   the   information.   Set   the   cbSize   member   of   this   structure   and   the   uiParam   parameter   to   sizeof(SERIALKEYS).    
  SPI_GETSHOWSOUNDS   Determines   whether   the   Show   Sounds   accessibility   flag   is   on   or   off.   If   it   is   on,   the   user   requires   an   application   to   present   information   visually   in   situations   where   it   would   otherwise   present   the   information   only   in   audible   form.   The   pvParam   parameter   must   point   to   a   BOOL   variable   that   receives   TRUE   if   the   feature   is   on,   or   FALSE   if   it   is   off.  
  Using   this   value   is   equivalent   to   calling   GetSystemMetrics   (SM_SHOWSOUNDS).   That   is   the   recommended   call.  
   
  SPI_GETSNAPTODEFBUTTON   Windows   NT   4.0   and   later,   Windows   98:   Determines   whether   the   snap-to-default-button   feature   is   enabled.   If   enabled,   the   mouse   cursor   automatically   moves   to   the   default   button,   such   as   "OK"   or   "Apply",   of   a   dialog   box.   The   pvParam   parameter   must   point   to   a   BOOL   variable   that   receives   TRUE   if   the   feature   is   on,   or   FALSE   if   it   is   off.    
  SPI_GETSOUNDSENTRY   Retrieves   information   about   the   SoundSentry   accessibility   feature.   The   pvParam   parameter   must   point   to   aSOUNDSENTRY   structure   that   receives   the   information.   Set   the   cbSize   member   of   this   structure   and   the   uiParam   parameter   to   sizeof(SOUNDSENTRY).    
  Top

12 楼copy_paste(木石三)回复于 2003-02-07 16:48:05 得分 79

http://freehost19.websamba.com/skyflier/caq0209.rar    
   
   
  http://www.csdn.net/develop/Read_Article.asp?Id=15645  
  http://expert.csdn.net/Expert/topic/1113/1113085.xml?temp=.8164484  
   
  找BCB_FANS(现在改名啊,改成什么就不告诉你啦)这个牛人,他懂,上面是代码,可以屏蔽CTRL+ALT+DEL,   ALT+TABTop

相关问题

  • 进程中的用户切换(问题带送分)
  • 两个进程间来回切换,程序的激活状态,SetForegroudWindow与SetActiveWindow等等API都没有用,真是奇怪?
  • 切换用户
  • 可不可以做到一个程序两个进程,而且进程间可以通讯(有几百K,到几M不等的数据要传)
  • 动态切换View
  • 显卡切换--急!!!
  • 进程,进程,还是进程问题!
  • MyReg.Pattern = "^[\w-\.]+@\w+\.\w+$"
  • 服务进程
  • 进程问题

关键词

  • .net
  • 32-bit
  • 用户
  • uiparam
  • 进程
  • 禁止
  • systemparametersinfo
  • alt+
  • 程序
  • spi

得分解答快速导航

  • 帖主:binbin
  • ilikeff8
  • ilikeff8
  • RamjetZhang
  • huzhangyou
  • shclhs
  • huzhangyou
  • huzhangyou
  • huzhangyou
  • copy_paste

相关链接

  • CSDN Blog
  • 技术文档
  • 代码下载
  • 第二书店
  • 读书频道

广告也精彩

反馈

请通过下述方式给我们反馈
反馈
提问
网站简介|广告服务|VIP资费标准|银行汇款帐号|网站地图|帮助|联系方式|诚聘英才|English|问题报告
世纪乐知(北京)网络技术有限公司 版权所有, 京 ICP 证 020026 号
北京创新乐知广告有限公司 提供技术支持
Copyright © 2000-2007, CSDN.NET, All Rights Reserved
GongshangLogo