position Form outside of desktop / resize desktop

Bounty

New member
Joined
Dec 13, 2005
Messages
4
Programming Experience
3-5
I want my app. to be on top of all other windows without covering those other applications(topmost prop.). I remember seeing an application that positioned itself besides the desktop - the taskbar was moved to the left etc and other maximised applications didn't cover that one app.

Does anybody have a clue on how to achieve this? Thanks!
 
Ok, i made it working half-way : SHAppBarMessage registers my Form as Applicationbar with the desired effect. So i'm able to restrict other Forms of covering and lying under(case my Form is topmost) my Form, when they are maximised.

Retreiveing the Windows Taskbars Position etc also works, but what i couldn't work out is how to resize the Windows taskbar, so that my new appbar positioned on the right side of the desktop fits to the right position of the windows taskbar.

Retreiving Windows Taskbar Position:

------------
Private Declare Function SHAppBarMessage Lib "Shell32.dll" _
(ByVal dwMessage As Integer, ByRef pData As APPBARDATA) As Integer

Private Structure RECT
Public Left As Integer
Public Top As Integer
Public Right As Integer
Public Bottom As Integer
End Structure

Private Structure APPBARDATA
Public cbSize As Integer
Public hwnd As IntPtr
Public uCallbackMessage As IntPtr
Public uEdge As Integer
Public rc As RECT
Public lParam As Integer
End Structure
------------
------------
Dim WTBpos as APPBARDATA
Call SHAppBarMessage(ABM_GETTASKBARPOS, WTBpos)

now read out WTBpos. properties

------------
setting my Form as askbar works with:
------------
Dim MYTB as APPBARDATA


Call SHAppBarMessage(ABM_NEW, MYTB)

now set MYTB's .properties

Call SHAppBarMessage(ABM_SETPOS, MYTB)
------------

Unfortunately SHAppBarMessage(ABM_SETPOS, XXX) doesn't work with Windows Taskar...

Anybody has a clue? I can post a complete example if somebody is interested... just have to clean it up :)
 
Back
Top