Jump to content

_SplitMon:Window Mgmt Suite!


fisofo
 Share

Recommended Posts

Hi,

I wasn't expecting a new version quite this quick. excelent work :-)

Thanks for adding the resize feature. I have tried the seperate resizer.au3 script you posted which works great but the latest version of splitview bombs out :-(

Look like it fails when detecting my dual screen setup.

I have had a quick look at the code and found that it only detects one device

$ID = PCI\VEN_1002&DEV_4C66&SUBSYS_08600E11&REV_01\4&1BFA44D4&0&0008

in the following bit of code

CODE
; count the number of monitors and

; iterate through each monitor and populate the $results array

$i = 0

for $monitor in $slots

$ID = $monitor.PNPDeviceID

$i += 1

$results[$i]= $ID

ConsoleWrite($ID&@CRLF)

next

To get around this I am using Spliview version 1 and resizer

cheers

Yeah, I hadn't planned on adding the Resizer, but once I saw Larry's script, I knew it had to be done :)

Thanks for the info, I was kinda thinking that might happen, but had no way of testing. I'm going to put together a small testing script in the next two days to see if I can nail down how monitors are detected on systems... I'll post it here hopefully tuesday night and then perhaps with some input from the forum I can get the autodetect of monitors/settings to work.

Link to comment
Share on other sites

  • Replies 127
  • Created
  • Last Reply

Top Posters In This Topic

Top Posters In This Topic

EnumDisplayMonitorsEnumerates display monitors that intersect a region formed by the intersection of a specified clipping rectangle and the visible region of a device context.GetMonitorInfoRetrieves information about a display monitor.MonitorEnumProcAn application-defined callback function that is called by the EnumDisplayMonitors function.MonitorFromPointRetrieves a handle to the display monitor that contains a specified point.MonitorFromRectRetrieves a handle to the display monitor that has the largest area of intersection with a specified rectangle.MonitorFromWindowRetrieves a handle to the display monitor that has the largest area of intersection with the bounding rectangle of a specified window.

the last 3 can be used to get a handle to a monitor which can then be used with GetMonitorInfo

[u]Do more with pre-existing apps![/u]ANYGUIv2.8
Link to comment
Share on other sites

the last 3 can be used to get a handle to a monitor which can then be used with GetMonitorInfo

Finally some useful info, thanks quaizywabbit. I thought I had gone through the msdn, but I definitely missed that stuff. May take me awhile to figure out how to code it, but I'll get started when I can this week.

Link to comment
Share on other sites

I'm lost - What is the point and function of this script? What does it do?

Sometimes I feel like I'm taking crazy pills... was it really that hard to understand?

*Sigh* well, in any case, I have updated the description significantly, please let me know if it makes sense. And once you understand it, if you think I should change the way I've described it, please let me know. :

Link to comment
Share on other sites

Sorry for the frequent updates, I plan on leaving it as-is for awhile now and see how it works for people. Anyway, no functionality has been changed, see first post for details.

Link to comment
Share on other sites

Hi fisofo,

I have had to add the following line of code into your script to get the resizer code to work

$dll = DllOpen("user32.dll")

Otherwise, great work and thanks for having the enthusiasm to incorporate my resizer suggestion.

My Scripts[topic="73325"]_ReverseDNS()[/topic]Favourite scripts by other members[topic="81687"]SNMP udf[/topic][topic="70759"]Using SNMP - MIB protocol[/topic][topic="39050"]_SplitMon:Section off your monitor!, split your monitor into sections for easy management[/topic][topic="73425"]ZIP.au3 UDF in pure AutoIt[/topic][topic="10534"]WMI ScriptOMatic tool for AutoIt[/topic][topic="51103"]Resources UDF embed/use any data/files into/from AutoIt compiled EXE files[/topic]
Link to comment
Share on other sites

@fisofo

You need to add

$dll = "user32.dll"

Somewhere in that script.

My Programs:AInstall - Create a standalone installer for your programUnit Converter - Converts Length, Area, Volume, Weight, Temperature and Pressure to different unitsBinary Clock - Hours, minutes and seconds have 10 columns each to display timeAutoIt Editor - Code Editor with Syntax Highlighting.Laserix Editor & Player - Create, Edit and Play Laserix LevelsLyric Syncer - Create and use Synchronised Lyrics.Connect 4 - 2 Player Connect 4 Game (Local or Online!, Formatted Chat!!)MD5, SHA-1, SHA-256, Tiger and Whirlpool Hash Finder - Dictionary and Brute Force FindCool Text Client - Create Rendered ImageMy UDF's:GUI Enhance - Enhance your GUIs visually.IDEA File Encryption - Encrypt and decrypt files easily! File Rename - Rename files easilyRC4 Text Encryption - Encrypt text using the RC4 AlgorithmPrime Number - Check if a number is primeString Remove - remove lots of strings at onceProgress Bar - made easySound UDF - Play, Pause, Resume, Seek and Stop.
Link to comment
Share on other sites

A very nice program. It is a pity that I can't get it work properly with Windows Vista.

Thanks! I was under the impression that most autoIt code worked under Vista, but if it doesn't I'm afraid I can't troubleshoot for now. Give me a few months until I get Vista from work, then I'll definitely figure it out :)

Link to comment
Share on other sites

:)

I have used your script in my application. A user asked if it was possible to 'remember' the windows original position & size.

Just put 2 extra lines in _NewWinMove and 'voila'.

CODE
Func _NewWinMove($hWindow, $xPos, $yPos, $nWidth, $nHeight)

If $Maximized Then

Dim $rcNormalPosition[4] = [$xPos, $yPos, $xPos + $nWidth, $yPos + $nHeight]

Dim $struct_WP = DllStructCreate($WINDOWPLACEMENT)

DllStructSetData($struct_WP, 1, DllStructGetSize($struct_WP))

DllStructSetData($struct_WP, 2, 0)

DllStructSetData($struct_WP, 3, @SW_RESTORE)

DllStructSetData($struct_WP, 6, $rcNormalPosition[0], 1)

DllStructSetData($struct_WP, 6, $rcNormalPosition[1], 2)

DllStructSetData($struct_WP, 6, $rcNormalPosition[2], 3)

DllStructSetData($struct_WP, 6, $rcNormalPosition[3], 4)

_Remember_old_pos()

DllCall($dll, "int", "SetWindowPlacement", "hwnd", $hWindow, "ptr", DllStructGetPtr($struct_WP))

$struct_WP = 0

Else

_Remember_old_pos()

WinMove($hWindow, "", $xPos, $yPos, $nWidth, $nHeight)

EndIf

EndFunc ; ==> _NewWinMove

The functions:

CODE
;author : Chr. Stoltenkamp

;purpose : Extention for SplitMon

_Dim_old_pos()

#region ;HotKeySettings

HotKeySet("#{NUMPADDIV}", "_Remember_old_pos") ;WinKey + Numpad /

HotKeySet("#{NUMPADDOT}", "_Return_to_org_pos") ;WinKey + Numpad .

#endregion

while 1 ;keep the program alive

sleep(100)

wend

exit

Func _Dim_old_pos()

Global $cs_max_aantal_vensters=10

Global $cs_oldpos[$cs_max_aantal_vensters][5] ;5 => [1]=handle,[2]-[5]positie en grootte

Global $cs_vensternummer=0

EndFunc

Func _Remember_old_pos()

Opt("WinTitleMatchMode", 4) ;1=start, 2=subStr, 3=exact, 4=advanced

$cs_vensternummer +=1

If $cs_vensternummer > $cs_max_aantal_vensters-1 Then

$cs_max_aantal_vensters +=1

ReDim $cs_oldpos[$cs_max_aantal_vensters][5]

EndIf

$cs_pos = WinGetPos("active")

$cs_oldPos[$cs_vensternummer][0] = WinGetHandle("active") ;handle window

$cs_oldPos[$cs_vensternummer][1] = $cs_Pos[0] ;x positie

$cs_oldPos[$cs_vensternummer][2] = $cs_Pos[1] ;y positie

$cs_oldPos[$cs_vensternummer][3] = $cs_Pos[2] ;width

$cs_oldPos[$cs_vensternummer][4] = $cs_Pos[3] ;hight

WinSetTitle($cs_oldPos[$cs_vensternummer][0],"",WinGetTitle("active","") & " <<< Position secured >>> <Winvlag+Num.dot> = Restore")

EndFunc

Func _Return_to_org_pos()

Opt("WinTitleMatchMode", 4)

$cs_handle = WinGetHandle("active")

For $i = 1 To UBound($cs_oldPos)-1

If $cs_handle=$cs_oldPos[$i][0] Then

WinMove($cs_handle,"",$cs_oldPos[$i][1],$cs_oldPos[$i][2],$cs_oldPos[$i][3],$cs_oldPos[$i][4])

$cs_oldPos[$i][0]="Restored"

ExitLoop

EndIf

Next

WinSetTitle($cs_handle,"",StringReplace(WinGetTitle("active","")," <<< Position secured >>> <Winvlag+Num.dot> = Restore",""))

EndFunc

Link to comment
Share on other sites

:)

I have used your script in my application. A user asked if it was possible to 'remember' the windows original position & size.

Just put 2 extra lines in _NewWinMove and 'voila'.

Well, two lines there and 50 elsewhere :D

Anyway, I like the idea so I'll clean it up a bit and add it to the next version. Thank you!

For those curious, Here's a look at what else is in the next version:

- changed the way direction checks are performed (for moving a window to another monitor) to improve accuracy

- Improved Resizer key combination code to call less frequently; giving a performance boost

- I've incorporated some slick icons into the task tray icon that change depending on your monitor config

- The new code will now automatically detect when monitors change resolution/position/etc...

- Drastically improved the performance on multi-monitor systems, also changed the manner in which a window moves from one monitor to another for more increase in speed.

-There will also be additional GUI options to disable the extra features if you don't want them running.

And I'm closer to getting this working:

- interpret maximize event as maximize to half the screen, etc...

I don't think the "Snapping" feature will come in for some time yet, if ever, but I've stumbled on some improvements to the Resizer that should prove interesting. Stay tuned!

Link to comment
Share on other sites

:)

If you like I can supply you with 2 more simple functions:

1) function to set the active window "On Top".

2) function to set the transparancy for the active window.

I'm not sure I'll include those at this point. For one, they are easy to do by themselves, and besides that, I'm not sure it fits that well with the scope of this project.

Thank you for the ideas though, feel free to keep brainstorming :D

Link to comment
Share on other sites

Create an account or sign in to comment

You need to be a member in order to leave a comment

Create an account

Sign up for a new account in our community. It's easy!

Register a new account

Sign in

Already have an account? Sign in here.

Sign In Now
 Share

  • Recently Browsing   0 members

    • No registered users viewing this page.
×
×
  • Create New...