|
-
Jul 13th, 2000, 07:36 PM
#1
Thread Starter
Junior Member
Can someone direct me to a site or code that explains how to dock my program on *any* side of the screen? Something similar to ICQ where it pushes the desktop to the side. I think is has something to do with the registry, but I could be wrong.
-
Jul 13th, 2000, 08:11 PM
#2
Lively Member
hi,
fist of all, you will need to set the form to stick to one of the screen sides.
to do that you will need to do this:
to stick to the right:
in a timer control:
private sub timer1_timer()
form1.left=screen.width-form1.left
end sub
to stick to the left:
in a timer control:
private sub timer1_timer()
form1.left=0
end sub
to stick to the top:
in a timer control:
private sub timer1_timer()
form1.top=0
end sub
to stick to the bottom:
in a timer control:
private sub timer1_timer()
form1.top = screen.height - form1.height
end sub
the timer must be at interval=1
now to set the workspace so that the programs and all desktop and all worspace will de as you wish:
in a module:
'the rest here in a module
Public Const SPI_SetWorkArea = 47
Public Const SPI_GetWorkArea = 48
Public Declare Function SystemParametersInfo Lib "user32" Alias "SystemParametersInfoA" (ByVal uAction As Long, ByVal uParam As Long, ByRef lpvParam As Any, ByVal fuWinIni As Long) As Long
Public Type tCoord2D
left As Long
top As Long
right As Long
bottom As Long
End Type
Public Function ChangeWorkArea(top As Integer, bottom As Integer, left As Integer, right As Integer)
Dim Rect As tCoord2D
Rect.top = top
Rect.left = left
Rect.right = right
Rect.bottom = bottom
SystemParametersInfo SPI_SetWorkArea, 0, Rect, 0
End Function
some where:
Call ChangeWorkArea(0, Screen.Height / Screen.TwipsPerPixelY, 0, Screen.Width / Screen.TwipsPerPixelX)
do some tests with these functions to understand them,
ok hoped i helped, bye.
-
Jul 13th, 2000, 08:21 PM
#3
Fanatic Member
What your after is an Application Toolbar
(AppBar for short) check out the microsoft site for further info, sorry but i cannot remember the url
DocZaf
{;->
-
Jul 13th, 2000, 11:31 PM
#4
Code:
Declare Function GetClassName Lib "user32" Alias "GetClassNameA" (ByVal hwnd As Long, ByVal lpClassName As String, ByVal nMaxCount As Long) As Long
Declare Function GetWindowRect Lib "user32" (ByVal hwnd As Long, lpRect As RECT) As Long
Type RECT
Left As Long
Top As Long
Right As Long
Bottom As Long
End Type
Dim StartMenu As Long
Dim What As RECT
Public Sub BorderToRight(FormName As Form)
For TempNum = 1 To 999
TempString$ = Space$(128)
TempNum2 = GetClassName(TempNum, TempString$, 128)
TempNum3 = Left$(TempString, TempNum2)
If LCase(TempNum3) = "shell_traywnd" Then Goto StartMenuFound
Next TempNum
StartMenuFound:
GetWindowRect TempNum, What
StartMenu = What.Top * 15
FormName.Move Screen.Width - FormName.Width, 0, FormName.Width, StartMenu
End Sub
Usage:
BorderToRight Me
-
Jul 14th, 2000, 03:37 AM
#5
Thread Starter
Junior Member
That just moves the form to the right. I need it to resize the desktop. Ever seen the Microsoft Office Toolbar? It sits at the top and the desktop is resised to fit under it.
-
Jul 14th, 2000, 02:18 PM
#6
Lively Member
hey!!!
i wrote u how to do that( resize the desktop)
here is the code again:
in a module:
'the rest here in a module
Public Const SPI_SetWorkArea = 47
Public Const SPI_GetWorkArea = 48
Public Declare Function SystemParametersInfo Lib "user32" Alias "SystemParametersInfoA" (ByVal uAction As Long, ByVal uParam As Long, ByRef lpvParam As Any, ByVal fuWinIni As Long) As Long
Public Type tCoord2D
left As Long
top As Long
right As Long
bottom As Long
End Type
Public Function ChangeWorkArea(top As Integer, bottom As Integer, left As Integer, right As Integer)
Dim Rect As tCoord2D
Rect.top = top
Rect.left = left
Rect.right = right
Rect.bottom = bottom
SystemParametersInfo SPI_SetWorkArea, 0, Rect, 0
End Function
some where:
Call ChangeWorkArea(0, Screen.Height / Screen.TwipsPerPixelY, 0, Screen.Width / Screen.TwipsPerPixelX)
do some tests with these functions to understand them,
ok hoped i helped, bye.
-
Jul 14th, 2000, 03:13 PM
#7
Thread Starter
Junior Member
For some reason the code doesn't resize the desktop. <shrug>
-
Jul 14th, 2000, 03:23 PM
#8
Thread Starter
Junior Member
Ok this is weird. It *does* resize the screen, but doesn't show it until I resise all of the open windows.
-
Jul 14th, 2000, 04:38 PM
#9
Lively Member
ohh,
sorry i really dont know why that is, i will try to fix it, give me some time though...
bye,
yair
Posting Permissions
- You may not post new threads
- You may not post replies
- You may not post attachments
- You may not edit your posts
-
Forum Rules
|
Click Here to Expand Forum to Full Width
|