[Original post authored by Redrallyx - topic moved from old forum]Hi,
Edit: It seems I am too terse. I'll try to explain a bit more...
The PW Client can be played in full screen mode and in window mode.
The advantage of full screen is... that it is full screen.
The advantage of playing in window mode is easier swapping between applications on your desktop.
The disadvantage of window mode is that the mouse can leave your window, the (auto-hide) windows taskbar can interfere with your window and there is a border around the window preventing you from using the entire screen.
The disadvantage of full screen mode is the flashing screen when switching between applications using the alt-tab key.
I made a script to be able to play full screen in window mode.
This way I can easily switch applications using the alt-tab key, the taskbar will not unhide over the PW Client window and I effectively play full screen because the window border is moved out of the visible area.
When I am at home I have a normal PC and a laptop to play with.
In most cases that means I set up a stall on my laptop and use my PC to play.
When traveling I only have my laptop with me and I was looking for a way to use a multi-client.
After googling around a bit I found that the way to do this was by simply changing the title of the client window.
I also found a nice program that allows me to do these things with a (simple) ascii script file.
I have now a shortcut on my desktop that I run after starting the PW Client.
This moves the PW Client window to the right position and changes the title of the window.
Now I am able to play with all the advantages of window mode and full screen mode.
And I can start a second PW Client too to set up stall.
The script uses AutoIt which can be downloaded from
* http://www.autoitscript.com/autoit3/downloads.shtml
In the game you first change to window mode and set the size to be equal to your desktop size.
Running the script will move the window to (-4, -23) which results in moving the borders out of view.
If you use different desktop window settings it might be necessary to change the offset in the script.
You can run the script in two ways. You can compile it and make an executable or you run it using
the autoit3.exe program from a shortcut:
* "C:\Program Files\AutoIt3\AutoIt3.exe" "PWWindowMove.au3"
Next to this shortcut I also have another shortcut to start the Client program without going
through the standard patcher. You do this by using the following target in a shortcut:
* "C:\Program Files\Perfect World\element\elementclient.exe" game:cpw
And here is the contents of PWWindowMove.au3:
- Code:
-
; AutoIt script to move Perfect World client window to postion 0,0
; Renames the title to allow starting multiple clients
$var = WinList("[CLASS:ElementClient Window]")
$count = $var[0][0]
$nr = 0
; Search for the last number used
For $j = 1 to $count
$array = StringRegExp($var[$j][0], '^PW (\d+)', 1, 1)
If IsArray($array) Then
$n = Number($array[0])
If $n > $nr Then
$nr = $n
EndIf
EndIf
Next
$nr = $nr + 1
; Change title of last window
For $j = 1 to $count
If $var[$j][0] == "Element Client" Then
WinSetTitle($var[$j][1], "", "PW " & $nr)
EndIf
Next
; move all windows to position 0,0
For $j = $count to 1 step -1
WinActivate($var[$j][1])
WinMove($var[$j][1], "", -4, -23)
Next
I made some modifications to the script to get around minor issues I had with resizing.
Now it will only rename and move/resize the new client window when found.
If no new window is found it will move and resize all PW windows.
- Code:
-
; AutoIt script to move Perfect World client windows to postion 0,0
;
; PW prevents starting multiple clients by checking the window title
; Renaming the title does allow us to start the client multiple times
; The new position and size of the window including borders
$x = -4
$y = -23
$w = @DesktopWidth + 8
$h = @DesktopHeight + 27
$var = WinList("[CLASS:ElementClient Window]")
$count = $var[0][0]
$nr = 0
$found = 0
; Prepare a new window title by searching for the last title number used
For $j = 1 to $count
$array = StringRegExp($var[$j][0], '^PW (\d+)', 1, 1)
If IsArray($array) Then
$n = Number($array[0])
If $n > $nr Then
$nr = $n
EndIf
ElseIf $var[$j][0] == "Element Client" Then
$found = $j
EndIf
Next
$nr = $nr + 1
If $found > 0 Then
; Change the title of the new 'Element Client' window to 'PW ' + nr
WinSetTitle($var[$found][1], "", "PW " & $nr)
; If a new window was found then only move and resize that window
WinActivate($var[$found][1])
WinMove($var[$found][1], "", $x, $y, $w, $h)
Else
; If only old windows were found then move and resize all windows
; By stepping backwards through the list we keep the activation order the same
For $j = $count to 1 step -1
If $found == 0 Or $found == $j Then
WinActivate($var[$j][1])
WinMove($var[$j][1], "", $x, $y, $w, $h)
EndIf
Next
EndIf