求助:无边框窗体的关闭问题,在线等!
把 form1 的 borderstyle 设置为 none ,同时设置 ShowInTaskbar 为 True
这样子的话在状态栏上鼠标右键就没用了。
于是我加上如下代码 :
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 WS_SYSMENU = &H80000
Private Const GWL_STYLE = (-16)
Private Sub Form_Load()
Dim TempLng As Long
TempLng = GetWindowLong(Me.hwnd, GWL_STYLE)
TempLng = TempLng Or WS_SYSMENU '系统菜单
SetWindowLong Me.hwnd, GWL_STYLE, TempLng
End Sub
于是再在 任务栏点鼠标右键,出现了 “关闭”、“移动”之类的可用菜单,但点了后没的反应啊。
请问要怎样才能使这的“关闭”菜单起作用