On 21 Jan 2006 01:24:54 -0800, "Wayne" <cqdigital@volcanomail.com> wrote:
[color=blue]
>I have found the following code on this newsgroup that removes the
>Access Application minimize, restore and close buttons.
>
>Private Const GWL_EXSTYLE = (-20)
>Private Const GWL_STYLE = (-16)
>
>
>Private Const WS_MAXIMIZEBOX = &H10000
>Private Const WS_MINIMIZEBOX = &H20000
>Private Const WS_SYSMENU = &H80000
>
>
>Private Const HWND_TOP = 0
>Private Const SWP_NOMOVE = &H2
>Private Const SWP_NOSIZE = &H1
>Private Const SWP_FRAMECHANGED = &H20
>Private Const SWP_DRAWFRAME = SWP_FRAMECHANGED
>
>
>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 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
>'
>
>
>Function NoCloseInAccess()
> Dim lngStyle As Long
>
>
> lngStyle = GetWindowLong(hWndAccessApp, GWL_STYLE)
> lngStyle = lngStyle And Not WS_SYSMENU
> Call SetWindowLong(hWndAccessApp, GWL_STYLE, lngStyle)
> Call SetWindowPos(hWndAccessApp, HWND_TOP, 0, 0, 0, 0, SWP_NOMOVE Or
>SWP_NOSIZE Or SWP_DRAWFRAME)
>End Function
>
>
>Function DoCloseInAccess()
> Dim lngStyle As Long
>
>
> lngStyle = GetWindowLong(hWndAccessApp, GWL_STYLE)
> lngStyle = lngStyle Or WS_SYSMENU
> Call SetWindowLong(hWndAccessApp, GWL_STYLE, lngStyle)
> Call SetWindowPos(hWndAccessApp, HWND_TOP, 0, 0, 0, 0, SWP_NOMOVE Or
>SWP_NOSIZE Or SWP_DRAWFRAME)
>End Function
>
>The code works well but it is overkill for what I am wanting to do. I
>only need to remove or disable the restore button of the application
>window. Is this possible?
>
>Any help is appreciated.[/color]
See this thread. (Watch for word wrap)
http://groups.google.com/group/comp....1445b0712088ab
Wayne Gillespie
Gosford NSW Australia