elishacloud / dxwrapper

Fixes compatibility issues with older games running on Windows 10/11 by wrapping DirectX dlls. Also allows loading custom libraries with the file extension .asi into game processes.
zlib License
1.15k stars 82 forks source link

[Feature] Add function to start game at specific screen coordinates #204

Closed Kim2091 closed 1 year ago

Kim2091 commented 1 year ago

It'd be amazing if dxwrapper could force games to start in a specific location on a given screen. Many of these older games hate being forced into a window, then I have to use a tool like SRWE to force it back into position every time I launch it. Thanks!

elishacloud commented 1 year ago

Good idea. Let me look into this. Should be easy to add.

elishacloud commented 1 year ago

Ok, I added this function in the Direct3D9 wrapper. So this will only work in games that support Dd7to9, D3d8to9 or EnableD3d9Wrapper.

The new options are:

SetInitialWindowPosition   = 0
InitialWindowPositionLeft  = 0
InitialWindowPositionTop   = 0

Here are the steps to use it:

  1. You need to be using this new build below.
  2. You need enable one of the following (whichever one the game supports): Dd7to9, D3d8to9 or EnableD3d9Wrapper.
  3. The game needs to be running in window mode or you need to set the EnableWindowMode option.
  4. You need to enable SetInitialWindowPosition
  5. You can define the initial window position with these options: InitialWindowPositionLeft and InitialWindowPositionTop

Here is the new build: dxwrapper.zip

Kim2091 commented 1 year ago

That's great, thank you! I'll give it a try tonight and post back if there's any issues

Kim2091 commented 1 year ago

It works well, no issues that I could find 🙂