VB编程:ReleaseCapture&SendMessage拖动无标题栏的窗体-57

简介: VB编程:ReleaseCapture&SendMessage拖动无标题栏的窗体-57

Private Declare Function ReleaseCapture Lib "user32" () As Long

Private Declare Function SendMessage Lib "user32" Alias "SendMessageA" (ByVal hwnd As Long, ByVal wMsg As Long, ByVal wParam As Long, lParam As Any) As Long


Const HTCAPTION = 2

Const WM_NCLBUTTONDOWN = &HA1   '161


Private Sub Form_MouseDown(Button As Integer, Shift As Integer, X As Single, Y As Single)

   Dim r As Long

   Dim i

   If Button = 1 Then

       i = ReleaseCapture()

       r = SendMessage(hwnd, WM_NCLBUTTONDOWN, HTCAPTION, 0)

   End If

End Sub

相关文章
|
3月前
|
Windows
MASM32编程状态栏显示字符动画,按钮跑马灯
MASM32编程状态栏显示字符动画,按钮跑马灯
|
5月前
|
开发框架 数据可视化 C#
vb如何设置父窗体与子窗体——MDI窗体
vb如何设置父窗体与子窗体——MDI窗体
分享:如何在VB中添加鼠标滚轮
分享:如何在VB中添加鼠标滚轮
|
C++ Windows
C++ Windows窗口程序:子窗口控件之按钮类button
C++ Windows窗口程序:子窗口控件之按钮类button
945 0
VB编程:ReleaseCapture&SendMessage拖动无标题栏的窗体
VB编程:ReleaseCapture&SendMessage拖动无标题栏的窗体
181 0
VB编程:ReleaseCapture&SendMessage拖动无标题栏的窗体
|
API 数据安全/隐私保护
VB编程:无标题栏窗体移动和自定义鼠标样式
VB编程:无标题栏窗体移动和自定义鼠标样式
254 0
|
API Windows
Delphi 使窗体Showmodal后可以操作其他窗体
对话框ShowModal之后不能操作其它窗口,实际上是因为Windows Disable了其它窗口。所以当你需要在模态对话框中访问其它已经可见的窗口时,需要用EnableWindow API来激活对应的窗口。
1152 0
|
C#
WPF窗体隐藏鼠标光标的方法
原文:WPF窗体隐藏鼠标光标的方法 要引用 System.Windows.Input;   Mouse.OverrideCursor = Cursors.
1797 0
|
C# Windows
WPF 窗体中获取键盘和鼠标无操作时的超时提示
原文:WPF 窗体中获取键盘和鼠标无操作时的超时提示 通过调用Windows API中的GetLastInputInfo来获取最后一次输入的时间 using System;using System.
902 0