How to change window position?
by Chris Kim · in Torque X 2D · 06/13/2007 (8:02 am) · 3 replies
I need to create two windows for network setup and want to create in a position that they don't overlap.
It's little tidious to move it by hand.
To fix this, I would like to create them in a position I want.
I've looked at XNA.Framework.GameWindow and there is ClientBounds property but it's read-only.
How would I change the position of the window?
Thanks.
It's little tidious to move it by hand.
To fix this, I would like to create them in a position I want.
I've looked at XNA.Framework.GameWindow and there is ClientBounds property but it's read-only.
How would I change the position of the window?
Thanks.
About the author
#2
Is this true? I thought you would be simply be able to call Win32 API in C#, no?
[System.Runtime.InteropServices.DllImport("USER32.dll")]
public static extern bool MoveWindow(IntPtr hWnd,
int X,
int Y,
int nWidth,
int nHeight,
bool bRepaint
);
06/16/2007 (11:02 am)
It should be fairly easy to call win32 API but it seems to require the following declarations.Is this true? I thought you would be simply be able to call Win32 API in C#, no?
[System.Runtime.InteropServices.DllImport("USER32.dll")]
public static extern bool MoveWindow(IntPtr hWnd,
int X,
int Y,
int nWidth,
int nHeight,
bool bRepaint
);
#3
06/16/2007 (2:30 pm)
That's actually fairly common for system calls. The new profiler does the same thing to expose the methods that keep track of time on the PC.
Torque Owner Thomas Buscaglia
You can get the window handle like so:
Hope this helps.