using System;
using System.Windows.Forms;
using System.Runtime.InteropServices;
...
/// <summary>
/// 메시지 보내기
/// </summary>
/// <param name="windowHandle">윈도우 핸들</param>
/// <param name="message">메시지</param>
/// <param name="wParam">WORD 파리미터</param>
/// <param name="lParam">LONG 파라미터</param>
/// <returns>처리 결과</returns>
[DllImport("User32.dll")]
public static extern Int64 SendMessage(IntPtr windowHandle, uint message, IntPtr wParam, IntPtr lParam);
...
/// <summary>
/// WM_PAINT
/// </summary>
private const int WM_PAINT = 0x000f;
...
#region ForcePaint(form)
/// <summary>
/// 강제로 칠하기
/// </summary>
/// <param name="form">폼</param>
public void ForcePaint(Form form)
{
SendMessage(form.Handle, WM_PAINT, IntPtr.Zero, IntPtr.Zero);
}
#endregion
'c# 언어 > 초급과정' 카테고리의 다른 글
Form상속 (0) | 2022.03.17 |
---|---|
IntPtr 구조체 (0) | 2022.03.17 |
DrawString(drawText, drawFont, NoName.Drawing.Brushes.SteelBlue, xx, yy); (0) | 2022.03.16 |
When Owner draw Control ,,,,,,,,,,,, (0) | 2022.02.22 |
BackgroundWorker 사용법 : Form 혹은 Console이 사라지면 함께 작동을 멈춘다. (0) | 2022.02.10 |