说三道四技术文摘-感悟人生的经典句子
说三道四 > 文档快照

运行中隐藏/显示窗口标题栏-VB资料

HTML文档下载 WORD文档下载 PDF文档下载
运行中隐藏/显示窗口标题栏-VB资料

声明:
Private Declare Function SetWindowLong Lib "user32" Alias "SetWindowLongA" (ByVal hwnd As Long, ByVal nIndex As Long, ByVal dwNewLong As Long) As Long
Private Declare Function GetWindowLong Lib "user32" Alias "GetWindowLongA" (ByVal hwnd As Long, ByVal nIndex As Long) As Long
Private Const GWL_STYLE = (-16)
Private Const WS_CAPTION = &HC00000
Private Const WS_MAXIMIZEBOX = &H10000
Private Const WS_MINIMIZEBOX = &H20000
Private Const WS_SYSMENU = &H80000

Private Declare Function SetWindowPos Lib "user32" (ByVal hwnd As Long, ByVal hWndInsertAfter As Long, ByVal x As Long, ByVal y As Long, ByVal cx As Long, ByVal cy As Long, ByVal wFlags As Long) As Long
Private Enum ESetWindowPosStyles
SWP_SHOWWINDOW = &H40
SWP_HIDEWINDOW = &H80
SWP_FRAMECHANGED = &H20 ' The frame changed: send WM_NCCALCSIZE
SWP_NOACTIVATE = &H10
SWP_NOCOPYBITS = &H100
SWP_NOMOVE = &H2
SWP_NOOWNERZORDER = &H200 ' Don't do owner Z ordering
SWP_NOREDRAW = &H8
SWP_NOREPOSITION = SWP_NOOWNERZORDER
SWP_NOSIZE = &H1
SWP_NOZORDER = &H4
SWP_DRAWFRAME = SWP_FRAMECHANGED
HWND_NOTOPMOST = -2
End Enum

Private Declare Function GetWindowRect Lib "user32" (ByVal hwnd As Long, lpRect As RECT) As Long
Private Type RECT
Left As Long
Top As Long
Right As Long
Bottom As Long
End Type

Private Function ShowTitleBar(ByVal bState As Boolean)
Dim lStyle As Long
Dim tR As RECT

GetWindowRect Me.hwnd, tR
lStyle = GetWindowLong(Me.hwnd, GWL_STYLE)
If (bState) Then
Me.Caption = Me.Tag
If Me.ControlBox Then
lStyle = lStyle Or WS_SYSMENU
End If
If Me.MaxButton Then
lStyle = lStyle Or WS_MAXIMIZEBOX
End If
If Me.MinButton Then
lStyle = lStyle Or WS_MINIMIZEBOX
End If
If Me.Caption <> "" Then
lStyle = lStyle Or WS_CAPTION
End If
Else
Me.Tag = Me.Caption
Me.Caption = ""
lStyle = lStyle And Not WS_SYSMENU
lStyle = lStyle And Not WS_MAXIMIZEBOX
lStyle = lStyle And Not WS_MINIMIZEBOX
lStyle = lStyle And Not WS_CAPTION
End If
SetWindowLong Me.hwnd, GWL_STYLE, lStyle
' 保证窗口具有相同的大小

Twitter Q1推广告API 收入剑指10亿 Dell:在OpenStack成熟后才会推出服务 一个开源工作者对开源与赚钱的一些想法 宏碁:Windows8仍不成功 Chrome表现令人意外 雅虎发布Q4财报 净利润同比下滑8% 菜鸟问题。既然有 ado.net 了为什么还少设计数据访问层呢? 怎样彻底实现office文件只读 关于scrollview视图的刷新问题求教 用递归实现回文不知道这样想是否提高了执行速度请高手点正 一个不明白的错误,如何解决? 感谢cockhorse!!!!!!!! SCJD: 这是怎么回事? 取某一路径下的类似文件名(50) 提取字符串中第三个字符的方法是什么? 英语考试作文,急!问题:关于低碳的英语作文:包含要 第七和八题 第七和第八题 第七和第八题, 第七和第八题, C语言递推法求等差数列An=An-1,A1=0?求 以“陆生动物如何适应环境为题”写一篇300字的小论 有关统计学的试题 C语言递归算法问题求二项展开式C(n,k n在下面 李某某再换律师二审推迟 新律师称重新中国全票连任联合国经社理事会成员德国法兰克福股市DAX指数30日下跌伦敦股市股指30日上涨突尼斯旅游城市发生自杀式爆炸袭击福州金山大桥拓宽 遇阻的天桥施工有望日本动物乐消暑:狐猴嚼水果冰 老虎戏澜沧江上游支流发现大面积白垩纪丹霞地金砖银行开业是“补漏”而非“拆台”(美联储出台系统重要性银行附加资本规定官运之左右逢源夺粮剿匪记美人无双摄政王的冷妃神在娱乐圈上海野生动物园旅游北大街旅游放生桥旅游七宝古镇旅游上海车墩影视乐园旅游
备案号:鲁ICP备13029499号-2 说三道四 www.s3d4.cn 说三道四技术文摘