Sunday, May 4, 2008

WOW Multimonitor and Vista


Consider this a Howto. (with a bad picture)

1. install WOW and get it running.

OK now we find that since Vista has removed the Stretch window option we can only run on one monitor. There isn't much we can do about full screen mode, but we can run in a Window and stretch the window across the monitors. This works, but the window grows in height as we stretch horizontally, since WOW is trying to maintain the aspect ratio.

To fix this, edit your config.wtf file and edit the gxResolution line, it's important to note that if either the width or height specified on the resolution line exceed the resolution of your primary monitor, it will just be reset. All that matters for now is that you pick something with the correctaspect ratio.

I'm using a pair of widescreen monitors, with a final resolution of 3840x1200, so I set my gxResolution line to one quarter of that 960x300.

SET gxResolution "960x300"

Note that under vista if you don't run WOW as administrator, it seems to ignore the settings in Config.wtf, so run it as administrator.


OK at this point, you should be able to stretch the image in the correct aspect ratio accross the two monitors.

I was almost happy with this but I really hate the stupid window border, I really wanted the equivalent of the maximised check box in the graphics options. i.e Maximised across both monitors with no border. Unfortunately setting the Miximized option will of course maximize to just one monitor.

I messed around with various multmonitor utils and none of them did what I wanted, so I wrote a program to do exactly what I wanted to the WOW window.

http://www.polygonhell.com/wind1.exe

It's a command line utility, and has to be run as administrator (since it needs to modify another processes window), basically it finds the first window with the start of the title "World of Warcraft", changes the stype flags to remove the window border and then resizes the window to the specified size.

There is minimal error checking since it was a quick hack, it takes upto 4 parameters, x, y, width and height (see below). if you omit the arguments it defaults to 0,0,640, 480

wind1.exe -1920 0 3840 1200

That's the command I use, the X is negative, because it happens my primary monitor is to the right of my secondary monitor, you can run it multiple times to move and resize the window, but there is no functionality to restore the border.

This is not a keylogger, and for the overly paranoid the source code is below if you want to build it yourself.

EDIT -- Fixed a problem in identifying the correct window, under some circumstances it would find the button on the Taskbar instead of the window and just do nothing. Revised code below, also updated exe at the above link.



// WOWFullScreen -- Hack to maximise the window with no border to an arbitrary area
//

#include "stdafx.h"
#include "windows.h"


int _tmain(int argc, _TCHAR* argv[])
{
WCHAR *match = L"World of Warcraft";
int x = 0;
int y = 0;
int width = 640;
int height = 480;

if (argc > 1)
x = _wtoi(argv[1]);
if (argc > 2)
y = _wtoi(argv[2]);
if (argc > 3)
width = _wtoi(argv[3]);
if (argc > 4)
height = _wtoi(argv[4]);


WCHAR name[1024];
HWND wind = 0;

HWND window = GetDesktopWindow();
HWND child = GetWindow(window, GW_CHILD);
child = GetWindow(child, GW_HWNDFIRST);
while (child)
{
GetWindowText(child, name, 1023);
unsigned int style = GetWindowLong(child, GWL_STYLE);
if ((style & 0x160f0000) == 0x160f0000 && !wcsncmp(match, name, wcslen(match)))
{
wind = child;
break;
}
child = GetWindow(child, GW_HWNDNEXT);
}

unsigned int style = GetWindowLong(wind, GWL_STYLE);
unsigned int styleEX = GetWindowLong(wind, GWL_EXSTYLE);

style = style & ~( WS_CAPTION | WS_THICKFRAME);
SetWindowLong(wind, GWL_STYLE, style);
SetWindowPos(wind, HWND_TOP, x, y, width, height, 0);

return 0;

}


12 comments:

  1. been trying to get this working, but no luck. every time I edit my config.wtf, wow resets it to the default settings. any suggestions?

    ReplyDelete
  2. You need to set it so it's in windowed mode and the full size will fit on an individual monitor. The thing you're trying to do is set up the aspect ration since WOW only reads it once on app startup.

    If the window won't fit on the primary monitor WOW will reset it for you.

    Also be careful, if you are rnning WOW under vista not as administrator the actual wtf file is in a different location.

    ReplyDelete
  3. This comment has been removed by the author.

    ReplyDelete
  4. I'm not very good with aspect ratios and stuff like this, but you had an aspect ratio of 3.2:1 Why do you use one quarter of that, and can I use two different resolutions (like 1024x768 and 1280x800)?

    P.S. I'm a complete noob. I do give permission to rofl if my questions are really stupid.

    ReplyDelete
  5. finally got it. instead of 1/4 the final resolution, I set it to 1440X450, since the final resolution will be 2880X900. ran as admin and worked like a charm. Used CT viewport, and now WoW is spread across both screens, though I only have the playing area on 1 screen. the other screen I'm using for most of my addons now, and it has vastly cleared up my gaming view. Thank you!

    ReplyDelete
  6. Nice dispatch and this enter helped me alot in my college assignement. Say thank you you for your information.

    ReplyDelete
  7. Easily I agree but I dream the post should secure more info then it has.

    ReplyDelete
  8. Correctly your article helped me altogether much in my college assignment. Hats afar to you dispatch, will look ahead for more interdependent articles in a jiffy as its united of my pet question to read.

    ReplyDelete
  9. Any chance you're able to compile a version compatible w/ 64 bit Vista?

    ReplyDelete
  10. Great delivery. Outstanding arguments. Keep up the good effort.
    My webpage ... slots bonuses

    ReplyDelete
  11. Heya i'm for the primary time here. I came across this board and I find It really useful & it helped me out a lot. I hope to provide one thing again and aid others like you aided me.
    Also see my website - games online

    ReplyDelete
  12. I truly love your website.. Very nice colors & theme.
    Did you develop this site yourself? Please reply back
    as I'm planning to create my own personal site and would love to learn where you got this from or just what the theme is named. Thanks!

    Feel free to visit my blog post tumblr

    ReplyDelete