本文整理汇总了C#中System.Windows.Forms.Message.GetLParam方法的典型用法代码示例。如果您正苦于以下问题:C# Message.GetLParam方法的具体用法?C# Message.GetLParam怎么用?C# Message.GetLParam使用的例子?那么恭喜您, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类System.Windows.Forms.Message
的用法示例。
在下文中一共展示了Message.GetLParam方法的15个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的C#代码示例。
示例1: WndProc
protected override void WndProc(ref Message m)
{
switch (m.Msg)
{
case Win32FunctionHelper.MouseMove.WM_MOVING:
case Win32FunctionHelper.MouseMove.WM_SIZING:
{
if (this.Visible)
{
RECT prc = (RECT)m.GetLParam(typeof(RECT));
if (this.m_isMiniMode == true && this.m_isUsingSystemTrayMode == false)
{
Screen currentScreen = Screen.FromPoint(this.Location);
int currentLeft = currentScreen.WorkingArea.Right - 64;
Win32FunctionHelper.SetWindowPos(m.HWnd, (IntPtr)Win32FunctionHelper.CmdShow.HWND_TOP,
currentLeft, prc.Top, 64, prc.Bottom - prc.Top, 0);
}
else
{
Win32FunctionHelper.SetWindowPos(m.HWnd, (IntPtr)Win32FunctionHelper.CmdShow.HWND_TOP,
prc.Left, prc.Top, prc.Right - prc.Left, prc.Bottom - prc.Top, 0);
}
}
}
break;
default:
break;
}
base.WndProc(ref m);
}
示例2: WndProc
protected override void WndProc(ref Message m)
{
if (m.Msg == 74)
{
Type type = new MessageHelper.COPYDATASTRUCT().GetType();
MessageHelper.COPYDATASTRUCT copydatastruct = (MessageHelper.COPYDATASTRUCT)m.GetLParam(type);
try
{
IntPtr num = new IntPtr(m.WParam.ToInt32());
string str = string.Copy(copydatastruct.lpData);
foreach (D2Profile pro in HandlerClass.Instance.bpro)
{
if (pro.D2Process.MainWindowHandle == pro.D2Process.MainWindowHandle)//Cheking For the real Window so its not wrong one! This fix will allow more clients!
HandlerClass.Instance.HandleMessage(num, str);
}
}
catch
{
}
m.Result = (IntPtr)1;
}
base.WndProc(ref m);
}
示例3: WndProc
protected override void WndProc(ref Message m)
{
switch (m.Msg)
{
case WindowNative.WM_COPYDATA:
// Get the COPYDATASTRUCT struct from LParam
COPYDATASTRUCT cds = (COPYDATASTRUCT)m.GetLParam(
typeof(COPYDATASTRUCT));
if (cds.cbData == Marshal.SizeOf(typeof(MyStruct)))
{
// Marshal the data from the unmanaged memory block
object data = Marshal.PtrToStructure(cds.lpData,
typeof(MyStruct));
// Cast the data to MyStruct
MyStruct myStruct = (MyStruct)data;
// Display the MyStruct data
this.lbNumber.Text = myStruct.nNumber.ToString();
this.lbMessage.Text = myStruct.strMessage;
}
break;
}
base.WndProc(ref m);
}
示例4: ReciveMessage
public static string ReciveMessage(ref Message m)
{
COPYDATASTRUCT mystr = new COPYDATASTRUCT();
Type mytype = mystr.GetType();
mystr = (COPYDATASTRUCT)m.GetLParam(mytype);
string data = mystr.lpData;
Debug.WriteLine("WM_COPYDATA message:" + data);
return data;
}
示例5: WndProc
protected override void WndProc(ref Message m) {
switch (m.Msg) {
case 0x302:
if (OnTextPasted != null) {
string text = (string)m.GetLParam(m.GetType());
base.WndProc(ref m);
OnTextPasted.Invoke(this, new EventArgs());
} else {
string text = (string)m.GetLParam(m.GetType());
base.WndProc(ref m);
}
break;
default:
base.WndProc(ref m);
break;
}
}
示例6: WndProc
/// <summary>
/// Overwritten window handler, that intercepts the NM_CUSTOMDRAW message and ignores it.
/// </summary>
/// <param name="m"></param>
protected override void WndProc(ref Message m) {
if (m.Msg == 0x204E) {
NMHDR hdr = (NMHDR)m.GetLParam(typeof(NMHDR));
if (hdr.code == NM_CUSTOMDRAW) {
m.Result = (IntPtr)0;
return;
}
}
base.WndProc(ref m);
}
示例7: WndProc
protected override void WndProc(ref Message m)
{
base.WndProc(ref m);
// trap TVM_SETITEM message
if (m.Msg == TVM_SETITEM || m.Msg == TVM_SETITEMA || m.Msg == TVM_SETITEMW)
// check if CheckBoxes are turned on
if (CheckBoxes)
{
// get information about the node
TV_ITEM tv_item = (TV_ITEM)m.GetLParam(typeof(TV_ITEM));
HideCheckBox(tv_item);
}
}
示例8: WndProc
protected override void WndProc(ref Message m)
{
if (m.Msg == TCM_ADJUSTRECT) {
RECT rc = (RECT)m.GetLParam(typeof(RECT));
rc.Left -= 3;
rc.Right += 0;
rc.Top -= 1;
rc.Bottom += 2;
Marshal.StructureToPtr(rc, m.LParam, true);
}
base.WndProc(ref m);
}
示例9: WndProc
protected override void WndProc(ref Message m)
{
if(m.Msg==QuizRoom.WM_COPYDATA)
{
if(isRunning)
{
QuizRoom.COPYDATASTRUCT dataStruct=(QuizRoom.COPYDATASTRUCT)m.GetLParam(typeof(QuizRoom.COPYDATASTRUCT));
ThreadPool.QueueUserWorkItem(callbackThread,dataStruct.lpData);
}
return;
}
base.WndProc (ref m);
}
示例10: WndProc
protected override void WndProc(ref Message message)
{
if (message.Msg == WmCopydata)
{
var dataStruct = (CopyDataStruct)message.GetLParam(typeof(CopyDataStruct));
presenter.ManageIncomingMassage(dataStruct.LpData);
}
else if (message.WParam.ToInt64() == ScClose)
{
closeRequested = true;
}
base.WndProc(ref message);
}
示例11: WndProc
protected override void WndProc(ref Message m)
{
switch (m.Msg)
{
case Win32Api.WM_COPYDATA:
Type tp = typeof(MyModel);
MyModel model = (MyModel)m.GetLParam(tp);
textBox1.Text = model.LpData;
break;
default:
base.WndProc(ref m);
break;
}
}
示例12: WndProc
protected override void WndProc(ref Message m)
{
switch (m.Msg)
{
case NativeMethods.WM_NOTIFY:
var nmhdr = (NativeMethods.NMHDR)m.GetLParam(typeof(NativeMethods.NMHDR));
switch (nmhdr.code)
{
case NativeMethods.LVN_GETEMPTYMARKUP:
if (Control.FromHandle(nmhdr.hwndFrom) == listViewFileList)
{
var markup = (NativeMethods.NMLVEMPTYMARKUP)m.GetLParam(typeof(NativeMethods.NMLVEMPTYMARKUP));
markup.szMarkup = "要添加文件,请单击“导入”按钮;或将文件拖曳到此处;或双击空白处。";
Marshal.StructureToPtr(markup, m.LParam, false);
m.Result = new IntPtr(1);
return;
}
break;
}
break;
}
base.WndProc(ref m);
}
示例13: WndProc
protected override void WndProc(ref Message m)
{
if((m.Msg==WM_COPYDATA) && (m.WParam == id))
{
CD = (COPYDATASTRUCT)m.GetLParam(typeof(COPYDATASTRUCT));
strData = Marshal.PtrToStringAnsi(new IntPtr(CD.lpData), CD.cbData);
if (OnMessage != null)
OnMessage( strData, CD.dwData );
return;
}
base.WndProc(ref m);
}
示例14: WndProc
protected override void WndProc(ref Message m)
{
base.WndProc(ref m);
if (m.Msg == TCM_ADJUSTRECT)
{
Rectangle rect = (Rectangle)m.GetLParam(typeof(Rectangle));
string text = rect.ToString();
rect.X -= 4;
rect.Y += -1;
rect.Width += 4;
rect.Height += 2;
Marshal.StructureToPtr(rect, m.LParam, true);
}
}
示例15: DefWndProc
//接收传递的消息
protected override void DefWndProc(ref Message m)
{
switch (m.Msg)
{
case WM_COPYDATA:
COPYDATASTRUCT mystr = new COPYDATASTRUCT();
Type mytype = mystr.GetType();
mystr = (COPYDATASTRUCT)m.GetLParam(mytype);
receiveMsg = mystr.lpData;
displayMessage(receiveMsg);
break;
default:
base.DefWndProc(ref m);
break;
}
}