本文整理汇总了C#中WindowMessage类的典型用法代码示例。如果您正苦于以下问题:C# WindowMessage类的具体用法?C# WindowMessage怎么用?C# WindowMessage使用的例子?那么恭喜您, 这里精选的类代码示例或许可以为您提供帮助。
WindowMessage类属于命名空间,在下文中一共展示了WindowMessage类的15个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的C#代码示例。
示例1: ApplicationMessageBinding
/// <summary>
/// Обычный конструктор
/// </summary>
public ApplicationMessageBinding(ApplicationMessage message, Keys mainKey, WindowMessage messageType)
{
Message = message;
Title = EnumFriendlyName<ApplicationMessage>.GetString(message);
this.mainKey = mainKey;
this.messageType = messageType;
}
示例2: FilterMessage
internal IntPtr FilterMessage( IntPtr hwnd, WindowMessage msg, IntPtr wParam, IntPtr lParam, ref bool handled )
{
// It is possible to be re-entered during disposal. Just return.
if(null == _source || null == _source.Value)
{
return IntPtr.Zero;
}
if (msg == WindowMessage.WM_APPCOMMAND)
{
// WM_APPCOMMAND message notifies a window that the user generated an application command event,
// for example, by clicking an application command button using the mouse or typing an application command
// key on the keyboard.
RawAppCommandInputReport report = new RawAppCommandInputReport(
_source.Value,
InputMode.Foreground,
SafeNativeMethods.GetMessageTime(),
GetAppCommand(lParam),
GetDevice(lParam),
InputType.Command);
handled = _site.Value.ReportInput(report);
}
return handled ? new IntPtr(1) : IntPtr.Zero ;
}
示例3: SendWindowMsg
public override void SendWindowMsg(WindowMessage msg, params object[] args)
{
base.SendWindowMsg(msg, args);
switch (msg) {
case WindowMessage.eWindow_BeAttacked:
//受击者被攻击
BattleRoleItem script = this.BeAttackedRoleGo.GetComponent<BattleRoleItem>();
script.SetBeAttackTargetPos((Vector3)args[0]);
script.BeAttackedStart();
break;
case WindowMessage.eWindow_BattleStart:
SetAttackBothSide((RoleType)args[0]);
BattleStart();
break;
case WindowMessage.eWindow_CurRoundOver:
BeforeNextRound();
if (BattleMgr.Instance.IsBattleOver()) {
BattleMgr.Instance.CurBattleStatus = BattleStatus.Invalid;
return;
}
BattleMgr.Instance.bStartRun = true; //本轮攻击结束,开始跑速
break;
default:
break;
}
}
示例4: Initialize
public void Initialize()
{
var window = new WindowMessage(Text);
ManagerWindow.NewWindow("gameEventMessage",window);
ManagerInput.ThrottleInput = true;
Done = false;
}
示例5: RegisterWindowMessageHandler
public bool RegisterWindowMessageHandler(WindowMessage callback)
{
bool result = true;
if (null == callback)
{
throw FxTrace.Exception.AsError(new ArgumentNullException("callback"));
}
//if there are no other callbacks registered - create initial multicast delegate
//and hookup message processing
if (null == this.listeners)
{
this.listeners = (WindowMessage)Delegate.Combine(callback);
this.HookupMessageProcessing();
}
//otherwise, check if callback is not in the list already
else
{
Delegate[] initial = this.listeners.GetInvocationList();
//if it isn't - add it to callback list
if (-1 == Array.IndexOf<Delegate>(initial, callback))
{
Delegate[] combined = new Delegate[initial.Length + 1];
combined[initial.Length] = callback;
Array.Copy(initial, combined, initial.Length);
this.listeners = (WindowMessage)Delegate.Combine(combined);
}
else
{
result = false;
}
}
return result;
}
示例6: DialogProc
protected override bool DialogProc(IntPtr hwndDlg, WindowMessage uMsg, IntPtr wParam, IntPtr lParam)
{
switch (uMsg)
{
case WindowMessage.InitDialog:
{
Rect initialSize = new Rect
{
Left = 0,
Top = 0,
Right = 260,
Bottom = 260
};
Win32.MapDialogRect(hwndDlg, ref initialSize);
this.Size = new System.Drawing.Size(initialSize.Right, initialSize.Bottom);
this.Refresh();
}
break;
}
return base.DialogProc(hwndDlg, uMsg, wParam, lParam);
}
示例7: GetKeyboardKeyAction
internal KeyboardKeyAction GetKeyboardKeyAction(WindowMessage message)
{
KeyboardKeyAction action;
if (!_mappings.WindowMessageToKeyboardKeyAction.TryGetValue(message, out action))
{
action = KeyboardKeyAction.None;
}
return action;
}
示例8: SendWindowMsg
public void SendWindowMsg(WindowID targetWindow, WindowMessage msg, params object[] args)
{
if (!AllWindowScript.ContainsKey(targetWindow)) {
return;
}
if (!AllWindowScript[targetWindow]) {
return;
}
AllWindowScript[targetWindow].SendWindowMsg(msg, args);
}
示例9: DialogProc
protected override unsafe bool DialogProc(IntPtr hwndDlg, WindowMessage uMsg, IntPtr wParam, IntPtr lParam)
{
switch (uMsg)
{
case WindowMessage.InitDialog:
{
Rect initialSize;
initialSize.left = 0;
initialSize.top = 0;
initialSize.right = 260;
initialSize.bottom = 260;
NativeApi.MapDialogRect(hwndDlg, ref initialSize);
this.Size = new System.Drawing.Size(initialSize.right, initialSize.bottom);
}
break;
case WindowMessage.ShowWindow:
if (!_layoutInitialized)
{
void* dialogItem = NativeApi.PhAddPropPageLayoutItem(
hwndDlg,
hwndDlg,
(void*)0x1, // PH_PROP_PAGE_TAB_CONTROL_PARENT
0xf // PH_ANCHOR_ALL
);
// Resize our .NET-based control automatically as well.
NativeApi.PhAddPropPageLayoutItem(
hwndDlg,
this.Handle,
dialogItem,
0xf // PH_ANCHOR_ALL
);
NativeApi.PhDoPropPageLayout(hwndDlg);
_layoutInitialized = true;
}
break;
}
return base.DialogProc(hwndDlg, uMsg, wParam, lParam);
}
示例10: ScrollToBottom
public static Boolean ScrollToBottom(IntPtr Handle, Boolean Blocking)
{
WindowMessage Message = new WindowMessage();
Message.Handle = Handle;
Message.InVal = KEYWORDS.WM_VSCROLL;
Message.PtrLparam = new IntPtr(0);
Message.PtrWparam = KEYWORDS.SB_BOTTOM;
if (Blocking)
{
return System.Boolean.Equals(true, SendWindowMessage(Message));
}
else
{
ParameterizedThreadStart pts = new ParameterizedThreadStart(SendWindowMessage);
Thread t = new Thread(pts);
t.Start(Message);
return false;
}
}
示例11: HandleXButtonDown
void HandleXButtonDown(IntPtr handle, WindowMessage message, IntPtr wParam, IntPtr lParam)
{
Functions.SetCapture(window.Handle);
mouse[((wParam.ToInt32() & 0xFFFF0000) >> 16) == 1 ?
MouseButton.Button1 : MouseButton.Button2] = true;
}
示例12: HandleRButtonDown
void HandleRButtonDown(IntPtr handle, WindowMessage message, IntPtr wParam, IntPtr lParam)
{
Functions.SetCapture(window.Handle);
mouse[MouseButton.Right] = true;
}
示例13: ProcessMouseMessage
/// <summary>
/// Filters out a mouse message before it is dispatched
/// </summary>
/// <param name="target">The Control that will receive the message</param>
/// <param name="msg">A WindowMessage that represents the message to process</param>
/// <param name="wParam">Specifies the WParam field of the message</param>
/// <param name="lParam">Specifies the LParam field of the message</param>
/// <returns>true to filter the message and prevent it from being dispatched;
/// false to allow the message to continue to the next filter or control</returns>
public override bool ProcessMouseMessage(Control target, WindowMessage msg, int wParam, int lParam)
{
if (this.DroppedDown)
{
if (msg == WindowMessage.WM_LBUTTONDOWN || msg == WindowMessage.WM_RBUTTONDOWN ||
msg == WindowMessage.WM_MBUTTONDOWN || msg == WindowMessage.WM_XBUTTONDOWN ||
msg == WindowMessage.WM_NCLBUTTONDOWN || msg == WindowMessage.WM_NCRBUTTONDOWN ||
msg == WindowMessage.WM_NCMBUTTONDOWN || msg == WindowMessage.WM_NCXBUTTONDOWN)
{
Point cursorPos = Cursor.Position;
if (!this.DropDown.Bounds.Contains(cursorPos))
{
if (target != this.EditingTable && target != this.TextBox)
{
if (this.ShouldStopEditing(target, cursorPos))
{
this.EditingTable.StopEditing();
}
}
}
}
else if (msg == WindowMessage.WM_MOUSEMOVE)
{
Point cursorPos = Cursor.Position;
if (this.DropDown.Bounds.Contains(cursorPos))
{
if (!this.containsMouse)
{
this.containsMouse = true;
this.EditingTable.RaiseCellMouseLeave(this.EditingCellPos);
}
}
else
{
this.containsMouse = true;
}
}
}
return false;
}
示例14: WindowProcedure
protected override IntPtr WindowProcedure(IntPtr handle, WindowMessage message, IntPtr wParam, IntPtr lParam)
{
switch (message)
{
case WindowMessage.INPUT:
int Size = 0;
Functions.GetRawInputData(lParam, GetRawInputDataEnum.INPUT, IntPtr.Zero, out Size, API.RawInputHeaderSize);
if (Size == Functions.GetRawInputData(lParam, GetRawInputDataEnum.INPUT, out WinRawInput.data, out Size, API.RawInputHeaderSize))
{
switch (WinRawInput.data.Header.Type)
{
case RawInputDeviceType.MOUSE:
if (((WinRawMouse) this.MouseDriver).ProcessMouseEvent(WinRawInput.data))
return IntPtr.Zero;
else
break;
case RawInputDeviceType.KEYBOARD:
if (((WinRawKeyboard) this.KeyboardDriver).ProcessKeyboardEvent(WinRawInput.data))
return IntPtr.Zero;
else
break;
}
}
else
break;
case WindowMessage.DEVICECHANGE:
((WinRawKeyboard) this.KeyboardDriver).RefreshDevices();
((WinRawMouse) this.MouseDriver).RefreshDevices();
break;
}
return base.WindowProcedure(handle, message, wParam, lParam);
}
示例15: HandleDestroy
void HandleDestroy(IntPtr handle, WindowMessage message, IntPtr wParam, IntPtr lParam)
{
exists = false;
if (handle == window.Handle)
{
Functions.UnregisterClass(ClassName, Instance);
}
window.Dispose();
child_window.Dispose();
Closed(this, EventArgs.Empty);
}