Solved

setting desktop work area

Posted on 1998-09-01
11
771 Views
Last Modified: 2012-08-14
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 :)
0
Comment
Question by:mwam
  • 5
  • 4
  • 2
11 Comments
 
LVL 8

Expert Comment

by:MikeP090797
ID: 1432452
'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
 

Author Comment

by:mwam
ID: 1432453
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
 
LVL 14

Expert Comment

by:waty
ID: 1432454
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
Free Tool: Port Scanner

Check which ports are open to the outside world. Helps make sure that your firewall rules are working as intended.

One of a set of tools we are providing to everyone as a way of saying thank you for being a part of the community.

 
LVL 8

Expert Comment

by:MikeP090797
ID: 1432455
waty, read my answer again please. Try changing the 3rd parameter in the declare to RECT
0
 

Author Comment

by:mwam
ID: 1432456
tried that..still doesn't work.
0
 
LVL 8

Accepted Solution

by:
MikeP090797 earned 200 total points
ID: 1432457
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
 

Author Comment

by:mwam
ID: 1432458
ahh....it works :)...at first didn't see that the declare was
different. ..thanks much
0
 
LVL 14

Expert Comment

by:waty
ID: 1432459
He, That's the delcaration I have given you, I had tested it and worked.

I have given the answer before MikeP.
0
 

Author Comment

by:mwam
ID: 1432460
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
 
LVL 8

Expert Comment

by:MikeP090797
ID: 1432461
My declaration is different
0
 

Author Comment

by:mwam
ID: 1432462
ok....anyone know where i can get an updated api32.txt ?
0

Featured Post

Free Tool: Subnet Calculator

The subnet calculator helps you design networks by taking an IP address and network mask and returning information such as network, broadcast address, and host range.

One of a set of tools we're offering as a way of saying thank you for being a part of the community.

Question has a verified solution.

If you are experiencing a similar issue, please ask a related question

Suggested Solutions

There are many ways to remove duplicate entries in an SQL or Access database. Most make you temporarily insert an ID field, make a temp table and copy data back and forth, and/or are slow. Here is an easy way in VB6 using ADO to remove duplicate row…
Most everyone who has done any programming in VB6 knows that you can do something in code like Debug.Print MyVar and that when the program runs from the IDE, the value of MyVar will be displayed in the Immediate Window. Less well known is Debug.Asse…
Get people started with the utilization of class modules. Class modules can be a powerful tool in Microsoft Access. They allow you to create self-contained objects that encapsulate functionality. They can easily hide the complexity of a process from…
Show developers how to use a criteria form to limit the data that appears on an Access report. It is a common requirement that users can specify the criteria for a report at runtime. The easiest way to accomplish this is using a criteria form that a…

828 members asked questions and received personalized solutions in the past 7 days.

Join the community of 500,000 technology professionals and ask your questions.

Join & Ask a Question