MainFrm.frm

来源:互联网 发布:博客源码资源站 编辑:程序博客网 时间:2024/05/21 18:32
VERSION 5.00 Begin VB.Form MainFrm Caption = "Form1" ClientHeight = 7800 ClientLeft = 16620 ClientTop = 1350 ClientWidth = 1965 LinkTopic = "Form1" MaxButton = 0 'False ScaleHeight = 7800 ScaleWidth = 1965 Begin VB.Timer Timer1 Interval = 300 Left = 0 Top = 0 End Begin VB.CommandButton Command1 Caption = "Command1" Height = 495 Left = 360 TabIndex = 0 Top = 4440 Width = 1215 End Begin VB.Label Lab_XY Height = 855 Left = 120 TabIndex = 1 Top = 240 Width = 1695 End End Attribute VB_Name = "MainFrm" Attribute VB_GlobalNameSpace = False Attribute VB_Creatable = False Attribute VB_PredeclaredId = True Attribute VB_Exposed = False Option Explicit '为什么只能放到这里? Public WithEvents VBHook As cSystemHook Attribute VBHook.VB_VarHelpID = -1 Private Sub Command1_Click() Call INI_Write("POSITON", "X", Me.Left) Call INI_Write("POSITON", "Y", Me.Top) Call INI_Write("POSITON", "HEIGHT", Me.Height) Call INI_Write("POSITON", "WIDTH", Me.Width) End Sub Private Sub Form_Load() Call Main_Init '应该放这里的! '设置全局钩子,引用vb_hook.dll文件 Set VBHook = New cSystemHook VBHook.SetHook End Sub Private Sub Form_Paint() Call AlwaysOnTop(Me.hWnd, True) '修正最顶层问题! End Sub '存在问题! Private Sub Form_QueryUnload(Cancel As Integer, UnloadMode As Integer) '如 果 程 序 不 同 意 关 机 ,Cancel 设 定 为 True 'Cancel = True Select Case UnloadMode Case 0: '窗体右上角的X号关闭窗体 Case 1: '程序代码关闭窗体,例如Unload Me Case 2: '关闭Windows关闭窗体 Case 3: '在任务管理器中关闭窗体 Case 4: 'MDI窗体被卸载时关闭窗体 End Select Call Shell_NotifyIcon(NIM_DELETE, nfIconData) '释放全局钩子 VBHook.RemoveHook Set VBHook = Nothing End End Sub Private Sub Timer1_Timer() 'Timer的Interval值设为300吧 Call QQHiden(Me) End Sub '鼠标钩子 Private Sub VBHook_MouseMove(Button As Integer, Shift As Integer, x As Single, y As Single) '获得RGB,分解RGB颜色值 '颜色分解有问题!和系统颜色有点差 Dim R As Integer, G As Integer, B As Integer, Color As Long Color = GetColorFromPoint(x, y) R = (Color Mod 256) B = (Int(Color / 65536)) G = ((Color - (B * 65536) - R) / 256) Lab_XY.Caption = "X坐标:" & x & vbCrLf & "Y坐标:" & y & vbCrLf & "R:" & R & " G:" & G & " B:" & B Lab_XY.BackColor = RGB(R, G, B) End Sub

Private Sub Command1_Click()
Call INI_Write("POSITON", "X", Me.Left)
Call INI_Write("POSITON", "Y", Me.Top)
Call INI_Write("POSITON", "HEIGHT", Me.Height)
Call INI_Write("POSITON", "WIDTH", Me.Width)

End Sub


Private Sub Form_Load()
Call Main_Init  '应该放这里的!
'设置全局钩子,引用vb_hook.dll文件
Set VBHook = New cSystemHook
VBHook.SetHook
End Sub

Private Sub Form_Paint()
Call AlwaysOnTop(Me.hWnd, True) '修正最顶层问题!
End Sub

'存在问题!
Private Sub Form_QueryUnload(Cancel As Integer, UnloadMode As Integer)
'如 果 程 序 不 同 意 关 机 ,Cancel 设 定 为 True
'Cancel = True

Select Case UnloadMode
Case 0:
'窗体右上角的X号关闭窗体
Case 1:
'程序代码关闭窗体,例如Unload Me
Case 2:
'关闭Windows关闭窗体
Case 3:
'在任务管理器中关闭窗体
Case 4:
'MDI窗体被卸载时关闭窗体
End Select
Call Shell_NotifyIcon(NIM_DELETE, nfIconData)

'释放全局钩子
VBHook.RemoveHook
Set VBHook = Nothing
End
End Sub

Private Sub Timer1_Timer() 'Timer的Interval值设为300吧
Call QQHiden(Me)
End Sub

'鼠标钩子
Private Sub VBHook_MouseMove(Button As Integer, Shift As Integer, x As Single, y As Single)
'获得RGB,分解RGB颜色值
'颜色分解有问题!和系统颜色有点差
Dim R As Integer, G As Integer, B As Integer, Color As Long
Color = GetColorFromPoint(x, y)
R = (Color Mod 256)
B = (Int(Color / 65536))
G = ((Color - (B * 65536) - R) / 256)
Lab_XY.Caption = "X坐标:" & x & vbCrLf & "Y坐标:" & y & vbCrLf & "R:" & R & " G:" & G & " B:" & B
Lab_XY.BackColor = RGB(R, G, B)
End Sub

原创粉丝点击
热门问题 老师的惩罚 人脸识别 我在镇武司摸鱼那些年 重生之率土为王 我在大康的咸鱼生活 盘龙之生命进化 天生仙种 凡人之先天五行 春回大明朝 姑娘不必设防,我是瞎子 饿了么同行恶意差评怎么办 苹果手机更新后淘宝用不了怎么办 淘宝网快递丢件了买家怎么办 评价后忘了截图五星好评怎么办 在淘宝被骗了好评返现怎么办 苹果4s微信版本过低怎么办 微信版本太低无法登录怎么办 苹果4微信版本低登录不了怎么办 安卓手机微信版本低登录不了怎么办 苹果微信版本低登录不了怎么办 安装包与当前版本不兼容怎么办 游戏与苹果手机系统不兼容怎么办 闲鱼买家申请退款不退货怎么办 在淘宝买的战地1登录不了怎么办 支付宝转账到注销的账号怎么办 支付宝用户支付密码被锁定怎么办 淘宝提现需要的手机宝令怎么办 手机换号码了支付宝账号怎么办 卖家收到货迟迟不给退款怎么办 闲鱼东西已发出买家申请退款怎么办 如果东西在路上买家要退款怎么办 卖家收到退的货后不退款怎么办 扣48分淘宝被限制登录怎么办 淘宝网申请退款卖家不理怎么办 高考生如果把登录密码忘记了怎么办 普高考生登录密码忘记了怎么办 淘宝买的流量卡然后网卡怎么办? 忘记了qq号绑定了手机怎么办 微信绑定qq号忘记了怎么办 扣扣密码忘了手机号换了怎么办 如何更改微信登录密码忘记了怎么办 阿里卖家不肯同意退货退款怎么办 新买的号码被绑定微信怎么办 如果换手机原来旧手机支付宝怎么办 支付宝注册证件已过有效期怎么办 支付宝账号是手机号换号怎么办 淘宝网卖假药伤了别人身体怎么办 微信手机登录收不到验证码怎么办 淘宝店的宝贝没有尺码选项怎么办 淘宝账号被保护要自助开通怎么办 小米平板经常出现系统无响应怎么办