728x90
반응형
728x170
■ FormatMessage API 함수를 선언하는 방법을 보여준다.
▶ 예제 코드 (C#)
using System;
using System.Runtime.InteropServices;
#region 형식 메시지 구하기 - FormatMessage(flag, sourceHandle, messageID, languageID, message, size, argumentHandle)
/// <summary>
/// 형식 메시지 구하기
/// </summary>
/// <param name="flag">플래그</param>
/// <param name="sourceHandle">소스 핸들</param>
/// <param name="messageID">메시지 ID</param>
/// <param name="languageID">언어 ID</param>
/// <param name="message">메시지</param>
/// <param name="size">크기</param>
/// <param name="argumentHandle">인자 핸들</param>
/// <returns>처리 결과</returns>
[DllImport("kernel32", CharSet = CharSet.Auto)]
private static extern int FormatMessage(int flag, IntPtr sourceHandle, int messageID, int languageID, out string message, int size, IntPtr argumentHandle);
#endregion
728x90
반응형
그리드형(광고전용)
'C# > WIN32' 카테고리의 다른 글
[C#/WIN32] GetSystemInfo API 함수 선언하기 (0) | 2021.06.05 |
---|---|
[C#/WIN32] IsProcessorFeaturePresent API 함수 선언하기 (0) | 2021.06.05 |
[C#/WIN32] GetLogicalProcessorInformation API 함수 선언하기 (0) | 2021.06.05 |
[C#/WIN32] GetCursorPos API 함수 선언하기 (0) | 2021.05.31 |
[C#/WIN32] GetDiskFreeSpaceEx API 함수 선언하기 (0) | 2021.05.30 |
[C#/WIN32] RtlSetProcessIsCritical API 함수 선언하기 (0) | 2021.05.25 |
[C#/WIN32] SetKernelObjectSecurity API 함수 선언하기 (0) | 2021.05.25 |
[C#/WIN32] GetKernelObjectSecurity API 함수 선언하기 (0) | 2021.05.25 |
[C#/WIN32] SetThreadExecutionState API 함수 선언하기 (0) | 2021.05.25 |
[C#/WIN32] SetWindowDisplayAffinity API 함수 선언하기 (0) | 2021.05.25 |
댓글을 달아 주세요