Tek-Tips is the largest IT community on the Internet today!

Members share and learn making Tek-Tips Forums the best source of peer-reviewed technical information on the Internet!

  • Congratulations strongm on being selected by the Tek-Tips community for having the most helpful posts in the forums last week. Way to Go!

Subdivide screen 2

Status
Not open for further replies.

fordtran

Programmer
Jun 15, 2005
101
ZA
I wish to run a very narrow reminders program on the right hand side of my screen in such a way that other programs (or windows) that are opened subsequently must not show over (cover)my reminders window. Even if my reminders window is not active or does not have the focus it should show fully.
I suppose I will have to subdivide the screen or have some routine that makes the subsequent windows smaller.
Can somebody help
Thanks

fordtran
 
Set these in a module
Code:
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 HWND_TOPMOST = -1
Public Const SWP_NOSIZE = &H1
Public Const SWP_NOMOVE = &H2
And then in the Form_Activate event
Code:
Call SetWindowPos(Me.hwnd, HWND_TOPMOST, 0, 0, 0, 0, SWP_NOSIZE Or SWP_NOMOVE)
Documentation for SetWindowPos is here.
 
There is a special type of window (very poorly documented) that does this sort of thing - like the Office fast start window for example - a dockable toolbar for the desktop. I am nowwhere near my development machines or notes or anything, so can't remember the techinial term off the top of my head to advise for a Google.

Suffice to say that it is reasonably easy to implement
 
Thanks also strongm. Your solution is more like the one I want as the previousa option covers part of the window underneath. If you can perhaps look for some further hints I will appreciate.
Thanks


fordtran
 
What you want to look up are System Appbars - the main API call that supports this is SHAppBarMessage
 
Another useful tidbit to add to my archive. Thanks again, strongm!

Tracy Dryden

Meddle not in the affairs of dragons,
For you are crunchy, and good with mustard. [dragon]
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top