728x90
반응형
728x170
▶ MainWindow.xaml.cs
using System;
using System.Windows;
using System.Windows.Interop;
namespace TestProject
{
/// <summary>
/// 메인 윈도우
/// </summary>
public partial class MainWindow : Window
{
//////////////////////////////////////////////////////////////////////////////////////////////////// Constructor
////////////////////////////////////////////////////////////////////////////////////////// Public
#region 생성자 - MainWindow()
/// <summary>
/// 생성자
/// </summary>
public MainWindow()
{
InitializeComponent();
HwndSource source = HwndSource.FromHwnd(new WindowInteropHelper(this).Handle);
source.AddHook(new HwndSourceHook(WndProc));
}
#endregion
//////////////////////////////////////////////////////////////////////////////////////////////////// Method
////////////////////////////////////////////////////////////////////////////////////////// Private
#region 윈도우 프로시저 처리하기 - WndProc(windowHandle, message, wordParameter, longParameter, handled)
/// <summary>
/// 윈도우 프로시저 처리하기
/// </summary>
/// <param name="windowHandle">윈도우 핸들</param>
/// <param name="message">메시지</param>
/// <param name="wordParameter">WORD 매개 변수</param>
/// <param name="longParameter">LONG 매개 변수</param>
/// <param name="handled">처리 여부</param>
/// <returns>처리 결과</returns>
private IntPtr WndProc(IntPtr windowHandle, int message, IntPtr wordParameter, IntPtr longParameter, ref bool handled)
{
return IntPtr.Zero;
}
#endregion
}
}
728x90
반응형
그리드형(광고전용)
'C# > WPF' 카테고리의 다른 글
[C#/WPF] 웹 카메라 사용하기 (0) | 2019.06.14 |
---|---|
[C#/WPF] 반투명 윈도우 사용하기 (0) | 2019.06.10 |
[C#/WPF] TreeView 클래스 : 데이터 바인딩시 부모 노드 사전 설정하기 (0) | 2019.06.02 |
[C#/WPF] TreeView 클래스 : ItemContainerGenerator 속성을 사용해 바인딩 데이터의 트리 노드 구하기 (0) | 2019.06.02 |
[C#/WPF] ComponentDispatcher 클래스 : ThreadFilterMessage 정적 이벤트를 사용해 윈도우 이벤트 가로채기 (0) | 2019.06.02 |
[C#/WPF] Dispatcher 클래스 : UnhandledExceptionFilter/UnhandledException 이벤트를 사용해 비정상 종료 방지하기 (0) | 2019.06.02 |
[C#/WPF] SystemColors 클래스 : 시스템 색상 표시하기 (0) | 2019.06.02 |
[C#/WPF] 메모리 손실이 없는 비트맵 소스 구하기 (0) | 2019.05.30 |
[C#/WPF] AppDomain 클래스 : 동일 프로세스에서 멀티 WPF 애플리케이션 실행하기 (0) | 2019.05.30 |
[C#/WPF] 복수 UI 스레드 윈도우 사용하기 (0) | 2019.05.30 |
댓글을 달아 주세요