Axiom.RenderSystems.DirectX9.Win32MessageHandling.WndProc C# (CSharp) Метод

WndProc() статический публичный Метод

Internal winProc (RenderWindow's use this when creating the Win32 Window)
static public WndProc ( Axiom.Graphics.RenderWindow win, Message &m ) : bool
win Axiom.Graphics.RenderWindow
m System.Windows.Forms.Message
Результат bool
		static public bool WndProc( RenderWindow win, ref Message m )
		{
			switch ( (WindowMessage)m.Msg )
			{
				case WindowMessage.Activate:
					{
						bool active = ( (ActivateState)( m.WParam.ToInt32() & 0xFFFF ) ) != ActivateState.InActive;
						win.IsActive = active;
						WindowEventMonitor.Instance.WindowFocusChange( win, active );
						break;
					}
				case WindowMessage.SysKeyDown:
					switch ( (VirtualKeys)m.WParam )
					{
						case VirtualKeys.Control:
						case VirtualKeys.Shift:
						case VirtualKeys.Menu: //ALT
							//return true to bypass defProc and signal we processed the message
							return true;
					}
					break;
				case WindowMessage.SysKeyUp:
					switch ( (VirtualKeys)m.WParam )
					{
						case VirtualKeys.Control:
						case VirtualKeys.Shift:
						case VirtualKeys.Menu: //ALT
							//return true to bypass defProc and signal we processed the message
							return true;
					}
					break;
				case WindowMessage.EnterSizeMove:
					//log->logMessage("WM_ENTERSIZEMOVE");
					break;
				case WindowMessage.ExitSizeMove:
					//log->logMessage("WM_EXITSIZEMOVE");
					break;
				case WindowMessage.Move:
					//log->logMessage("WM_MOVE");
					//win.WindowMovedOrResized();
					WindowEventMonitor.Instance.WindowMoved( win );
					break;
				case WindowMessage.Size:
					//log->logMessage("WM_SIZE");
					//win.WindowMovedOrResized();
					WindowEventMonitor.Instance.WindowResized( win );
					break;
				case WindowMessage.GetMinMaxInfo:
					// Prevent the window from going smaller than some minimum size
					//((MINMAXINFO*)lParam)->ptMinTrackSize.x = 100;
					//((MINMAXINFO*)lParam)->ptMinTrackSize.y = 100;
					break;
				case WindowMessage.Close:
					//log->logMessage("WM_CLOSE");
					WindowEventMonitor.Instance.WindowClosed( win );
					break;
			}
			return false;
		}

Usage Example

Пример #1
0
 protected override void WndProc(ref Message m)
 {
     if (!Win32MessageHandling.WndProc(this._renderWindow, ref m))
     {
         base.WndProc(ref m);
     }
 }