How do you hide the Title Bar for Access the application. I have
everything done but I need to hide the title bar. I've seen code to
hide Access but that seems like overkill. Can I put hiding the Title
Bar in the Load property of the first form that loads, What would the
syntax be.
Thanks
DS 13 14314
DS wrote: How do you hide the Title Bar for Access the application. I have everything done but I need to hide the title bar. I've seen code to hide Access but that seems like overkill. Can I put hiding the Title Bar in the Load property of the first form that loads, What would the syntax be. Thanks DS
Get to the database window and click Tools/Startup. Enter something
into ApplicationTitle. Exit Access. Enter App. Does that work?
Salad wrote: DS wrote:
How do you hide the Title Bar for Access the application. I have everything done but I need to hide the title bar. I've seen code to hide Access but that seems like overkill. Can I put hiding the Title Bar in the Load property of the first form that loads, What would the syntax be. Thanks DS
Get to the database window and click Tools/Startup. Enter something into ApplicationTitle. Exit Access. Enter App. Does that work?
Nope. Thanks for trying!
DS
On Fri, 21 Jan 2005 23:37:33 -0500, DS <bo******@optonline.net> wrote: How do you hide the Title Bar for Access the application. I have everything done but I need to hide the title bar. I've seen code to hide Access but that seems like overkill. Can I put hiding the Title Bar in the Load property of the first form that loads, What would the syntax be. Thanks DS
Hi
I'm pretty sure you can't do this. Having or not having a title bar is
part of the class definition of a window which must be set when the
window is created, and I don't think it can be changed.
If you do hide the application window, make sure ALL errors are
caught.
David
You ned to use API calls to do this, You can try the following.
Paste the following code to a standard module.
' *************
' Code Start
Option Explicit
Private Const GWL_STYLE = (-16)
Private Const WS_CAPTION = &HC00000
Private Const SWP_NOSIZE = &H1
Private Const SWP_NOZORDER = &H4
Public Const SWP_FRAMECHANGED = &H20
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 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 AccessTitleBar(Show As Boolean) As Long
Dim hwnd As Long
Dim nIndex As Long
Dim dwNewLong As Long
Dim dwLong As Long
Dim wFlags As Long
hwnd = hWndAccessApp
nIndex = GWL_STYLE
wFlags = SWP_NOSIZE + SWP_NOZORDER + SWP_FRAMECHANGED
dwLong = GetWindowLong(hwnd, nIndex)
If Show Then
dwNewLong = (dwLong Or WS_CAPTION)
Else
dwNewLong = (dwLong And Not WS_CAPTION)
End If
Call SetWindowLong(hwnd, nIndex, dwNewLong)
Call SetWindowPos(hwnd, 0&, 0&, 0&, 0&, 0&, wFlags)
End Function
' Code End
' *************
Sample calls
To turn off title bar
Call AccessTitleBar(False)
To turn on title bar
Call AccessTitleBar(True)
--
Terry Kreft
MVP Microsoft Access
"DS" <bo******@optonline.net> wrote in message
news:oR****************@fe08.lga... How do you hide the Title Bar for Access the application. I have everything done but I need to hide the title bar. I've seen code to hide Access but that seems like overkill. Can I put hiding the Title Bar in the Load property of the first form that loads, What would the syntax be. Thanks DS
Terry Kreft wrote: You ned to use API calls to do this, You can try the following.
Paste the following code to a standard module.
' ************* ' Code Start Option Explicit
Private Const GWL_STYLE = (-16) Private Const WS_CAPTION = &HC00000
Private Const SWP_NOSIZE = &H1 Private Const SWP_NOZORDER = &H4 Public Const SWP_FRAMECHANGED = &H20
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 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 AccessTitleBar(Show As Boolean) As Long Dim hwnd As Long Dim nIndex As Long Dim dwNewLong As Long Dim dwLong As Long Dim wFlags As Long
hwnd = hWndAccessApp nIndex = GWL_STYLE wFlags = SWP_NOSIZE + SWP_NOZORDER + SWP_FRAMECHANGED
dwLong = GetWindowLong(hwnd, nIndex)
If Show Then dwNewLong = (dwLong Or WS_CAPTION) Else dwNewLong = (dwLong And Not WS_CAPTION) End If
Call SetWindowLong(hwnd, nIndex, dwNewLong) Call SetWindowPos(hwnd, 0&, 0&, 0&, 0&, 0&, wFlags) End Function ' Code End ' *************
Sample calls To turn off title bar Call AccessTitleBar(False)
To turn on title bar Call AccessTitleBar(True)
That's very slick, Terry. I'm not sure if I'd ever use it, but it's slick.
On my XP machine, I do have one glitch. On my Windows StartBar I have
the AutoHide the taskbar set to true. Thus I have to move my mouse down
where the start bar is then it "pops up" instead of being visible at all
times. (I can always access it using Alt-Tab but some people may be
uncomfortable with that method)
If I enter Access, and the Access startup property is StatusBarOn =
True, when I turn off the window border with this routine your wrote,
the Windows Start bar goes to sleep. If I move the mouse to it's general
area, the start bar does not pop up anymore. When I turn the Access
window bar back on, I can access the Window's Startup bar.
If I have StatusBarOn = False, I do not have this problem. I guess this
is due to having more desktop real estate within Access.
I guess this is more of a Windows problem than an Access problem. If
the poster uses your code, it's something he may need to be aware
of...but then again, it may just be my machine that operates this way.
Salad,
Thanks for this, I actually missed a flag on the SetWindowPos call.
Could you add in the declarations section
Private Const SWP_NOMOVE = &H2
and then change
wFlags = SWP_NOSIZE + SWP_NOZORDER + SWP_FRAMECHANGED
to
wFlags = SWP_NOSIZE + SWP_NOZORDER + SWP_FRAMECHANGED + SWP_NOMOVE
and see if that makes a difference?
It works correctly in Win2000 pro anyway.
--
Terry Kreft
MVP Microsoft Access
"Salad" <oi*@vinegar.com> wrote in message
news:m7*****************@newsread1.news.pas.earthl ink.net... Terry Kreft wrote:
You ned to use API calls to do this, You can try the following.
Paste the following code to a standard module.
' ************* ' Code Start Option Explicit
Private Const GWL_STYLE = (-16) Private Const WS_CAPTION = &HC00000
Private Const SWP_NOSIZE = &H1 Private Const SWP_NOZORDER = &H4 Public Const SWP_FRAMECHANGED = &H20
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 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 AccessTitleBar(Show As Boolean) As Long Dim hwnd As Long Dim nIndex As Long Dim dwNewLong As Long Dim dwLong As Long Dim wFlags As Long
hwnd = hWndAccessApp nIndex = GWL_STYLE wFlags = SWP_NOSIZE + SWP_NOZORDER + SWP_FRAMECHANGED
dwLong = GetWindowLong(hwnd, nIndex)
If Show Then dwNewLong = (dwLong Or WS_CAPTION) Else dwNewLong = (dwLong And Not WS_CAPTION) End If
Call SetWindowLong(hwnd, nIndex, dwNewLong) Call SetWindowPos(hwnd, 0&, 0&, 0&, 0&, 0&, wFlags) End Function ' Code End ' *************
Sample calls To turn off title bar Call AccessTitleBar(False)
To turn on title bar Call AccessTitleBar(True) That's very slick, Terry. I'm not sure if I'd ever use it, but it's
slick. On my XP machine, I do have one glitch. On my Windows StartBar I have the AutoHide the taskbar set to true. Thus I have to move my mouse down where the start bar is then it "pops up" instead of being visible at all times. (I can always access it using Alt-Tab but some people may be uncomfortable with that method)
If I enter Access, and the Access startup property is StatusBarOn = True, when I turn off the window border with this routine your wrote, the Windows Start bar goes to sleep. If I move the mouse to it's general area, the start bar does not pop up anymore. When I turn the Access window bar back on, I can access the Window's Startup bar.
If I have StatusBarOn = False, I do not have this problem. I guess this is due to having more desktop real estate within Access.
I guess this is more of a Windows problem than an Access problem. If the poster uses your code, it's something he may need to be aware of...but then again, it may just be my machine that operates this way.
Terry Kreft wrote: Salad, Thanks for this, I actually missed a flag on the SetWindowPos call.
Could you add in the declarations section
Private Const SWP_NOMOVE = &H2
and then change
wFlags = SWP_NOSIZE + SWP_NOZORDER + SWP_FRAMECHANGED
to wFlags = SWP_NOSIZE + SWP_NOZORDER + SWP_FRAMECHANGED + SWP_NOMOVE
and see if that makes a difference?
It works correctly in Win2000 pro anyway.
Works like a champ!
Terry Kreft wrote: You ned to use API calls to do this, You can try the following.
Paste the following code to a standard module.
' ************* ' Code Start Option Explicit
Private Const GWL_STYLE = (-16) Private Const WS_CAPTION = &HC00000
Private Const SWP_NOSIZE = &H1 Private Const SWP_NOZORDER = &H4 Public Const SWP_FRAMECHANGED = &H20
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 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 AccessTitleBar(Show As Boolean) As Long Dim hwnd As Long Dim nIndex As Long Dim dwNewLong As Long Dim dwLong As Long Dim wFlags As Long
hwnd = hWndAccessApp nIndex = GWL_STYLE wFlags = SWP_NOSIZE + SWP_NOZORDER + SWP_FRAMECHANGED
dwLong = GetWindowLong(hwnd, nIndex)
If Show Then dwNewLong = (dwLong Or WS_CAPTION) Else dwNewLong = (dwLong And Not WS_CAPTION) End If
Call SetWindowLong(hwnd, nIndex, dwNewLong) Call SetWindowPos(hwnd, 0&, 0&, 0&, 0&, 0&, wFlags) End Function ' Code End ' *************
Sample calls To turn off title bar Call AccessTitleBar(False)
To turn on title bar Call AccessTitleBar(True)
Thanks Terry,
Any downside to this?
DS
On Mon, 24 Jan 2005 11:08:10 -0000, "Terry Kreft"
<te*********@mps.co.uk> wrote: You need to use API calls to do this, You can try the following.
<snip>
I stand corrected by the master!
David
Not that I can see, but I haven't extensively tested this code, it certainly
shouldn't be harmful.
The user can still use Alt+F4 to close the app (unless your doing anything
with forms to prevent that).
--
Terry Kreft
MVP Microsoft Access
"DS" <bo******@optonline.net> wrote in message
news:x6*************@fe08.lga... Terry Kreft wrote:
You ned to use API calls to do this, You can try the following.
Paste the following code to a standard module.
' ************* ' Code Start Option Explicit
Private Const GWL_STYLE = (-16) Private Const WS_CAPTION = &HC00000
Private Const SWP_NOSIZE = &H1 Private Const SWP_NOZORDER = &H4 Public Const SWP_FRAMECHANGED = &H20
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 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 AccessTitleBar(Show As Boolean) As Long Dim hwnd As Long Dim nIndex As Long Dim dwNewLong As Long Dim dwLong As Long Dim wFlags As Long
hwnd = hWndAccessApp nIndex = GWL_STYLE wFlags = SWP_NOSIZE + SWP_NOZORDER + SWP_FRAMECHANGED
dwLong = GetWindowLong(hwnd, nIndex)
If Show Then dwNewLong = (dwLong Or WS_CAPTION) Else dwNewLong = (dwLong And Not WS_CAPTION) End If
Call SetWindowLong(hwnd, nIndex, dwNewLong) Call SetWindowPos(hwnd, 0&, 0&, 0&, 0&, 0&, wFlags) End Function ' Code End ' *************
Sample calls To turn off title bar Call AccessTitleBar(False)
To turn on title bar Call AccessTitleBar(True) Thanks Terry, Any downside to this? DS
David,
The trick in this is using SetWindowPos to get the frame to repaint, that
was something shown to me by the real master Ken Getz a few years back.
--
Terry Kreft
MVP Microsoft Access
"David Schofield" <d.***************@blueyonder.co.uk> wrote in message
news:41f53f8d.2927920@localhost... On Mon, 24 Jan 2005 11:08:10 -0000, "Terry Kreft" <te*********@mps.co.uk> wrote:
You need to use API calls to do this, You can try the following.
<snip>
I stand corrected by the master! David
Salad,
Thanks for testing.
After your last post I went back and had a look and noticed a very small
jump to the right and down without the SWP_NOMOVE. This is probably just
enough in WinXP to cover the toolbar when it's hidden.
--
Terry Kreft
MVP Microsoft Access
"Salad" <oi*@vinegar.com> wrote in message
news:hz*****************@newsread1.news.pas.earthl ink.net... Terry Kreft wrote:
Salad, Thanks for this, I actually missed a flag on the SetWindowPos call.
Could you add in the declarations section
Private Const SWP_NOMOVE = &H2
and then change
wFlags = SWP_NOSIZE + SWP_NOZORDER + SWP_FRAMECHANGED
to wFlags = SWP_NOSIZE + SWP_NOZORDER + SWP_FRAMECHANGED + SWP_NOMOVE
and see if that makes a difference?
It works correctly in Win2000 pro anyway.
Works like a champ!
Terry Kreft wrote: Salad, Thanks for testing.
After your last post I went back and had a look and noticed a very small jump to the right and down without the SWP_NOMOVE. This is probably just enough in WinXP to cover the toolbar when it's hidden.
Yes. It went down and covered up that area...just slightly.
Like I say, a slick routine. I have, sometimes, 2 apps at a site; 1 for
production and another for testing. I'd hate to have someone working
away in Production when testing and visa versa so I know I'd not want to
remove that title bar. But for someone desiring the removal, very cool. This discussion thread is closed Replies have been disabled for this discussion. Similar topics
5 posts
views
Thread by Steve |
last post: by
|
3 posts
views
Thread by alex |
last post: by
|
7 posts
views
Thread by FP |
last post: by
|
5 posts
views
Thread by ali |
last post: by
| |
6 posts
views
Thread by Ralph |
last post: by
| | | | | | | | | | | | | |