Office中国论坛/Access中国论坛

标题: 如何使access标题栏右边的控制按钮无效? [打印本页]

作者: maxli789    时间: 2009-4-1 11:06
标题: 如何使access标题栏右边的控制按钮无效?
本帖最后由 maxli789 于 2009-4-1 11:08 编辑

为使操作者不能随意更改应用程序窗口大小,如何使access标题栏右边的控制按钮无效?(包括其他窗体的最大化、最小化、关闭按钮)
作者: danis    时间: 2009-6-1 19:31
Const GWL_STYLE = (-16)
Const WS_CAPTION = &HC00000
Const Ws_OnlyClose = &H30000
Const WS_SYSMENU = &H80000

Declare Function GetWindowLongA Lib "user32" (ByVal hWnd As Long, ByVal nIndex As Long) As Long
Declare Function SetWindowLongA Lib "user32" (ByVal hWnd As Long, ByVal nIndex As Long, ByVal dwNewLong As Long) As Long
Declare Function DrawMenuBar Lib "user32" (ByVal hWnd As Long) As Long

Function SetFlatten()
  Dim hWnd As Long
  Dim Ls   As Long
  hWnd = Application.hWndAccessApp
  Ls = GetWindowLongA(hWnd, GWL_STYLE)
  
  SetWindowLongA hWnd, GWL_STYLE, Ls And Not Ws_OnlyClose
  'SetWindowLongA hWnd, GWL_STYLE, Ls Or Ws_OnlyClose
  DrawMenuBar hWnd
End Function
作者: 唐玉娥    时间: 2009-11-5 22:46
应该有用的,同志们




欢迎光临 Office中国论坛/Access中国论坛 (http://www.office-cn.net/) Powered by Discuz! X3.3