INTELLIGENT WORK FORUMS
FOR COMPUTER PROFESSIONALS

Log In

Come Join Us!

Are you a
Computer / IT professional?
Join Tek-Tips Forums!
  • Talk With Other Members
  • Be Notified Of Responses
    To Your Posts
  • Keyword Search
  • One-Click Access To Your
    Favorite Forums
  • Automated Signatures
    On Your Posts
  • Best Of All, It's Free!

*Tek-Tips's functionality depends on members receiving e-mail. By joining you are opting in to receive e-mail.

Posting Guidelines

Promoting, selling, recruiting, coursework and thesis posting is forbidden.

Jobs

Show Access app window but hide its taskbar button

Show Access app window but hide its taskbar button

(OP)
I have an Access 2003 db on win XP.

I’m trying to write code that will allow the Access application window to remain visible whilst hiding its taskbar button.

To clarify, if necessary, the Access application window visible is its natural state and I don’t want to change that. I just want to hide its taskbar button for that instance of Access. So if user opens another db whilst the hidden button one is open, the new db will be as normal ie taskbar icon visible & the hidden one will stay hidden.

I’ve posted the code I’m trying to adapt to achieve this below. I need the final code to be as robust as possible, it must work with Access 2003 / win XP and preferable on up through 2007 etc.

Any help would be very much appreciated.

CODE -->

Option Compare Database
Option Explicit

Private Const WM_USER As Long = &H400
Private Const TB_HIDEBUTTON As Long = (WM_USER + 4)
Private Const TB_ISBUTTONHIDDEN As Long = (WM_USER + 12)
Private Const TB_DELETEBUTTON As Long = (WM_USER + 22)
Private Const TB_GETBUTTON As Long = (WM_USER + 23)
Private Const TB_BUTTONCOUNT = (WM_USER + 24)
Private Const TB_GETBUTTONTEXTA As Long = (WM_USER + 45)
Private Const TB_GETBUTTONTEXTW As Long = (WM_USER + 75)
Private Const TB_AUTOSIZE As Long = (WM_USER + 33)

Private Declare Function FindWindow Lib "user32" Alias "FindWindowA" (ByVal lpClassName As String, ByVal lpWindowName As String) As Long
Private Declare Function FindWindowEx Lib "user32" Alias "FindWindowExA" (ByVal hWnd1 As Long, ByVal hWnd2 As Long, ByVal lpsz1 As String, ByVal lpsz2 As String) As Long
Private Declare Function SendMessage Lib "user32" Alias "SendMessageA" (ByVal hwnd As Long, ByVal wMsg As Long, ByVal wParam As Long, ByVal lParam As String) As Long

Private tWnd As Long

        
Private Sub Command1_Click()
    Dim bWnd As Long
  
    tWnd = FindWindow("Shell_TrayWnd", vbNullString)
    bWnd = FindWindowEx(tWnd, bWnd, "BUTTON", vbNullString) 'Start button handle

    tWnd = FindWindowEx(tWnd, 0, "ReBarWindow32", vbNullString)
    tWnd = FindWindowEx(tWnd, 0, "MsTaskSwWClass", vbNullString)
    tWnd = FindWindowEx(tWnd, 0, "ToolbarWindow32", vbNullString)  'Taskbar handle

    SendMessage tWnd, TB_BUTTONCOUNT, 0, 0
    
    SendMessage tWnd, TB_HIDEBUTTON, 1, 0
End Sub 

Red Flag This Post

Please let us know here why this post is inappropriate. Reasons such as off-topic, duplicates, flames, illegal, vulgar, or students posting their homework.

Red Flag Submitted

Thank you for helping keep Tek-Tips Forums free from inappropriate posts.
The Tek-Tips staff will check this out and take appropriate action.

Reply To This Thread

Posting in the Tek-Tips forums is a member-only feature.

Click Here to join Tek-Tips and talk with other members!

Resources

Close Box

Join Tek-Tips® Today!

Join your peers on the Internet's largest technical computer professional community.
It's easy to join and it's free.

Here's Why Members Love Tek-Tips Forums:

Register now while it's still free!

Already a member? Close this window and log in.

Join Us             Close