■ CreateWindowEx 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 |
using System; using System.Runtime.InteropServices; #region 윈도우 생성하기 (확장) - CreateWindowEx(extendedStyle, className, windowName, style, x, y, width, height, parentWindowHandle, menuHandle, instanceHandle, parameter) /// <summary> /// 윈도우 생성하기 (확장) /// </summary> /// <param name="extendedStyle">확장 스타일</param> /// <param name="className">클래스명</param> /// <param name="windowName">윈도우명</param> /// <param name="style">스타일</param> /// <param name="x">X</param> /// <param name="y">Y</param> /// <param name="width">너비</param> /// <param name="height">높이</param> /// <param name="parentWindowHandle">부모 윈도우 핸들</param> /// <param name="menuHandle">메뉴 핸들</param> /// <param name="instanceHandle">인스턴스 핸들</param> /// <param name="parameter">매개 변수</param> /// <returns>윈도우 핸들</returns> [DllImport("user32", EntryPoint = "CreateWindowEx", CharSet = CharSet.Unicode)] private static extern IntPtr CreateWindowEx ( int extendedStyle, string className, string windowName, int style, int x, int y, int width, int height, IntPtr parentWindowHandle, IntPtr menuHandle, IntPtr instanceHandle, [MarshalAs(UnmanagedType.AsAny)] object parameter ); #endregion |