How to restore application with the same size?
When I have an application opened and I try to open again it, i want to restore the application launched with the actual size.
The code used is this:
[DllImport("user32.dll")]
[return: MarshalAs(UnmanagedType.Bool)]
private static extern bool SetForegroundWindow(IntPtr hWnd);
[DllImport("user32.dll", CharSet = CharSet.Auto, ExactSpelling = true)]
private static extern int ShowWindow(IntPtr hwnd, int nCmdShow);
private const int SW_SHOW = 5;
public static void SetForegroundMyWindow(IntPtr windowHandle)
{
SetForegroundWindow(windowHandle);
ShowWindow(windowHandle, SW_SHOW);
}
With this code, when the window is maximized, the application is shown with the size without maximize. Only with SetForegroundWindow
, the application is not shown when it is minimized.
What is the way to get my window with the actual size?
链接地址: http://www.djcxy.com/p/29198.html上一篇: 将对象位置恢复为默认状态后,改为正常的Windows状态
下一篇: 如何恢复相同大小的应用程序?