当前位置:首页 » 多媒体相关

vb中如何限制鼠标移动?急!!


vb中如何限制鼠标移动?急!!

推荐阅读

  • 三款模块化光通信测试平台细考量 [详细内容]
  • 联通一季盈利下降26%为10.6亿 ARPU继续下滑 [详细内容]
  • 和记印度业务分拆上市将推迟 有望筹资约5亿 [详细内容]
  • 40Gb/s光模块的研究与开发 [详细内容]
  • 7260新手必读(一) [详细内容]
  • 颜承捷:适应转型电信营销渠道应作三大转变 [详细内容]
  • ASP.NET中的HTTP模块和处理程序 [详细内容]
  • 网友回答:
    网友:jacobran

    你自己看吧!  
      option   explicitdeclare   function   clipcursor   lib   "user32"   (lprect   as   any)   as   long  
      declare   function   clipcursorclear   lib   "user32"   alias   "clipcursor"   (byval   lprect   as   long)   as   long  
      declare   function   clienttoscreen   lib   "user32"   (byval   hwnd   as   long,   lppoint   as   pointapi)   as   long  
      type   rect  
      left   as   long  
        as   long  
      right   as   long  
      bottom   as   long  
      end   type  
      type   pointapi  
      x   as   long  
      y   as   long  
      end   type  
      public   retvalue   as   long  
      public   clipmode   as   boolean  
       
       
      public   sub   setcursor(clipobject   as   object,   setting   as   boolean)  
        used   to   clip   the   cursor   into   the   viewport   and  
        turn   off   the   default   windows   cursor  
       
       
      dim   currentpoint   as   pointapi  
      dim   cliprect   as   rect  
       
       
      if   setting   =   false   then  
        set   clip   state   back   to   normal  
      retvalue   =   clipcursorclear(0)  
      exit   sub  
      end   if  
       
       
        set   current   position  
      with   currentpoint  
      .x   =   0  
      .y   =   0  
      end   with  
        find   position   on   the   screen   (not   the   window)  
      retvalue   =   clienttoscreen(clipobject.hwnd,   currentpoint)  
        designate   clip   area  
      with   cliprect  
      .   =   currentpoint.y  
      .left   =   currentpoint.x  
      .right   =   .left   +   clipobject.scalewidth  
      .bottom   =   .   +   clipobject.scaleheight  
      end   with     clip   it  
      retvalue   =   clipcursor(cliprect)  
       
      end   sub  
     

    .

    讨论区

    Login