Opened 17 years ago
Closed 14 years ago
#998 closed Feature Request (Rejected)
@VirtualDesktopWidth + @VirtualDesktopHeight + @DesktopMonitors
| Reported by: | Zedna | Owned by: | Valik |
|---|---|---|---|
| Milestone: | Component: | AutoIt | |
| Version: | Severity: | None | |
| Keywords: | Cc: |
Description
According to this topic
http://www.autoitscript.com/forum/index.php?showtopic=48530&st=15&p=367172&#entry367172
It will be good to add new macros
@VirtualDesktopWidth
@VirtualDesktopHeight
for multi monitor machines.
$SM_CXVIRTUALSCREEN = 78
$SM_CYVIRTUALSCREEN = 79
$VirtualDesktopWidth = DLLCall("user32.dll", "int", "GetSystemMetrics", "int", $SM_CXVIRTUALSCREEN)
$VirtualDesktopWidth = $VirtualDesktopWidth[0]
$VirtualDesktopHeight = DLLCall("user32.dll", "int", "GetSystemMetrics", "int", $SM_CYVIRTUALSCREEN)
$VirtualDesktopHeight = $VirtualDesktopHeight[0]
Maybe also:
@DesktopMonitors - number of display monitors on a desktop
$SM_CMONITORS = 80
$DesktopMonitors = DLLCall("user32.dll", "int", "GetSystemMetrics", "int", $SM_CMONITORS)
$DesktopMonitors = $DesktopMonitors[0]
MSDN link for GetSystemMetrics:
http://msdn.microsoft.com/en-us/library/ms724385(VS.85).aspx
Attachments (0)
Change History (10)
comment:1 by , 17 years ago
comment:2 by , 17 years ago
@Valik
I don't agree.
I think functions/macros/etc that may be widely/often used by scripters could be implemented as native ones.
But this is up to developers so what is general opinion of all/other developers on this?
follow-up: 4 comment:3 by , 17 years ago
Why, Zedna? So we can bloat the language with crap that anybody can implement themselves in 3 minutes?
Fundamentally you shouldn't care how a feature is implemented as long as it is available for you to use.
comment:4 by , 17 years ago
Replying to Valik:
Why, Zedna? So we can bloat the language with crap that anybody can implement themselves in 3 minutes?
Fundamentally you shouldn't care how a feature is implemented as long as it is available for you to use.
I know what you mean and particularly I agree but consider
@DesktopWidth + @DesktopHeight - it's too simple "one line" UDF code but it's native.
I didn't mean to implement all stuff from GetSystemMetrics API, just above mentioned ones.
comment:5 by , 17 years ago
Your argument doesn't hold water. Back when those macros were added we didn't know what we were doing. There was no extensive UDF library back then. It was either built-in or you had to write it yourself. Now we have a rich UDF library which we take submissions to. Somebody can very easily sit down and write a "SystemInformation.au3" UDF library, fill it full of all kinds of useful functions (including duplicate many of the macros) and we'll have a very nice function-based library for getting system information. That would allow us to remove some macros that don't make sense to have as macros while causing no loss in functionality. Just a change in syntax. Back when the macros you mention were added, this wasn't an option.
comment:6 by , 17 years ago
OK Valik. I will not tease you here with my different opinion anymore :-)
Rather I will post here submission for it as UDF - but not in way of whole "SystemInformation.au3" UDF library.
Thanks for all information provided.
It's good to know what kind of improvement we can expect/participate in AutoIt.
comment:7 by , 17 years ago
Those macroes cannot be a good way to validate the positionning of a windows as multiple windows can have different size.
I will suggest we add a new function that can validate if x,y,w,h windows can be displayed
comment:8 by , 16 years ago
| Owner: | set to |
|---|---|
| Status: | new → assigned |
comment:9 by , 14 years ago
Example of how to achieve this with the WinAPI.au3 UDF >> http://www.autoitscript.com/forum/topic/134534-desktopdimensions-details-about-the-primary-and-secondary-monitors/
comment:10 by , 14 years ago
| Resolution: | → Rejected |
|---|---|
| Status: | assigned → closed |
This is clearly UDF's job. Thank you guinness.

I would rather see these implemented as UDFs. I think we should move away from macros in favor of functions particularly when it comes to what are essentially one-liners. AutoIt built-in stuff should be about doing things that it's hard to do using AutoIt. Not about providing all kinds of macros for things that are trivial.