Solved

setting desktop work area

Posted on 1998-09-01
11
769 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
 
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
Is Your Active Directory as Secure as You Think?

More than 75% of all records are compromised because of the loss or theft of a privileged credential. Experts have been exploring Active Directory infrastructure to identify key threats and establish best practices for keeping data safe. Attend this month’s webinar to learn more.

 
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

Is Your Active Directory as Secure as You Think?

More than 75% of all records are compromised because of the loss or theft of a privileged credential. Experts have been exploring Active Directory infrastructure to identify key threats and establish best practices for keeping data safe. Attend this month’s webinar to learn more.

Question has a verified solution.

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

Suggested Solutions

Title # Comments Views Activity
Problem to skip loop 6 55
Validating VB6 Function 19 56
Excel VBA, find a string in a column, update a cell 7 68
Help me. 3 48
Introduction While answering a recent question about filtering a custom class collection, I realized that this could be accomplished with very little code by using the ScriptControl (SC) library.  This article will introduce you to the SC library a…
If you have ever used Microsoft Word then you know that it has a good spell checker and it may have occurred to you that the ability to check spelling might be a nice piece of functionality to add to certain applications of yours. Well the code that…
Get people started with the process of using Access VBA to control Excel using automation, Microsoft Access can control other applications. An example is the ability to programmatically talk to Excel. Using automation, an Access application can laun…
This lesson covers basic error handling code in Microsoft Excel using VBA. This is the first lesson in a 3-part series that uses code to loop through an Excel spreadsheet in VBA and then fix errors, taking advantage of error handling code. This l…

862 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

Need Help in Real-Time?

Connect with top rated Experts

28 Experts available now in Live!

Get 1:1 Help Now