'//取得窗口样式位 Private Declare Function GetWindowLong _ Lib "user32" _ Alias "GetWindowLongA" ( _ ByVal Hwnd1 As Long, _ ByVal nIndex As Long) _ As Long '//设置窗口样式位 Private Declare Function SetWindowLong _ Lib "user32" _ Alias "SetWindowLongA" ( _ ByVal Hwnd1 As Long, _ ByVal nIndex As Long, _ ByVal dwNewLong As Long) _ As Long '//重绘窗体标题栏 Private Declare Function DrawMenuBar _ Lib "user32" ( _ ByVal Hwnd1 As Long) _ As Long '//以下定义常数及变量 Private Const GWL_STYLE = (-16) '窗口样式 Private Const WS_CAPTION = &HC00000 ' WS_BORDER Or WS_DLGFRAME '//****************************************************************************************************************************************
Sub BtResume_Click() Dim Istype As Long '//取得窗口样式位 Istype = GetWindowLong(Application.Hwnd, GWL_STYLE) '//窗体样式位: 原样式和标题栏 Istype = Istype Or WS_CAPTION '//重设窗体样式位 SetWindowLong Application.Hwnd, GWL_STYLE, Istype '//重绘窗体标题栏 DrawMenuBar Application.Hwnd End Sub '//**************************************************************************************************************************************** Sub click1() Dim Istype As Long '//取得窗口样式位 Istype = GetWindowLong(Application.Hwnd, GWL_STYLE) '//窗体样式位: 原样式无标题栏 Istype = Istype And Not WS_CAPTION '//重设窗体样式位 SetWindowLong Application.Hwnd, GWL_STYLE, Istype '//重绘窗体标题栏 DrawMenuBar Application.Hwnd End Sub
x4gEmoKb.rar
(7.11 KB, 下载次数: 307)
[此贴子已经被作者于2006-10-20 10:06:08编辑过] |