Link to home
Start Free TrialLog in
Avatar of mwam
mwam

asked on

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 :)
Avatar of MikeP090797
MikeP090797

'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)
Avatar of mwam

ASKER

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"


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

waty, read my answer again please. Try changing the 3rd parameter in the declare to RECT
Avatar of mwam

ASKER

tried that..still doesn't work.
ASKER CERTIFIED SOLUTION
Avatar of MikeP090797
MikeP090797

Link to home
membership
This solution is only available to members.
To access this solution, you must be a member of Experts Exchange.
Start Free Trial
Avatar of mwam

ASKER

ahh....it works :)...at first didn't see that the declare was
different. ..thanks much
He, That's the delcaration I have given you, I had tested it and worked.

I have given the answer before MikeP.
Avatar of mwam

ASKER

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 :)
My declaration is different
Avatar of mwam

ASKER

ok....anyone know where i can get an updated api32.txt ?