Force userform to appear in taskbar?

shiv_379

Registered User.
Local time
Today, 05:52
Joined
May 7, 2004
Messages
13
Greetings all!
I was wondering if anyone could help me with a problem I have. I have a simple database which only uses one form. Because of the nature of the database I have minimised the main access window (using the wonderful fSetAccessWindow function) and set the form to popup and modal.
However, the form (or access) does not appear in the taskbar. This makes it difficult to switch between the other applications needed and the access userform.

Does anyone know a way I can force the userform to appear in the taskbar while still keeping a minimised access window?

Thanks!
-Toby
 
Could try this:
Code:
Public Declare Function SetWindowLong Lib "user32" Alias "SetWindowLongA" _
        (ByVal hWnd As Long, _
        ByVal nIndex As Long, _
        ByVal dwNewLong As Long) As Long
Public 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 Const WS_EX_APPWINDOW As Long = &H40000
Public Const WS_EX_TOOLWINDOW As Long = &H80
Public Const HWND_TOPMOST = -1
Public Const HWND_NOTOPMOST = -2
Public Const SWP_NOSIZE = &H1
Public Const SWP_NOMOVE = &H2
Public Const SWP_NOACTIVATE = &H10
Public Const SWP_SHOWWINDOW = &H40

Private Sub Form_Load()
Dim OldExStyle As Long

'force the window to appear in the taskbar
OldExStyle = SetWindowLong(Me.hWnd, GWL_EXSTYLE, GetWindowLong(Me.hWnd, GWL_EXSTYLE) Or WS_EX_APPWINDOW)
OldExStyle = SetWindowPos(Me.hWnd, HWND_NOTOPMOST, 0, 0, 0, 0, SWP_NOACTIVATE Or SWP_SHOWWINDOW Or SWP_NOMOVE Or SWP_NOSIZE)
End Sub
I've used it in a vb app, so you might be able to convert to work with access.
 

Users who are viewing this thread

Back
Top Bottom