xsol
Member
- Joined
- Nov 7, 2011
- Messages
- 503
- Reaction score
- 12
I know there are other scripts/tools, I don't care if you like autoit or compiled code use it, this is for developers and advanced users who may want to tweak their d3 window experience.
If you are multi botting and you have a boss system this will tile all your D3s across all your screens and into invisible space if you have that many (48???)
There are variables that can be tweaked. Currently it shrinks the window(s) down to 320x240 and tiles them as if running 1920x1080
- Run all your D3s in Fullscreen Windowed.
- Launch the program
- Type Tile or Reset and press ENTER
If you are multi botting and you have a boss system this will tile all your D3s across all your screens and into invisible space if you have that many (48???)
There are variables that can be tweaked. Currently it shrinks the window(s) down to 320x240 and tiles them as if running 1920x1080
PHP:
using System;
using System.Collections.Generic;
using System.Linq;
using System.Runtime.InteropServices;
using System.Text;
namespace FixD3
{
public delegate bool EnumWindowsCallback(int hwnd, int lParam);
class Program
{
private static EnumWindowsCallback callback;
public class D3Mover
{
[DllImport("user32.dll")]
public static extern int EnumWindows(EnumWindowsCallback cb, int l);
[DllImport("user32.dll", CharSet = CharSet.Auto, SetLastError = true)]
static extern int GetWindowText(IntPtr hWnd, StringBuilder lpString, int nMaxCount);
[DllImport("user32.dll", SetLastError = true)]
[return: MarshalAs(UnmanagedType.Bool)]
internal static extern bool SetWindowPos(IntPtr hWnd, IntPtr hWndInsertAfter, int x, int y, int cx, int cy, uint uFlags);
public static bool Report(int hwnd, int lParam)
{
IntPtr wnd = new IntPtr(hwnd);
StringBuilder sb = new StringBuilder(255);
GetWindowText(wnd, sb, 255);
string title = sb.ToString().Trim();
if (title == "Diablo III")
{
handles.Add(wnd);
}
return true;
}
static List<IntPtr> handles = new List<IntPtr>();
public static void TitleWindows()
{
int topConst = 0;
int widthConst = 320;
int heightConst = 240;
int offsetTop = topConst;
int offsetLeft = 0;
int capBottom = 1080;
for (int i = 0; i < handles.Count; i++)
{
SetWindowPos(handles[i], IntPtr.Zero, offsetLeft, offsetTop, widthConst, heightConst, 0);
Console.WriteLine(string.Format("Moved D3 to X:{0},Y:{1}",new object[]{offsetLeft,offsetTop}));
offsetTop += 240;//moce down
if (offsetTop >= capBottom)
{ //move right
offsetTop = topConst;
offsetLeft += 320;
}
}
}
public static void ResetWindows()
{
for (int i = 0; i < handles.Count; i++)
{
SetWindowPos(handles[i], IntPtr.Zero, 0, 0, 1920, 1080, 0);
Console.WriteLine("Reset D3");
}
}
}
static void Main()
{
callback = new EnumWindowsCallback(D3Mover.Report);
D3Mover.EnumWindows(callback, 0);
Console.WriteLine("Type the command TILE or RESET and press ENTER.");
string cmd = Console.ReadLine();
cmd = cmd.ToUpper();
if (cmd == "TILE") D3Mover.TitleWindows();
if (cmd == "RESET") D3Mover.ResetWindows();
}
}
}