-
hi, i want to position my form in the top part of the screen. i want my form to be in the width of the screen's resulotion and the height of 60 pixels. and i also want that the whole screen will kind of shrink, meaning that my form will be at the top of screen and the regular windows desktop and work area will be right underneath as a separate part (for an example, when u move the ICQ window to the left or to the right it strechts itself and makes the work area smaller, like when maximizing an Explorer window, it maximizes without covering the ICQ window)
can somebody please help me on this, i'm trying to make this for weeks without success. thank !
-
You have to get the handle to the desktop window.
Then you can try using the API SetWindowPlacement function to resize it using a WINDOWPLACEMENT structure.
I'm not so sure this will work with the desktop window.
Code:
type WINDOWPLACEMENT
length As long
flags As long
showCmd As long
ptMinPosition As APIPOINT
ptMaxPosition As APIPOINT
rcNormalPosition As RECT
End Type ' 44 bytes
Length is the len of the structure = 44
Use the SW_SHOW constant for the showCmd param.
Try WPF_RESTORETOMAXIMIZED for flags.
Close anyway - use the API Viewer add-in for exact def.
Fill this struct with the info you want and then call the SetWindowPlacement function.
I don't have time right now to try this so tell me if it works. :D
Gotta run.