■ SetWindowLong API 함수를 선언하는 방법을 보여준다.
▶ 예제 코드 (C#)
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 32 33 34 35 36 37 38 39 40 41 42 43 44 45 46 47 48 49 50 51 52 53 54 55 56 57 58 59 60 61 62 63 64 65 66 67 68 69 70 71 72 73 74 |
using System; using System.Runtime.InteropServices; #region 윈도우 LONG 설정하기 - SetWindowLong(windowHandle, flag, value) /// <summary> /// 윈도우 LONG 설정하기 /// </summary> /// <param name="windowHandle">윈도우 핸들</param> /// <param name="flag">플래그</param> /// <param name="value">값</param> /// <returns>처리 결과</returns> [DllImport("user32")] private static extern int SetWindowLong(IntPtr windowHandle, WindowLongFlag flag, int value); #endregion /// <summary> /// 윈도우 LONG 플래그 /// </summary> public enum WindowLongFlag : int { /// <summary> /// GWL_EXSTYLE /// </summary> GWL_EXSTYLE = -20, /// <summary> /// GWLP_HINSTANCE /// </summary> GWLP_HINSTANCE = -6, /// <summary> /// GWLP_HWNDPARENT /// </summary> GWLP_HWNDPARENT = -8, /// <summary> /// GWL_ID /// </summary> GWL_ID = -12, /// <summary> /// GWL_STYLE /// </summary> GWL_STYLE = -16, /// <summary> /// GWL_USERDATA /// </summary> GWL_USERDATA = -21, /// <summary> /// GWL_WNDPROC /// </summary> GWL_WNDPROC = -4, /// <summary> /// DWLP_USER /// </summary> DWLP_USER = 0x8, /// <summary> /// DWLP_MSGRESULT /// </summary> DWLP_MSGRESULT = 0x0, /// <summary> /// DWLP_DLGPROC /// </summary> DWLP_DLGPROC = 0x4 } |