Is it possible to resize a running application's window size from within another application? I want that when the application that I am building starts, another application (let's say itunes)'s width be reduced to its 2/3 so that the remaining 1/3 be occupied by my application. The two application should be running altogether and accessible by the user. Please help if possible.
相关问题
- Sorting 3 numbers without branching [closed]
- Graphics.DrawImage() - Throws out of memory except
- Why am I getting UnauthorizedAccessException on th
- 求获取指定qq 资料的方法
- How to know full paths to DLL's from .csproj f
You can use
SetWindowPos
to resize another process's window.You need to get the Windows' handle so use the
FindWindow
function at http://msdn.microsoft.com/en-us/library/ms633499(VS.85).aspx then pass the handle to the window usingSendMessage
.You need to
SendMessage
at http://msdn.microsoft.com/en-us/library/ms644950.aspx orPostMessage
at http://msdn.microsoft.com/en-us/library/ms644944(VS.85).aspx with WM_SIZE (0x0005) and specify the size.