■ ClosePrinter API 함수를 선언하는 방법을 보여준다.
▶ 예제 코드 (C#)
1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 |
using System; using System.Runtime.InteropServices; #region 프린터 닫기 - ClosePrinter(printerHandle) /// <summary> /// 프린터 닫기 /// </summary> /// <param name="printerHandle">프린터 핸들</param> /// <returns>처리 결과</returns> [DllImport("winspool", EntryPoint = "ClosePrinter", SetLastError = true, ExactSpelling = true, CallingConvention = CallingConvention.StdCall)] private static extern bool ClosePrinter(IntPtr printerHandle); #endregion |