当前位置: 首页>>代码示例>>C#>>正文


C# Message.GetLParam方法代码示例

本文整理汇总了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);
        }
开发者ID:29988122,项目名称:KeyKey,代码行数:32,代码来源:BIStatusBarForm.Paint.cs

示例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);
        }
开发者ID:Gunzmo,项目名称:Diablo2NG,代码行数:25,代码来源:Form1.cs

示例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);
        }
开发者ID:340211173,项目名称:hf-2011,代码行数:28,代码来源:ServerForm.cs

示例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;
 }
开发者ID:johnturek,项目名称:SipCommunicator,代码行数:9,代码来源:InterProcessCommunication.cs

示例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;
            }
        }
开发者ID:dropbox,项目名称:DropboxBusinessAdminTool,代码行数:18,代码来源:TextBoxEx.cs

示例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);
        }
开发者ID:tosie,项目名称:Common.Data,代码行数:15,代码来源:FasterListView.cs

示例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);
         }
 }
开发者ID:d75south,项目名称:CapstoneSolution,代码行数:13,代码来源:MixedCheckBoxesTreeview.cs

示例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);
        }
开发者ID:Elof3,项目名称:Treefrog,代码行数:13,代码来源:TabControlEx.cs

示例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);
 }
开发者ID:shadabahmed,项目名称:quizroom_hacker,代码行数:13,代码来源:NativeWindowEx.cs

示例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);
        }
开发者ID:kevinegstorf,项目名称:Forex-Strategy-Builder,代码行数:14,代码来源:LauncherForm.cs

示例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;
     }
 }
开发者ID:yp124202453,项目名称:ApolloCodes,代码行数:14,代码来源:Form1.cs

示例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);
 }
开发者ID:EFanZh,项目名称:EFanZh,代码行数:23,代码来源:MainForm.cs

示例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);
        }
开发者ID:majkinetor,项目名称:FormsFramework,代码行数:15,代码来源:IPC.cs

示例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);
            }
        }
开发者ID:xmuhcd,项目名称:Image-Cropper-For-Computer-Vision,代码行数:15,代码来源:TabPadding.cs

示例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;
            }
        }
开发者ID:zhushengwen,项目名称:example-zhushengwen,代码行数:18,代码来源:FrmChat.cs


注:本文中的System.Windows.Forms.Message.GetLParam方法示例由纯净天空整理自Github/MSDocs等开源代码及文档管理平台,相关代码片段筛选自各路编程大神贡献的开源项目,源码版权归原作者所有,传播和使用请参考对应项目的License;未经允许,请勿转载。