本文整理汇总了C#中System.Windows.Forms.Message类的典型用法代码示例。如果您正苦于以下问题:C# Message类的具体用法?C# Message怎么用?C# Message使用的例子?那么恭喜您, 这里精选的类代码示例或许可以为您提供帮助。
Message类属于System.Windows.Forms命名空间,在下文中一共展示了Message类的20个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于我们的系统推荐出更棒的C#代码示例。
示例1: FromMessage
public void FromMessage(ref Message msg)
{
this.Hwnd = msg.HWnd;
this.Msg = msg.Msg;
this.WParam = msg.WParam;
this.LParam = msg.LParam;
}
开发者ID:zhushengwen,项目名称:example-zhushengwen,代码行数:7,代码来源:API_MSG.cs
示例2: WndProc
protected override void WndProc(ref Message m)
{
if (m.Msg == 0x0203) // WM_LBUTTONDBLCLK
{
// Do nothing:
// This prevents embedded RichText objects from being edited by double-clicking them from a
// RichText control. See: http://stackoverflow.com/questions/1149811/net-framework-how-to-make-richtextbox-true-read-only
}
else if (m.Msg == 0x000F) // WM_PAINT
{
if (!Drawing)
{
base.WndProc(ref m); // if we decided to paint this control, just call the RichTextBox WndProc
}
else
{
m.Result = IntPtr.Zero; // not painting, must set this to IntPtr.Zero if not painting otherwise serious problems.
}
}
else
{
try
{
base.WndProc(ref m);
}
catch { }
}
}
开发者ID:boffrey,项目名称:EKUnleashed,代码行数:28,代码来源:RichTextBoxLinksTransparentBackground.cs
示例3: PreFilterMessage
/// <summary>
/// The filter message.
/// </summary>
public bool PreFilterMessage(ref Message m)
{
bool handled = false;
Keys key = Keys.None;
switch (m.Msg)
{
case WM_KEYUP:
key = (Keys)m.WParam;
handled = HandleModifier(key, false);
break;
case WM_KEYDOWN:
key = (Keys)m.WParam;
handled = HandleModifier(key, true);
if (false == handled)
{
// If one of the defined keys was pressed then we
// raise an event.
handled = HandleDefinedKey(key);
}
break;
}
return handled;
}
开发者ID:r23,项目名称:r23-signageclient,代码行数:29,代码来源:KeyStore.cs
示例4: ProcessCmdKey
protected override bool ProcessCmdKey(ref Message msg, Keys keyData)
{
if (keyData == Keys.Enter)
{
if (!(this.current_focused_control is Button))
{
if (this.current_focused_control.Name == this.mskNewSernum.Name)
{
if (ValidateSN.Check(this.mskNewSernum.Text))
{
SendKeys.Send("{TAB}");
return true;
}
}
else
{
SendKeys.Send("{TAB}");
return true;
}
}
}
if (keyData == Keys.Escape)
{
this.DialogResult = DialogResult.Cancel;
this.Close();
return true;
}
return base.ProcessCmdKey(ref msg, keyData);
}
开发者ID:wee2tee,项目名称:SN_Net,代码行数:29,代码来源:LostRenewForm.cs
示例5: WndProc
protected override void WndProc(ref Message m)
{
if (m.Msg == Program.WM_ACTIVATEAPP && m.WParam.ToInt32() == Program.ProgramId)
ShowWindow();
else if (m.Msg == WinAPI.WM_COPYDATA)
{
ShowWindow();
logger.Log(LogLevel.Trace, "Received message WM_COPYDATA");
try
{
WinAPI.CopyDataStruct data = (WinAPI.CopyDataStruct)m.GetLParam(typeof(WinAPI.CopyDataStruct));
string message = string.Empty;
unsafe
{
message = new string((char*)(data.lpData), 0, data.cbData / 2);
}
logger.Log(LogLevel.Trace, "\tdata: " + message);
m.Result = new IntPtr(1); //return "True" to caller
ShowNotification("Received message: " + message);
if (!model.LoadTorrent(message))
ShowNotification("Error loading torrent " + message);
}
catch (Exception ex)
{
logger.Log(LogLevel.Error, "Error retrieving message data");
}
}
else
base.WndProc(ref m);
}
开发者ID:chitza,项目名称:uDir,代码行数:33,代码来源:MainForm.cs
示例6: WndProc
protected override void WndProc(ref Message m)
{
switch (m.Msg)
{
case WM_CLIPBOARDUPDATE:
var args = new ClipbardUpdatedEventArgs();
OnClipboardUpdated(args);
if (args.Handled) m.Result = IntPtr.Zero;
return;
case WM_DESTROY:
#if DEBUG
Console.WriteLine("ClipboardMonitor: WM_DESTROY");
#endif
StopMonitor();
break;
case WM_CLOSE:
#if DEBUG
Console.WriteLine("ClipboardMonitor: WM_CLOSE");
#endif
StopMonitor();
break;
}
base.WndProc(ref m);
}
开发者ID:huipengly,项目名称:WGestures,代码行数:25,代码来源:ClipboardMonitor.cs
示例7: DoesMouseDownGetEaten
/// <summary>
/// Should the mouse down be eaten when the tracking has been ended.
/// </summary>
/// <param name="m">Original message.</param>
/// <param name="pt">Screen coordinates point.</param>
/// <returns>True to eat message; otherwise false.</returns>
public override bool DoesMouseDownGetEaten(Message m, Point pt)
{
// If the user dismissed the context menu by clicking down on the drop down button of
// the KryptonDateTimePicker then eat the down message to prevent the down press from
// opening the menu again.
return _dropScreenRect.Contains(new Point(pt.X, pt.Y));
}
开发者ID:Cocotteseb,项目名称:Krypton,代码行数:13,代码来源:VisualContextMenuDTP.cs
示例8: ProcessCmdKey
protected override bool ProcessCmdKey(ref Message msg, Keys keyData)
{
switch (keyData)
{
case Keys.F5:
_refresh.PerformClick();
return true;
case Keys.Home:
_home.PerformClick();
return true;
case Keys.Control | Keys.F:
_search.Focus();
_search.SelectAll();
break;
case Keys.Escape:
if (_isNavigating)
_stop.PerformClick();
else
Close();
return true;
case Keys.Control | Keys.P:
_print.PerformClick();
break;
}
return base.ProcessCmdKey(ref msg, keyData);
}
开发者ID:netide,项目名称:netide,代码行数:32,代码来源:HelpForm.cs
示例9: WndProc
protected override void WndProc(ref Message m)
{
if (m.Msg == _globalMsgV41)
{
if (m.WParam == (IntPtr)Snarl.V41.SnarlConnector.GlobalEvent.SnarlQuit)
{
AppController.Stop();
}
else if (m.WParam == (IntPtr)Snarl.V41.SnarlConnector.GlobalEvent.SnarlLaunched)
{
AppController.Current.RegisterWithSnarl();
}
}
else if (m.Msg == ReplyMsgV41)
{
if (m.WParam == (IntPtr)Snarl.V41.SnarlConnector.MessageEvent.NotificationAck)
{
AppController.Current.MousebuttonHasBeenClicked("left", (Int32)m.LParam);
}
else if (m.WParam == (IntPtr)Snarl.V41.SnarlConnector.MessageEvent.NotificationCancelled)
{
AppController.Current.MousebuttonHasBeenClicked("right", (Int32)m.LParam);
}
else if (m.WParam == (IntPtr)Snarl.V41.SnarlConnector.MessageEvent.NotificationMiddleButton)
{
AppController.Current.MousebuttonHasBeenClicked("middle", (Int32)m.LParam);
}
else if (m.WParam == (IntPtr)Snarl.V41.SnarlConnector.MessageEvent.NotificationTimedOut)
{
}
}
base.WndProc(ref m);
}
开发者ID:TlhanGhun,项目名称:PurpleTreehouse,代码行数:34,代码来源:SnarlMsgWnd.cs
示例10: MessageEvent
protected void MessageEvent(object sender, ref Message m, ref bool handled) {
//Handle WM_Hotkey event
if (handled) {
return;
}
switch ((Win32Msgs)m.Msg) {
case Win32Msgs.WM_DRAWCLIPBOARD:
handled = true;
if (Changed != null) {
Changed(this, EventArgs.Empty);
}
User32.SendMessage(nextWindow, m.Msg, m.WParam, m.LParam);
break;
case Win32Msgs.WM_CHANGECBCHAIN:
if (m.WParam == nextWindow) {
nextWindow = m.LParam;
} else {
User32.SendMessage(nextWindow, m.Msg, m.WParam, m.LParam);
}
break;
}
}
开发者ID:roomaroo,项目名称:coapp.powershell,代码行数:27,代码来源:ClipboardNotifier.cs
示例11: WndProc
protected override void WndProc(ref Message m)
{
base.WndProc(ref m);
int x = 0;
int y = 0;
if(m.Msg == 0xca)
{
x = Cursor.Position.X;
y = Cursor.Position.Y;
if(
(x < this.Location.X) ||
(this.Location.X + this.Width < x) ||
(y < this.Location.Y) ||
(this.Location.Y + this.Height < y)
)
{
this.Close();
return;
}
this.Capture = true;
}
}
开发者ID:kusa-mochi,项目名称:simple-account-book,代码行数:26,代码来源:AmountsDetailForm.cs
示例12: WndProc
protected override void WndProc(ref Message m)
{
base.WndProc(ref m);
if (m.Msg == HotKeys.WM_HOTKEY)
HotKeys.TriggerKey(this.id);
}
开发者ID:jariz,项目名称:EasyCapture,代码行数:7,代码来源:HotKeyForm.cs
示例13: ProcessCmdKey
protected override bool ProcessCmdKey(ref Message msg, Keys keyData)
{
try {
switch (keyData) {
case Keys.Escape:
DialogResult = DialogResult.OK;
break;
case Keys.E:
MessageBox.Show(EnvironmentInfo.EnvironmentToString(true));
break;
case Keys.L:
try {
if (File.Exists( MainForm.LogFileLocation)) {
System.Diagnostics.Process.Start("\"" + MainForm.LogFileLocation + "\"");
} else {
MessageBox.Show("Greenshot can't write to logfile, otherwise it would be here: " + MainForm.LogFileLocation);
}
} catch (Exception) {
MessageBox.Show("Couldn't open the greenshot.log, it's located here: " + MainForm.LogFileLocation, "Error opening greeenshot.log", MessageBoxButtons.OK, MessageBoxIcon.Asterisk);
}
break;
case Keys.I:
try {
System.Diagnostics.Process.Start("\"" + IniFile.IniConfig.ConfigLocation + "\"");
} catch (Exception) {
MessageBox.Show("Couldn't open the greenshot.ini, it's located here: " + IniFile.IniConfig.ConfigLocation, "Error opening greeenshot.ini", MessageBoxButtons.OK, MessageBoxIcon.Asterisk);
}
break;
default:
return base.ProcessCmdKey(ref msg, keyData);
}
} catch (Exception) {
}
return true;
}
开发者ID:modulexcite,项目名称:ZScreen_Google_Code,代码行数:35,代码来源:AboutForm.cs
示例14: WndProc
/// <summary>
/// 重载WbdProc,实现热键响应
/// </summary>
/// <param name="m"></param>
protected override void WndProc(ref Message m)
{
const int WM_HOTKEY = 0x0312;
//按快捷键
if (m.Msg == WM_HOTKEY)
{
switch (m.WParam.ToInt32())
{
case 100:
{
groupTree.Select();
statusLabel.Text = "按下F1键:焦点移到到选择组区。";
}
break;
case 1: //按下的是F1,则相应
{
HotKey.UnregisterHotKey(Handle, 100);//注销热键
HotKey.UnregisterHotKey(Handle, 101);
HotKey.UnregisterHotKey(Handle, 102);
}
break;
}
}
base.WndProc(ref m);
}
开发者ID:holenzh,项目名称:CSharpProjAtYC,代码行数:30,代码来源:MainForm.cs
示例15: ProcessCmdKey
protected override bool ProcessCmdKey(ref Message msg, Keys keyData)
{
if ((keyData & Keys.F5) == Keys.F5)
this.TriggerCompileButtonClicked();
return base.ProcessCmdKey(ref msg, keyData);
}
开发者ID:smack0007,项目名称:TurtleSharp,代码行数:7,代码来源:MainForm.cs
示例16: ProcessCmdKey
protected override bool ProcessCmdKey(ref Message msg, Keys keyData)
{
// http://support.microsoft.com/kb/320584
const int WM_KEYDOWN = 0x100;
if (msg.Msg == WM_KEYDOWN)
{
if (keyData.Equals(Keys.Control | Keys.A))
{
base.SelectAll();
return true;
}
if (keyData.Equals(Keys.Control | Keys.Back))
{
if (SelectionStart - 1 < 0)
return true;
int min = Math.Min(SelectionStart, Text.Length - 1);
int lastSpace = Text.LastIndexOf(' ', min, min);
if (lastSpace == -1) // we delete all except symbols after selection
{
Text = Text.Substring(SelectionStart);
return true;
}
string start = Text.Substring(0, lastSpace);
string end = Text.Substring(Math.Min(SelectionStart, Text.Length));
Text = start + end;
base.Select(lastSpace, 0);
return true;
}
}
return base.ProcessCmdKey(ref msg, keyData);
}
开发者ID:povilaspanavas,项目名称:minder,代码行数:31,代码来源:MTextBox.cs
示例17: WndProc
protected override void WndProc(ref Message m)
{
// Swallow mouse messages that are not in the client area
if (m.Msg >= 0x201 && m.Msg <= 0x209)
{
Point pos = new Point((int) (m.LParam.ToInt64() & 0xffff), (int) (m.LParam.ToInt64() >> 16));
var hit = this.HitTest(pos);
switch (hit.Location)
{
case ListViewHitTestLocations.AboveClientArea:
case ListViewHitTestLocations.BelowClientArea:
case ListViewHitTestLocations.LeftOfClientArea:
case ListViewHitTestLocations.RightOfClientArea:
case ListViewHitTestLocations.None:
return;
}
}
//hide scroll
switch (m.Msg)
{
case 0x83: // WM_NCCALCSIZE
int style = (int)GetWindowLong(this.Handle, GWL_STYLE);
if ((style & WS_HSCROLL) == WS_HSCROLL)
SetWindowLong(this.Handle, GWL_STYLE, style & ~WS_HSCROLL);
base.WndProc(ref m);
break;
default:
base.WndProc(ref m);
break;
}
}
开发者ID:huipengly,项目名称:WGestures,代码行数:34,代码来源:AlwaysSelectedListView.cs
示例18: WndProc
protected override void WndProc(ref Message m)
{
switch (m.Msg)
{
case User32.WM_PAINT:
{
try
{
m_painting = true;
base.WndProc(ref m);
if (VirtualListSize == 0)
{
using (Graphics gfx = CreateGraphics())
DrawBackground(gfx, Bounds, BackColor);
}
}
finally
{
m_painting = false;
}
}
break;
default:
base.WndProc(ref m);
break;
}
}
开发者ID:arsaccol,项目名称:SLED,代码行数:29,代码来源:SledTtyListView.cs
示例19: ProcessCmdKey
protected override bool ProcessCmdKey(ref Message msg, Keys keyData)
{
char cCaracter = (char)keyData;
if (char.IsLetterOrDigit(cCaracter) || keyData == Keys.Space)
{
this.lblBusqueda.Text += cCaracter;
}
else
{
switch (keyData)
{
case Keys.Escape:
if (this.lblBusqueda.Text == "")
this.Close();
else
this.lblBusqueda.Text = "";
break;
case Keys.Back:
if (this.lblBusqueda.Text != "")
this.lblBusqueda.Text = this.lblBusqueda.Text.Izquierda(this.lblBusqueda.Text.Length - 1);
break;
case Keys.Enter:
this.dgvListado_CellDoubleClick(this, null);
break;
case Keys.Up:
break;
case Keys.Down:
break;
// default:
// return base.ProcessCmdKey(ref msg, keyData);
}
}
return false;
}
开发者ID:moisesiq,项目名称:aupaga,代码行数:34,代码来源:SeleccionListado.cs
示例20: WndProc
protected override void WndProc(ref Message message)
{
switch (message.Msg)
{
case Win32.WM_INPUT:
{
_keyboardDriver.ProcessRawInput(message.LParam);
}
break;
case Win32.WM_USB_DEVICECHANGE:
{
if (delemiter == 1)
{
Debug.WriteLine("USB Device Arrival / Removal");
_keyboardDriver.EnumerateDevices();
delemiter = 0;
}
else
delemiter = 1;
}
break;
}
base.WndProc(ref message);
}
开发者ID:ActiveAuthentication,项目名称:ActiveAuthentication,代码行数:26,代码来源:RawInput.cs
注:本文中的System.Windows.Forms.Message类示例由纯净天空整理自Github/MSDocs等源码及文档管理平台,相关代码片段筛选自各路编程大神贡献的开源项目,源码版权归原作者所有,传播和使用请参考对应项目的License;未经允许,请勿转载。 |
请发表评论