[DllImport("Coredll.dll")]
public static extern bool MoveWindow(IntPtr hwnd, int x, int y, int nwidth, int nHeight, bool brepaint);
[DllImport("Coredll.dll")]
public static extern IntPtr FindWindow(string lpClassName, string lpWindowName);
public static void ShowSipButton(bool Visible){
IntPtr windowH = FindWindow("MS_SIPBUTTON", "MS_SIPBUTTON");
if( windowH == IntPtr.Zero ) return;
if (Visible){
MoveWindow(windowH, 204, 295, 36, 24, false);
} else {
MoveWindow(windowH, 0, 0, 0, 0, false);
}
}
Es muy sencillo solo busca la ventana del SIP y la mueve al lugar donde la queremos.
No hay comentarios:
Publicar un comentario