本文整理汇总了C#中System.Windows.Forms.Msg类的典型用法代码示例。如果您正苦于以下问题:C# Msg类的具体用法?C# Msg怎么用?C# Msg使用的例子?那么恭喜您, 这里精选的类代码示例或许可以为您提供帮助。
Msg类属于System.Windows.Forms命名空间,在下文中一共展示了Msg类的20个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于我们的系统推荐出更棒的C#代码示例。
示例1: SendMessage
public static IntPtr SendMessage (IntPtr hwnd, Msg message, IntPtr wParam, IntPtr lParam)
{
if (_onMSNET)
return SendMessage_Win32 (hwnd, (int) message, wParam, lParam);
else
return (IntPtr) InvokeMethod ("SendMessage", new object[] { hwnd, message, wParam, lParam });
}
开发者ID:JianwenSun,项目名称:mono-soc-2007,代码行数:7,代码来源:Native.cs
示例2: SendMessage
public static IntPtr SendMessage (IntPtr hwnd, Msg message, IntPtr wParam, IntPtr lParam)
{
Assembly assembly = Assembly.Load (Consts.AssemblySystem_Windows_Forms);
Type refType = assembly.GetType ("System.Windows.Forms.Message&");
object[] args = new object[] { Message.Create (hwnd, (int)message, wParam, lParam) };
InvokeMethod ("SendMessage", args, new Type[] { refType });
return ((Message)args[0]).Result;
}
开发者ID:nlhepler,项目名称:mono,代码行数:9,代码来源:Native.cs
示例3: ProcessMenuKey
void ProcessMenuKey (Msg msg_type)
{
if (TopMenu.MenuItems.Count == 0)
return;
MainMenu main_menu = TopMenu as MainMenu;
switch (msg_type) {
case Msg.WM_SYSKEYDOWN:
switch (keynav_state) {
case KeyNavState.Idle:
keynav_state = KeyNavState.Startup;
hotkey_active = true;
GrabControl.ActiveTracker = this;
CurrentMenu = TopMenu;
main_menu.Draw ();
break;
case KeyNavState.Startup:
break;
default:
Deactivate ();
main_menu.Draw ();
break;
}
break;
case Msg.WM_SYSKEYUP:
switch (keynav_state) {
case KeyNavState.Idle:
case KeyNavState.Navigating:
break;
case KeyNavState.Startup:
keynav_state = KeyNavState.NoPopups;
SelectItem (TopMenu, TopMenu.MenuItems [0], false);
break;
default:
Deactivate ();
main_menu.Draw ();
break;
}
break;
}
}
开发者ID:stabbylambda,项目名称:mono,代码行数:43,代码来源:MenuAPI.cs
示例4: PeekMessage
private static extern bool PeekMessage( out Msg msg, IntPtr handle, uint msgFilterMin, uint msgFilterMax,
uint removeMsg );
开发者ID:ryan-bunker,项目名称:axiom3d,代码行数:2,代码来源:Win32MessageHandling.cs
示例5: PostMessage
// FIXME - I think this should just enqueue directly
public bool PostMessage (IntPtr handle, Msg message, IntPtr wparam, IntPtr lparam)
{
XEvent xevent = new XEvent ();
X11Hwnd hwnd = (X11Hwnd)Hwnd.ObjectFromHandle(handle);
xevent.type = XEventName.ClientMessage;
xevent.ClientMessageEvent.display = display;
if (hwnd != null) {
xevent.ClientMessageEvent.window = hwnd.WholeWindow;
} else {
xevent.ClientMessageEvent.window = IntPtr.Zero;
}
xevent.ClientMessageEvent.message_type = Atoms.PostAtom;
xevent.ClientMessageEvent.format = 32;
xevent.ClientMessageEvent.ptr1 = handle;
xevent.ClientMessageEvent.ptr2 = (IntPtr) message;
xevent.ClientMessageEvent.ptr3 = wparam;
xevent.ClientMessageEvent.ptr4 = lparam;
hwnd.Queue.Enqueue (xevent);
return true;
}
开发者ID:BrzVlad,项目名称:mono,代码行数:26,代码来源:X11Display.cs
示例6: Win32DefWindowProc
private extern static IntPtr Win32DefWindowProc(IntPtr hWnd, Msg Msg, IntPtr wParam, IntPtr lParam);
开发者ID:ItsVeryWindy,项目名称:mono,代码行数:1,代码来源:XplatUIWin32.cs
示例7: Win32PostMessage
private extern static bool Win32PostMessage(IntPtr hwnd, Msg msg, IntPtr wParam, IntPtr lParam);
开发者ID:ItsVeryWindy,项目名称:mono,代码行数:1,代码来源:XplatUIWin32.cs
示例8: SendParentNotify
// For WM_LBUTTONDOWN, WM_MBUTTONDOWN, WM_RBUTTONDOWN, WM_XBUTTONDOWN
// WM_CREATE and WM_DESTROY causes
void SendParentNotify(IntPtr child, Msg cause, int x, int y)
{
Hwnd hwnd;
if (child == IntPtr.Zero) {
return;
}
hwnd = Hwnd.GetObjectFromWindow (child);
if (hwnd == null) {
return;
}
if (hwnd.Handle == IntPtr.Zero) {
return;
}
if (ExStyleSet ((int) hwnd.initial_ex_style, WindowExStyles.WS_EX_NOPARENTNOTIFY)) {
return;
}
if (hwnd.Parent == null) {
return;
}
if (hwnd.Parent.Handle == IntPtr.Zero) {
return;
}
if (cause == Msg.WM_CREATE || cause == Msg.WM_DESTROY) {
SendMessage(hwnd.Parent.Handle, Msg.WM_PARENTNOTIFY, Control.MakeParam((int)cause, 0), child);
} else {
SendMessage(hwnd.Parent.Handle, Msg.WM_PARENTNOTIFY, Control.MakeParam((int)cause, 0), Control.MakeParam(x, y));
}
SendParentNotify (hwnd.Parent.Handle, cause, x, y);
}
开发者ID:nlhepler,项目名称:mono,代码行数:40,代码来源:XplatUIX11.cs
示例9: SendMessage
internal override IntPtr SendMessage (IntPtr hwnd, Msg message, IntPtr wParam, IntPtr lParam) {
return Win32SendMessage(hwnd, message, wParam, lParam);
}
开发者ID:ItsVeryWindy,项目名称:mono,代码行数:3,代码来源:XplatUIWin32.cs
示例10: WaitForHwndMessage
void WaitForHwndMessage (Hwnd hwnd, Msg message) {
WaitForHwndMessage (hwnd, message, false);
}
开发者ID:nlhepler,项目名称:mono,代码行数:4,代码来源:XplatUIX11.cs
示例11: PostMessage
internal override bool PostMessage (IntPtr handle, Msg message, IntPtr wparam, IntPtr lparam)
{
XEvent xevent = new XEvent ();
Hwnd hwnd = Hwnd.ObjectFromHandle(handle);
xevent.type = XEventName.ClientMessage;
xevent.ClientMessageEvent.display = DisplayHandle;
if (hwnd != null) {
xevent.ClientMessageEvent.window = hwnd.whole_window;
} else {
xevent.ClientMessageEvent.window = IntPtr.Zero;
}
xevent.ClientMessageEvent.message_type = (IntPtr) PostAtom;
xevent.ClientMessageEvent.format = 32;
xevent.ClientMessageEvent.ptr1 = handle;
xevent.ClientMessageEvent.ptr2 = (IntPtr) message;
xevent.ClientMessageEvent.ptr3 = wparam;
xevent.ClientMessageEvent.ptr4 = lparam;
if (hwnd != null)
hwnd.Queue.EnqueueLocked (xevent);
else
ThreadQueue(Thread.CurrentThread).EnqueueLocked (xevent);
return true;
}
开发者ID:nlhepler,项目名称:mono,代码行数:28,代码来源:XplatUIX11.cs
示例12: PostMessage
internal override bool PostMessage (IntPtr handle, Msg message, IntPtr wparam, IntPtr lparam)
{
return display.PostMessage (handle, message, wparam, lparam);
}
开发者ID:stabbylambda,项目名称:mono,代码行数:4,代码来源:XplatUIX11-new.cs
示例13: SendMessage
// XXX this is likely shareable amongst other backends
internal override IntPtr SendMessage (IntPtr handle, Msg message, IntPtr wParam, IntPtr lParam)
{
return display.SendMessage (handle, message, wParam, lParam);
}
开发者ID:stabbylambda,项目名称:mono,代码行数:5,代码来源:XplatUIX11-new.cs
示例14: SendMessage
internal static IntPtr SendMessage (IntPtr handle, Msg message, IntPtr wParam, IntPtr lParam)
{
DriverDebug ("SendMessage ({0}, {1}, {2:X}, {3:X}): Called", Window (handle), message, wParam.ToInt32 (), lParam.ToInt32 ());
return driver.SendMessage (handle, message, wParam, lParam);
}
开发者ID:nlhepler,项目名称:mono,代码行数:5,代码来源:XplatUI.cs
示例15: PostMessage
internal static bool PostMessage (IntPtr hwnd, Msg message, IntPtr wParam, IntPtr lParam)
{
DriverDebug ("PostMessage ({0}, {1}, {2:X}, {3:X}): Called", Window (hwnd), message, wParam.ToInt32 (), lParam.ToInt32 ());
return driver.PostMessage (hwnd, message, wParam, lParam);
}
开发者ID:nlhepler,项目名称:mono,代码行数:5,代码来源:XplatUI.cs
示例16: WndProc
internal static IntPtr WndProc(IntPtr hWnd, Msg msg, IntPtr wParam, IntPtr lParam)
{
IntPtr result = IntPtr.Zero;
Message m = new Message();
m.HWnd = hWnd;
m.Msg = (int)msg;
m.WParam = wParam;
m.LParam = lParam;
m.Result = IntPtr.Zero;
#if debug
Console.WriteLine("NativeWindow.cs ({0}, {1}, {2}, {3}): result {4}", hWnd, msg, wParam, lParam, m.Result);
#endif
NativeWindow window = null;
try {
object current = null;
lock (window_collection) {
current = window_collection[hWnd];
}
window = current as NativeWindow;
if (current == null)
window = EnsureCreated (window, hWnd);
if (window != null) {
window.WndProc (ref m);
result = m.Result;
} else if (current is ArrayList) {
ArrayList windows = (ArrayList) current;
lock (windows) {
if (windows.Count > 0) {
window = EnsureCreated ((NativeWindow)windows[0], hWnd);
window.WndProc (ref m);
// the first one is the control's one. all others are synthetic,
// so we want only the result from the control
result = m.Result;
for (int i=1; i < windows.Count; i++)
((NativeWindow)windows[i]).WndProc (ref m);
}
}
} else {
result = XplatUI.DefWndProc (ref m);
}
}
catch (Exception ex) {
#if !ExternalExceptionHandler
if (window != null) {
if (msg == Msg.WM_PAINT && window is Control.ControlNativeWindow) {
// Replace control with a red cross
var control = ((Control.ControlNativeWindow)window).Owner;
control.Hide ();
var redCross = new Control (control.Parent, string.Empty);
redCross.BackColor = Color.White;
redCross.ForeColor = Color.Red;
redCross.Bounds = control.Bounds;
redCross.Paint += HandleRedCrossPaint;
}
window.OnThreadException (ex);
}
#else
throw;
#endif
}
#if debug
Console.WriteLine("NativeWindow.cs: Message {0}, result {1}", msg, m.Result);
#endif
return result;
}
开发者ID:KonajuGames,项目名称:SharpLang,代码行数:70,代码来源:NativeWindow.cs
示例17: DispatchMessage
private static extern IntPtr DispatchMessage( ref Msg msg );
开发者ID:ryan-bunker,项目名称:axiom3d,代码行数:1,代码来源:Win32MessageHandling.cs
示例18: TranslateMessage
private static extern bool TranslateMessage( ref Msg msg );
开发者ID:ryan-bunker,项目名称:axiom3d,代码行数:1,代码来源:Win32MessageHandling.cs
示例19: PostMessage
internal override bool PostMessage (IntPtr hwnd, Msg message, IntPtr wParam, IntPtr lParam) {
MSG msg = new MSG();
msg.hwnd = hwnd;
msg.message = message;
msg.wParam = wParam;
msg.lParam = lParam;
EnqueueMessage (msg);
return true;
}
开发者ID:calumjiao,项目名称:Mono-Class-Libraries,代码行数:9,代码来源:XplatUICarbon.cs
示例20: SendMessage
internal override IntPtr SendMessage (IntPtr hwnd, Msg message, IntPtr wParam, IntPtr lParam)
{
Hwnd h;
h = Hwnd.ObjectFromHandle(hwnd);
if (h != null && h.queue != ThreadQueue (Thread.CurrentThread)) {
AsyncMethodResult result;
AsyncMethodData data;
result = new AsyncMethodResult ();
data = new AsyncMethodData ();
data.Handle = hwnd;
data.Method = new WndProcDelegate (NativeWindow.WndProc);
data.Args = new object[] { hwnd, message, wParam, lParam };
data.Result = result;
SendAsyncMethod (data);
DriverDebug("Sending {0} message across.", message);
return IntPtr.Zero;
}
string key = hwnd + ":" + message;
if (messageHold[key] != null)
messageHold[key] = ((int)messageHold[key]) - 1;
return NativeWindow.WndProc(hwnd, message, wParam, lParam);
}
开发者ID:nlhepler,项目名称:mono,代码行数:27,代码来源:XplatUIX11.cs
注:本文中的System.Windows.Forms.Msg类示例由纯净天空整理自Github/MSDocs等源码及文档管理平台,相关代码片段筛选自各路编程大神贡献的开源项目,源码版权归原作者所有,传播和使用请参考对应项目的License;未经允许,请勿转载。 |
请发表评论