Thread Rating:
  • 0 Vote(s) - 0 Average
  • 1
  • 2
  • 3
  • 4
  • 5
set desktop area
#1
how can i set desktop areas with qm ?

these areas must be dominant, so that every! window maximizes only
to the given value.

i don't use explorer as windows shell, but the information about where
the windows taskbar was placed last is for some programs resistand.

mmh, maybe its only a reg key to manipulate ?
pi
#2
Code:
Copy      Help
[color=green];warning: this may reorder desktop icons[/color]

[color=blue]def [/color]SPI_SETWORKAREA  47
[color=blue]def [/color]SPIF_SENDCHANGE  0x2
[color=blue]def [/color]SPIF_UPDATEINIFILE  0x1

RECT r
r.left=200
r.right=ScreenWidth-200
r.bottom=ScreenHeight-25

SystemParametersInfo(SPI_SETWORKAREA 0 &r SPIF_SENDCHANGE)

[color=green];to restore, drag taskbar to some other edge
[/color]
#3
Code:
Copy      Help
that is very, very nice!

Code:
Copy      Help
1
key Wm

1
max _hwndqm
;:)

what is key Wm doing ? it's unmapped when using bblean.

can this be extented to two screens ?
pi
#4
From MSDN:

Quote:Sets the size of the work area. The work area is the portion of the screen not obscured by the system taskbar or by application desktop toolbars. The pvParam parameter is a pointer to a RECT structure that specifies the new work area rectangle, expressed in virtual screen coordinates. In a system with multiple display monitors, the function sets the work area of the monitor that contains the specified rectangle.
If pvParam is NULL, the function sets the work area of the primary display monitor to the full screen.
#5
do i get you right ?

Code:
Copy      Help
RECT screen1
screen1.left=24
screen1.top=19
screen1.right=1600
screen1.bottom=1200

SystemParametersInfo(SPI_SETWORKAREA 0 &screen1 SPIF_SENDCHANGE)

RECT screen2
screen2.left=0
screen2.top=19
screen2.right=1200
screen2.bottom=768

SystemParametersInfo(SPI_SETWORKAREA 1 &screen2 SPIF_SENDCHANGE)

SystemParametersInfo
pi
#6
I didn't tested, but I think you aren't right. Virtual screen surrounds all monitors. Coordinate 0,0 is at top-left of primary monitor. For example, if second monitor is mapped above, then screen2.top should be -748, and screen2.bottom = 0. Second argument should be always 0, and monitor is selected automatically, based on given coordinates. But maybe I'm not right.

To get monitor coordinates, use GetMonitorInfo. To get monitor handle, use EnumDisplayMonitors or some other function from this family.
#7
wow. i discover a new world Confusedhock:

http://msdn.microsoft.com/library/defau ... etrics.asp

int i = GetSystemMetrics(SM_CXFULLSCREEN)
out i

:!:
pi
#8
old thread but similar question.

how do i tell all windows on my second screen to maximize only to a given area?

windows till vista (have not checked on Seven) has the stupid bug,
where when taskbar is on top and also set to stay on top,
that many windows still start on 0 0.
so their whole caption bar is under the taskbar.
i still have an old qm solution enabled where i press win+Arrow to move the active window.

for a while i had a trigger for every new window,
checking if it is on y under taskbar height and moved it then.

i have seen a tool for something similar.
how do i set desktop areas for individual programs?
like firefox is only allowed to maximize to 1500*1000.
pi
#9
For all programs - set work area. If it is what you need but you don't know how, I'll try to give example.
For some programs - don't know. Use triggers or timers.
#10
Gintaras Wrote:For all programs - set work area. If it is what you need but you don't know how, I'll try to give example.
For some programs - don't know. Use triggers or timers.

an example how to set different work areas for 2 screens would be cool.

1: 20 26 1400 1050
2: 80 50 1000 1100
pi
#11
Function SetWorkArea
Code:
Copy      Help
;/
function monitor marginLeft marginTop marginRigt marginBottom [flags] ;;flags: 1 resize maximized windows

;Sets work area. It is the area where windows are maximized.

;monitor - 0 primary, 1-30 index, -1 mouse, -2 active window, -3 primary, or window handle.
;marginX - margin width in pixels.


RECT r
int hmon=MonitorFromIndex(monitor 0 &r)
r.left+marginLeft
r.top+marginTop
r.right-marginRigt
r.bottom-marginBottom

if(!SystemParametersInfo(SPI_SETWORKAREA 0 &r SPIF_SENDCHANGE)) ret

if(flags&1)
,ARRAY(int) a; int i
,win "" "" "" 0 0 0 a
,for i 0 a.len
,,int h=a[i]
,,if(!max(h) or MonitorFromWindow(h 0)!=hmon) continue
,,res h; max h


Forum Jump:


Users browsing this thread: 1 Guest(s)