Sign in to follow this  
Followers 0
scythetleppo

Diablo 2 Detect Resolution And Windowsize

5 posts in this topic

If Not WinActive("Diablo II","") Then WinActivate("Diablo II","")
WinWaitActive("Diablo II", "")
WinMove("Diablo II", "", 0, 0)
WinSetOnTop ("Diablo II", "", 1)
Sleep(1000)
WinWaitActive("Diablo II")
Sleep(100)
$a_size = WinGetPos("Diablo II")
$state = WinGetState("Diablo II", "")
MsgBox(0,"Diablo Size","Width: "& $a_size[2]&" Height: "&$a_size[3])
$size=""
while $size=""
    if $a_size[2] = 800 and $a_size[3] = 600 then $size="f800"
    if $a_size[2] = 640 and $a_size[3] = 480 then $size="f640"
    if $a_size[2] > 800 and $a_size[3] > 600 then $size="w800"
    if $a_size[2] < 800 and $a_size[3] < 600 then $size="w640"
wend
    
msgbox(0, "Blah", $size)

There we go.

Share this post


Link to post
Share on other sites



WinGetPos is quite useful when getting window size.

But an interesting fact. WinGetClientSize gives you actual gamescreen size - how much pixels you can see on game screen. While in window mode it is a bit smaller than entire window size (sub window border and headline).

Here exists interesting consequence for game in window mode:

1. if screen resolution equals game resolution, game window size is proper but client size is smaller - lower lines of the game screen with part of left and right skill slots are out of sight.

2. if screen resolution is greater than game resolution, game window size is a bit larger. Window client size in this case is proper to game resolution.

Only in fullscreen mode window actual size = window client size.

Some time ago i've killed much time deciding the problem with hidden lower gamescreen lines. Finally i've made it out how to hid the window headline (and borders afair) so my 600x800 Diablo2 window on 600x800 desktop is now full-viewed (u may look for 'Diablo2 EasyStart Tool' somewhere on forum).

Hope i've said something interesting for u..


I have been walking shadow ways to land where Terror rules...

Share this post


Link to post
Share on other sites

WinGetPos is quite useful when getting window size.

But an interesting fact. WinGetClientSize gives you actual gamescreen size - how much pixels you can see on game screen. While in window mode it is a bit smaller than entire window size (sub window border and headline).

Here exists interesting consequence for game in window mode:

1. if screen resolution equals game resolution, game window size is proper but client size is smaller - lower lines of the game screen with part of left and right skill slots are out of sight.

2. if screen resolution is greater than game resolution, game window size is a bit larger. Window client size in this case is proper to game resolution.

Only in fullscreen mode window actual size = window client size.

Some time ago i've killed much time deciding the problem with hidden lower gamescreen lines. Finally i've made it out how to hid the window headline (and borders afair) so my 600x800 Diablo2 window on 600x800 desktop is now full-viewed (u may look for 'Diablo2 EasyStart Tool' somewhere on forum).

Hope i've said something interesting for u..

I just used

=800 and =600 is fullscreen 800x600

=640 and =480 is fullscreen 640x480

>800 and >600 is windowed 800x600

<799 and <480 is windowed 640x480

Share this post


Link to post
Share on other sites

=800 and =600 may be windowed 800x600 if desktop resolution is exactly 800x600. It was on my machine.

>800 and >600 may be special (non-standart) diablo2 resolution that is possible to make with special programs (768x1024 or so, don't remember exactly .. oops this resolution is out of all conditions in your script %-o though say again i don't remember it exactly).

=600 and =480 may be windowed 640x480 if desktop resolution is exactly 640x480 (in theory).

Only ( <800 and <600 ) condition is impaccable.


I have been walking shadow ways to land where Terror rules...

Share this post


Link to post
Share on other sites

#5 ·  Posted (edited)

>800 and >600 may be special (non-standart) diablo2 resolution that is possible to make with special programs (768x1024 or so, don't remember exactly .. oops this resolution is out of all conditions in your script %-o though say again i don't remember it exactly).

No idea what you are saying. If someone uses windowed 800x640, it has to have a border,which increases the window size by at least 2 w and more h.

=800 and =600 may be windowed 800x600 if desktop resolution is exactly 800x600. It was on my machine.

interesting... I don't know what to do about that one.

=600 and =480 may be windowed 640x480 if desktop resolution is exactly 640x480 (in theory).

any machine has to be 800x600 or more to run d2 anyways so this doesn't matter.

Only ( <800 and <600 ) condition is impaccable.

actually >800 and >600 will always be windowed 800x640 so they both are

Edited by scythetleppo

Share this post


Link to post
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
Sign in to follow this  
Followers 0