LzmTW.uSystem.uWindows.Win32API+MessageStructure

本文介绍了一个使用Win32API实现的结构体,用于获取窗口信息,并定义了一个类来监控键盘的状态变化,包括NumLock、CapsLock等特定按键的状态。

摘要生成于 C知道 ,由 DeepSeek-R1 满血版支持, 前往体验 >

Author:水如烟  

Namespace  LzmTW.uSystem.uWindows.Win32API

    
Public   Structure  WindowInfo
        
Dim  WindowText  As   String
        
Dim  ClassName  As   String
        
Dim  hWnd  As   Integer

        
Public   Function  ToArray()  As   Object ()
            
Return   New   Object () {WindowText, ClassName, hWnd}
        
End Function

    
End Structure

    
Public   Structure  ActiveWindowInfo
        
Dim  WindowText  As   String
    
End Structure

    
Public   Class  KeyStatusWatcherEventArgs
        
Inherits  System.EventArgs

        
Private  gIsEnabled  As   Boolean
        
Private  gMsgKey  As  KeyWatcher
        
Private  gNow  As   Date

        
Sub   New ( ByVal  now  As   Date )
            gNow 
=  now
            gMsgKey 
=  KeyWatcher.Time
        
End Sub

        
Sub   New ( ByVal  msgkey  As  KeyWatcher,  ByVal  isenabled  As   Boolean )
            gMsgKey 
=  msgkey
            gIsEnabled 
=  isenabled
        
End Sub

        
Public   ReadOnly   Property  MsgKey()  As  KeyWatcher
            
Get
                
Return  gMsgKey
            
End   Get
        
End Property

        
Public   ReadOnly   Property  IsEnabled()  As   Boolean
            
Get
                
Return  gIsEnabled
            
End   Get
        
End Property

        
Public   ReadOnly   Property  Now()  As   Date
            
Get
                
Return  gNow
            
End   Get
        
End Property
    
End Class

    
Public   Enum  KeyWatcher
        NumLock
        CapsLock
        ScrollLock
        Insert
        Time
        Other
    
End Enum

End Namespace

 

评论
添加红包

请填写红包祝福语或标题

红包个数最小为10个

红包金额最低5元

当前余额3.43前往充值 >
需支付:10.00
成就一亿技术人!
领取后你会自动成为博主和红包主的粉丝 规则
hope_wisdom
发出的红包
实付
使用余额支付
点击重新获取
扫码支付
钱包余额 0

抵扣说明:

1.余额是钱包充值的虚拟货币,按照1:1的比例进行支付金额的抵扣。
2.余额无法直接购买下载,可以购买VIP、付费专栏及课程。

余额充值