Réponse acceptée !
Exemple :
NativeMethods.SetWindowPos(
new HandleRef(this.fcsConsoleProcess, this.fcsConsoleProcess.MainWindowHandle),
NativeMethods.HWND_TOP,
0,
0,
0,
0,
NativeMethods.SWP_NOMOVE | NativeMethods.SWP_NOSIZE
);
Avec la classe NativeMethods définie comme ceci :
------
using System;
using System.Runtime.InteropServices;
internal class NativeMethods
{
private NativeMethods()
{
}
static NativeMethods()
{
NativeMethods.HWND_TOP = new HandleRef(null, IntPtr.Zero);
}
public static readonly HandleRef HWND_TOP;
public const int SWP_NOSIZE = 0x0001;
public const int SWP_NOMOVE = 0x0002;
[DllImport("user32.dll", CharSet=CharSet.Auto, ExactSpelling=true)]
public static extern bool SetWindowPos(
HandleRef hWnd,
HandleRef hWndInsertAfter,
int X,
int Y,
int cx,
int cy,
int uFlags
);
}
------
/*
coq
MVP Visual C#
*/