hide the taskbar window

ajetrumpet

Banned
Local time
Today, 00:48
Joined
Jun 22, 2007
Messages
5,638
Folks,

I have a small application with one dialog form. I have turned off everything that keeps a user from accessing the access window except one thing: the taskbar window selector. Does anyone know how to make this invisible when the application starts?

My dialog form stays on top of all the other windows, the close button is disabled, and the exit option in the menu is also disabled. However, if a user clicks on the access window in the taskbar at the bottom of the screen even once, from then on, whenever the form receives the focus again the access application window appears again. I would like to prevent this from happening. Thanks! Any advice certainly appreciated!
 
"Windows in Taskbar" is one of the options you can set in the menu Tools|Options|View.

or you can execute the following line
Code:
Application.SetOption "ShowWindowsInTaskbar", false
Using this code you can't activate each window separate.

HTH:D
 
thanks Guus. That didn't do it, as I think I have changed that before. The access window still appears in the windows taskbar. As a matter of fact, this option only applies to the database objects, as I just checked on it. The access application window is apparently treated differently.

Do you have any other suggestions? I am using windows vista, and I'm hoping that has nothing to do with it here.
 
You want to completely remove Access from the Taskbar?
I don't know how to accomplish that, sorry.
 
reasons to be cheerfull pt. 1

Perhaps this might help??

It suppresses the Access window alltogether...

Enjoy!
Code:
Option Compare Database
Option Explicit

Private Const GWL_STYLE = (-16)
Private Const WS_CAPTION = &HC00000
Private Const WS_MINIMIZEBOX = &H20000
Private Const WS_MAXIMIZEBOX = &H10000
Private Const WS_SYSMENU = &H80000

Private Const SWP_NOSIZE = &H1
Private Const SWP_NOMOVE = &H2
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
' **************************************************

Public 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 + SWP_NOMOVE

  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

Public Function Buttons(Show As Boolean) As Long
  Dim hwnd As Long
  Dim nIndex As Long
  Dim dwNewLong As Long
  Dim dwLong As Long

  hwnd = hWndAccessApp
  nIndex = GWL_STYLE

  Const wFlags = SWP_NOSIZE + SWP_NOZORDER + SWP_FRAMECHANGED + SWP_NOMOVE
  Const FLAGS_COMBI = WS_MINIMIZEBOX Or WS_MAXIMIZEBOX Or WS_SYSMENU

  dwLong = GetWindowLong(hwnd, nIndex)

  If Show Then
    dwNewLong = (dwLong Or FLAGS_COMBI)
  Else
    dwNewLong = (dwLong And Not FLAGS_COMBI)
  End If

  Call SetWindowLong(hwnd, nIndex, dwNewLong)
  Call SetWindowPos(hwnd, 0&, 0&, 0&, 0&, 0&, wFlags)
End Function
 
I already have that function Guus. I posted it in the code repository too. Thanks though! This problem has been solved. I came up with a workaround. As soon as it's approved, you'll be able to see it in the repository. :)
 

Users who are viewing this thread

Back
Top Bottom