Bored and bored. I used C # To maximize the QQ video window.
The principle is that WinApi is called.
/// <Summary> /// query the form /// </summary> /// <param name = "lpClassName"> </param> /// <param name = "lpWindowName"> </param> // <returns> </returns> [DllImport ("User32.dll ", entryPoint = "FindWindow")] public extern static IntPtr FindWindow (string lpClassName, string lpWindowName ); /// <summary> /// obtain the Form title /// </summary> /// <param name = "hwnd"> </param> /// <param name = "text"> </param> // <param name = "maxLength"> </param> // <returns> </returns> [DllImport ("user32.dll" )] private static extern int GetWindowText (IntPtr hwnd, StringBuilder text, int maxLength ); /// <summary> /// set the form display /// </summary> /// <param name = "hwnd"> </param> /// <param name = "nCmdShow"> 1-regular 2-minimized 3-maximized </param> // <returns> </returns> [DllImport ("user32.dll ", entryPoint = "ShowWindow", CharSet = CharSet. auto)] public static extern int ShowWindow (IntPtr hwnd, int nCmdShow ); /// <summary> /// set whether the form is set to the top. /// </summary> /// <param name = "hWnd"> </param> // <param name = "hWndInsertAfter"> </param> // <param name = "x"> </param> // <param name = "y"> </param> /// <param name = "Width"> </param> /// <param name = "Height"> </param> /// <param name = "flags"> </param> /// <returns> </returns> [DllImport ("user32.dll ", charSet = CharSet. auto)] private static extern int SetWindowPos (IntPtr hWnd, int hWndInsertAfter, int x, int y, int Width, int Height, int flags );
IntPtr maindHwnd = FindWindow ("TXGuiFoundation", null); // obtain the QQ form handle if (maindHwnd! = IntPtr. zero) {// StringBuilder sb = new StringBuilder (255); // GetWindowText (maindHwnd, sb, 255); // MessageBox. show (sb. toString (); ShowWindow (maindHwnd, 3); SetWindowPos (maindHwnd,-2, 0, 0, 0, 0, 0x001 | 0x002 | 0x040);} else {MessageBox. show ("no window found ");}
Double-click the video window to run the code.
Source code
Http://files.cnblogs.com/mohc/QQVideoShowWindow.rar