■ GetWindowLong 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 |
using System; using System.Runtime.InteropServices; #region 윈도우 정보 구하기 - GetWindowLong(windowHandle, index) /// <summary> /// 윈도우 정보 구하기 /// </summary> /// <param name="windowHandle">윈도우 핸들</param> /// <param name="index">인덱스</param> /// <returns>처리 결과</returns> [DllImport("user32", SetLastError = true)] private static extern uint GetWindowLong(IntPtr windowHandle, int index); #endregion /// <summary> /// GWL /// </summary> public enum GWL : int { /// <summary> /// GWL_WNDPROC /// </summary> GWL_WNDPROC = -4, /// <summary> /// GWL_HINSTANCE /// </summary> GWL_HINSTANCE = -6, /// <summary> /// GWL_HWNDPARENT /// </summary> GWL_HWNDPARENT = -8, /// <summary> /// GWL_ID /// </summary> GWL_ID = -12, /// <summary> /// GWL_STYLE /// </summary> GWL_STYLE = -16, /// <summary> /// GWL_EXSTYLE /// </summary> GWL_EXSTYLE = -20, /// <summary> /// GWL_USERDATA /// </summary> GWL_USERDATA = -21 } |