첨부 실행 코드는 나눔고딕코딩 폰트를 사용합니다.
본 블로그는 광고를 포함하고 있습니다.
광고 클릭에서 발생하는 수익금은 모두 블로그 콘텐츠 향상을 위해 쓰여집니다.

728x90
반응형
728x170
using System;
using System.Runtime.InteropServices;

#region 윈도우 위치 설정하기 - SetWindowPos(windowHandle, windowHandleInsertAfter, x, y, width, height, flag)

/// <summary>
/// 윈도우 위치 설정하기
/// </summary>
/// <param name="windowHandle">윈도우 핸들</param>
/// <param name="windowHandleInsertAfter">삽입 이후 윈도우 핸들</param>
/// <param name="x">X 좌표</param>
/// <param name="y">Y 좌표</param>
/// <param name="width">너비</param>
/// <param name="height">높이</param>
/// <param name="flag">플래그</param>
/// <returns>처리 결과</returns>
[DllImport("user32")]
[return: MarshalAs(UnmanagedType.Bool)]
private static extern bool SetWindowPos(IntPtr windowHandle, IntPtr windowHandleInsertAfter, int x, int y, int width, int height, SetWindowPosFlag flag);

#endregion

#region 윈도우 위치 설정 플래그 - SetWindowPosFlag

/// <summary>
/// 윈도우 위치 설정 플래그
/// </summary>
[Flags]
public enum SetWindowPosFlag : uint
{
    /// <summary>
    /// SWP_ASYNCWINDOWPOS
    /// </summary>
    SWP_ASYNCWINDOWPOS = 0x4000,

    /// <summary>
    /// SWP_DEFERERASE
    /// </summary>
    SWP_DEFERERASE = 0x2000,

    /// <summary>
    /// SWP_DRAWFRAME
    /// </summary>
    SWP_DRAWFRAME = 0x0020,

    /// <summary>
    /// SWP_FRAMECHANGED
    /// </summary>
    SWP_FRAMECHANGED = 0x0020,

    /// <summary>
    /// SWP_HIDEWINDOW
    /// </summary>
    SWP_HIDEWINDOW = 0x0080,
            
    /// <summary>
    /// SWP_NOACTIVATE
    /// </summary>
    SWP_NOACTIVATE = 0x0010,

    /// <summary>
    /// SWP_NOCOPYBITS
    /// </summary>
    SWP_NOCOPYBITS = 0x0100,

    /// <summary>
    /// SWP_NOMOVE
    /// </summary>
    SWP_NOMOVE = 0x0002,

    /// <summary>
    /// SWP_NOOWNERZORDER
    /// </summary>
    SWP_NOOWNERZORDER = 0x0200,

    /// <summary>
    /// SWP_NOREDRAW
    /// </summary>
    SWP_NOREDRAW = 0x0008,

    /// <summary>
    /// SWP_NOREPOSITION
    /// </summary>
    SWP_NOREPOSITION = 0x0200,

    /// <summary>
    /// SWP_NOSENDCHANGING
    /// </summary>
    SWP_NOSENDCHANGING = 0x0400,

    /// <summary>
    /// SWP_NOSIZE
    /// </summary>
    SWP_NOSIZE = 0x0001,

    /// <summary>
    /// SWP_NOZORDER
    /// </summary>
    SWP_NOZORDER = 0x0004,

    /// <summary>
    /// SWP_SHOWWINDOW
    /// </summary>
    SWP_SHOWWINDOW = 0x0040,
}

#endregion
728x90
반응형
그리드형
Posted by 사용자 icodebroker
TAG , ,

댓글을 달아 주세요