C# Başka Program Boyutlandırmak ve Konum Değiştirmek
| Kasım 6, 2016Çalışan bir başka ekrandaki konumunu değiştirmek ve boyutlandırmak için kullanabileceğiniz kod blogu.
1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 30 31 | // Define the FindWindow API function. [DllImport("user32.dll", EntryPoint = "FindWindow", SetLastError = true)] static extern IntPtr FindWindowByCaption(IntPtr ZeroOnly, string lpWindowName); // Define the SetWindowPos API function. [DllImport("user32.dll")] [return: MarshalAs(UnmanagedType.Bool)] static extern bool SetWindowPos(IntPtr hWnd, IntPtr hWndInsertAfter, int X, int Y, int cx, int cy, SetWindowPosFlags uFlags); // Define the SetWindowPosFlags enumeration. [Flags()] private enum SetWindowPosFlags : uint { SynchronousWindowPosition = 0x4000, DeferErase = 0x2000, DrawFrame = 0x0020, FrameChanged = 0x0020, HideWindow = 0x0080, DoNotActivate = 0x0010, DoNotCopyBits = 0x0100, IgnoreMove = 0x0002, DoNotChangeOwnerZOrder = 0x0200, DoNotRedraw = 0x0008, DoNotReposition = 0x0200, DoNotSendChangingEvent = 0x0400, IgnoreResize = 0x0001, IgnoreZOrder = 0x0004, ShowWindow = 0x0040, } // Size and position the application. |