setting desktop work area

hi...in the SystemParametersInfo call there's a
parameter called "SPI_SETWORKAREA". its used to set the
usable desktop area not including the system tray.
i need a complete example of how i can use this to fit
my own needs. example must leave nothing to my feeble
imagination...thats why its worth 200 pts. thanks :)
mwamAsked:
Who is Participating?
 
MikeP090797Commented:
Try this one, it works, tested it:

Declare Function SystemParametersInfo Lib "user32" Alias "SystemParametersInfoA" (ByVal uAction As Long, ByVal uParam As Long, lpvParam As Any, ByVal fuWinIni As Long) As Long
0
 
MikeP090797Commented:
'Put this is a module
Public Const SPI_SETWORKAREA = 47
Type RECT
        Left As Long
        Top As Long
        Right As Long
        Bottom As Long
End Type

Declare Function SystemParametersInfo Lib "user32" Alias "SystemParametersInfoA" (ByVal uAction As Long, ByVal uParam As Long, ByVal lpvParam As Any, ByVal fuWinIni As Long) As Long

'Use this
Dim n as long
Dim rct as RECT
'Fill RECT with coordinates
n=SystemParametersInfo(SPI_SETWORKAREA, 0, rct, 1)
0
 
mwamAuthor Commented:
must not be filling rectangle with coordinates correctly...this
is what i'm doing:

Dim n As Long
Dim rct As RECT
rct.Left = 100
rct.Top = 100
rct.Bottom = 700
rct.Right = 700
'Fill RECT with coordinates
n = SystemParametersInfo(SPI_SETWORKAREA, 0, rct, 1)

i get a compiler error...type mismatch on "rct"


0
Ultimate Tool Kit for Technology Solution Provider

Broken down into practical pointers and step-by-step instructions, the IT Service Excellence Tool Kit delivers expert advice for technology solution providers. Get your free copy now.

 
watyCommented:
you have to set the API as follow :

Declare Function SystemParametersInfo Lib "user32" Alias "SystemParametersInfoA" (ByVal uAction As Long, ByVal uParam As Long, lpvParam As Any, ByVal fuWinIni As Long) As Long

0
 
MikeP090797Commented:
waty, read my answer again please. Try changing the 3rd parameter in the declare to RECT
0
 
mwamAuthor Commented:
tried that..still doesn't work.
0
 
mwamAuthor Commented:
ahh....it works :)...at first didn't see that the declare was
different. ..thanks much
0
 
watyCommented:
He, That's the delcaration I have given you, I had tested it and worked.

I have given the answer before MikeP.
0
 
mwamAuthor Commented:
i see. i guess you deserve some points...but don't know
what can be done now. look for my next question, it'll
have your name in the subject.....thanks :)
0
 
MikeP090797Commented:
My declaration is different
0
 
mwamAuthor Commented:
ok....anyone know where i can get an updated api32.txt ?
0
Question has a verified solution.

Are you are experiencing a similar issue? Get a personalized answer when you ask a related question.

Have a better answer? Share it in a comment.

All Courses

From novice to tech pro — start learning today.