☆★UNITY★☆ 4 All
Would you like to react to this message? Create an account in a few clicks or log in to continue.

☆★UNITY★☆ 4 All

☆★UNITY★☆ Guild Site
 
HomeLatest imagesRegisterLog in

 

 Full screen window mode with multi client support [Original post by Redrallyx]

Go down 
3 posters
AuthorMessage
Choopah
Member
Member
Choopah


Posts : 61
Join date : 2009-06-23
Age : 51
Location : Canada

Full screen window mode with multi client support [Original post by Redrallyx] Empty
PostSubject: Full screen window mode with multi client support [Original post by Redrallyx]   Full screen window mode with multi client support [Original post by Redrallyx] Icon_minitimeFri Jul 03, 2009 9:44 pm

[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
Back to top Go down
YokoAki
Member
Member
YokoAki


Posts : 27
Join date : 2009-07-06
Age : 32
Location : Shadow realm

Full screen window mode with multi client support [Original post by Redrallyx] Empty
PostSubject: Re: Full screen window mode with multi client support [Original post by Redrallyx]   Full screen window mode with multi client support [Original post by Redrallyx] Icon_minitimeFri Aug 21, 2009 2:36 am

there if you don't get how to set up multi client from what choopah said then see this topic
Multi client aka Dual log
Back to top Go down
http://freewebs.com/kite64
AyoTai
Vice Guild Master
Vice Guild Master
AyoTai


Posts : 25
Join date : 2009-07-06
Age : 43
Location : AlphaCentavri

Full screen window mode with multi client support [Original post by Redrallyx] Empty
PostSubject: Re: Full screen window mode with multi client support [Original post by Redrallyx]   Full screen window mode with multi client support [Original post by Redrallyx] Icon_minitimeWed Sep 02, 2009 6:58 am

some programing lesson hehe or it is greating on marsian languge scratch
Back to top Go down
Sponsored content





Full screen window mode with multi client support [Original post by Redrallyx] Empty
PostSubject: Re: Full screen window mode with multi client support [Original post by Redrallyx]   Full screen window mode with multi client support [Original post by Redrallyx] Icon_minitime

Back to top Go down
 
Full screen window mode with multi client support [Original post by Redrallyx]
Back to top 
Page 1 of 1
 Similar topics
-
» Disconnects? Try changing the number of TCP/IP retries [Original post by Redrallyx]
» Friendship quest / Hand in Hand [Original post by Redrallyx]
» Multi Client
» Notes about PK [original post by Froszen]
» Unitypedia [original post by Froszen]

Permissions in this forum:You cannot reply to topics in this forum
☆★UNITY★☆ 4 All :: PW Related :: Tips and Tricks-
Jump to: