+ -
当前位置:首页 → 问答吧 → 怎样通过API去除一个窗口的标题栏和边框?

怎样通过API去除一个窗口的标题栏和边框?

时间:2011-08-01

来源:互联网

能提供窗口的句柄,这个窗口不是我的软件的,也不是我设计的。

作者: JiLuoXingRen   发布时间: 2011-08-01

Dim Style As Long
Style = GetWindowLong(Me.hwnd, GWL_STYLE)
Style = Style - WS_BORDER - WS_CAPTION '去除边框和标题栏风格
SetWindowLong Me.hwnd, GWL_STYLE, Style

作者: c_cyd2008   发布时间: 2011-08-01

'Api声明:
Private Declare Function GetWindowLong Lib "user32" Alias "GetWindowLongA" (ByVal hwnd As Long, ByVal nIndex As Long) As Long
Private Declare Function SetWindowLong Lib "user32" Alias "SetWindowLongA" (ByVal hwnd As Long, ByVal nIndex As Long, ByVal dwNewLong As Long) As Long
Private Const GWL_STYLE = (-16)
Private Const WS_BORDER = &H800000
Private Const WS_CAPTION = &HC00000 ' WS_BORDER Or WS_DLGFRAME

作者: c_cyd2008   发布时间: 2011-08-01

好的谢谢,再补充问一个问题:怎么从获得的Style中知道到底有没有边框之类的信息?

作者: JiLuoXingRen   发布时间: 2011-08-01

热门下载

更多