I want to make a form that looks and behaves like the Windows Task bar or the MS Office Toolbar. I don't know how to make it so other applications will not use that screen space like the Taskbar does.
Suggestions?
Printable View
I want to make a form that looks and behaves like the Windows Task bar or the MS Office Toolbar. I don't know how to make it so other applications will not use that screen space like the Taskbar does.
Suggestions?
Code:'to make form stay topmost
'put this in a bas module
'
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
Global Const SWP_NOMOVE = 2
Global Const SWP_NOSIZE = 1
Global Const FLAGS = SWP_NOMOVE Or SWP_NOSIZE
Global Const HWND_TOPMOST = -1
Global Const HWND_NOTOPMOST = -2
'=============================================
'
'put this in events click or load or whatever
'or hardcopy
'To set Form1 as a TopMost form, do the following:
res& = SetWindowPos (Form1.hWnd, HWND_TOPMOST, _
0, 0, 0, 0, FLAGS)
'if res&=0, there is an error
'To turn off topmost (make the form act normal again):
res& = SetWindowPos (Form1.hWnd, HWND_NOTOPMOST, _
0, 0, 0, 0, FLAGS)
Yes, that will make it always on top, but the other applications will still sit under it. I want it so if, for example, I maximise a window, I will still see the form at the top and the taskbar at the bottom and neither will cover the maximised application.
Any Ideas?
You will need to set the window positons.
A good place to begin.
http://www.vbapi.com/