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


C# COPYDATASTRUCT.GetType方法代码示例

本文整理汇总了C#中COPYDATASTRUCT.GetType方法的典型用法代码示例。如果您正苦于以下问题:C# COPYDATASTRUCT.GetType方法的具体用法?C# COPYDATASTRUCT.GetType怎么用?C# COPYDATASTRUCT.GetType使用的例子?那么恭喜您, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在COPYDATASTRUCT的用法示例。


在下文中一共展示了COPYDATASTRUCT.GetType方法的7个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的C#代码示例。

示例1: 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

示例2: DefWndProc

        protected override void DefWndProc(ref System.Windows.Forms.Message m)
        {
            string token = "";
            COPYDATASTRUCT mystr;
            Type mytype = null;
            //MessageBox.Show(m.Msg.ToString());
            switch (m.Msg)
            {
                case WM_MESSAGE:
                    mystr = new COPYDATASTRUCT();
                    mytype = mystr.GetType();
                    mystr = (COPYDATASTRUCT)m.GetLParam(mytype);
                    token = mystr.bstrData;

                    eterm_bga.is_eterm_status = mystr.bstrData;
                    eterm_bga.ib_connect_status = false;
                    eterm_bga.ib_dataflag = false;
                    //    MessageBox.Show(this, mystr.bstrData, mystr.bstrCategory);
                    break;

                case WM_DATA:
                    mystr = new COPYDATASTRUCT();
                    mytype = mystr.GetType();
                    mystr = (COPYDATASTRUCT)m.GetLParam(mytype);
                    token = mystr.bstrData;

                    ShowData(token);
                    break;
                case WM_CTX:
                    mystr = new COPYDATASTRUCT();
                    mytype = mystr.GetType();
                    mystr = (COPYDATASTRUCT)m.GetLParam(mytype);
                    token = mystr.bstrToken;
                    CreatingCtx((int)m.WParam, token);
                    break;
                default:
                    base.DefWndProc(ref m);
                    if (eterm_bga.ib_connect_status)
                    {
                        eterm_bga.is_eterm_status = "Host system down";
                        eterm_bga.ib_connect_status = false;
                        eterm_bga.ib_dataflag = false;
                    }

                    break;
            }
        }
开发者ID:greatfly,项目名称:Eterm_CS,代码行数:47,代码来源:eterm_base.cs

示例3: 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

示例4: DefWndProc

 protected override void DefWndProc( ref System.Windows.Forms.Message m )
 {
     switch ( m.Msg )
     {
         case Win32API.WM_COPYDATA:
             COPYDATASTRUCT mystr = new COPYDATASTRUCT();
             Type mytype = mystr.GetType();
             mystr = (COPYDATASTRUCT)m.GetLParam( mytype );
             String op = mystr.lpData;
             switch ( op )
             {
                 case SecuruStikMessageType.Show:
                     this.Visible = true;break;
                 case SecuruStikMessageType.Hiden:
                     this.Visible = false;break;
             }
             break;
         default:
             base.DefWndProc( ref m );
             break;
     }
 }
开发者ID:lixiaoyi1108,项目名称:SecuruStik,代码行数:22,代码来源:SplashScreen.cs

示例5: WndProc

        protected override void WndProc(ref Message m)
        {
            // Listen for operating system messages.
              switch (m.Msg)
              {
            case WM_USER:
              //MessageBox.Show("Message recieved: " + m.WParam + " – " + m.LParam);
              break;
            case WM_COPYDATA:
              COPYDATASTRUCT mystr = new COPYDATASTRUCT();
              Type mytype = mystr.GetType();
              mystr = (COPYDATASTRUCT)m.GetLParam(mytype);
              if (mystr.lpData.Equals("exit;"))
              {
                sendmsgclose = true;
                Application.Exit();
              }
              // MessageBox.Show(mystr.lpData);
              Splashtext.Text = mystr.lpData;
              Splashtext.Left = (this.Width / 2) - (Splashtext.Width / 2);
              Splashtext.Top = (this.Height / 2) - (Splashtext.Height / 2);

              break;
              }
              base.WndProc(ref m);
        }
开发者ID:disaster123,项目名称:Splashy,代码行数:26,代码来源:Form1.cs

示例6: DefWndProc

        protected override void DefWndProc(ref System.Windows.Forms.Message m)
        {
            switch (m.Msg)
            {
                case WM_COPYDATA:
                    COPYDATASTRUCT mystr = new COPYDATASTRUCT();
                    Type mytype = mystr.GetType();
                    mystr = (COPYDATASTRUCT)m.GetLParam(mytype);

                    //MessageBox.Show(mystr.lpData);
                    Jid openJid = new Jid(mystr.lpData, XmppCon.Server,null);
                    //MessageBox.Show(openJid.ToString());

                    Friend item=null;
                    if (listView_fd.Rosters.ContainsKey(openJid.Bare))
                    {
                        item = listView_fd.Rosters[openJid.Bare];
                        if (!Util.ChatForms.ContainsKey(item.Ritem.Jid.Bare))
                        {
                            try
                            {
                                string nickName = listView_fd.GetFriendNickName(openJid.Bare);
                                ChatFromMsg chat = new ChatFromMsg(openJid, XmppCon, nickName);
                                chat.UpdateFriendOnline(item.IsOnline);//设置好友在线状态
                                chat.Show();
                            }
                            catch (Exception ex)
                            {
                                MessageBox.Show(ex.Message);
                            }
                        }
                        else
                        {
                            try
                            {
                                ChatFromMsg chatform = Util.ChatForms[item.Ritem.Jid.Bare] as ChatFromMsg;
                                chatform.WindowState = FormWindowState.Normal;
                                chatform.Activate();
                            }
                            catch (Exception ex)
                            {
                                MessageBox.Show(ex.Message);
                            }
                        }
                    }
                    else
                    {
                        if (!Util.ChatForms.ContainsKey(openJid.Bare))
                        {
                            listView_fd.UpdateFriendFlicker(openJid.Bare);
                            string nickName = listView_fd.GetFriendNickName(openJid.Bare);
                            ChatFromMsg chat = new ChatFromMsg(openJid, XmppCon, nickName);

                            Friend friend;
                            if (listView_fd.Rosters.ContainsKey(openJid.Bare))
                            {
                                friend = listView_fd.Rosters[openJid.Bare];
                            }
                            else
                            {
                                friend = null;
                            }

                            if (friend != null)
                            {
                                chat.UpdateFriendOnline(listView_fd.Rosters[openJid.Bare].IsOnline);
                            }

                            if (msgBox.ContainsKey(openJid.Bare.ToString()))
                            {
                                chat.FristMessage(msgBox[openJid.Bare.ToString()]);
                                msgBox.Remove(openJid.Bare.ToString());
                            }
                            try
                            {
                                chat.Show();
                            }
                            catch (Exception)
                            {

                            }

                        }
                        else
                        {
                            try
                            {
                                ChatFromMsg chatform = Util.ChatForms[openJid.Bare.ToString()] as ChatFromMsg;
                                chatform.WindowState = FormWindowState.Normal;
                                chatform.Activate();
                            }
                            catch (Exception ex)
                            {
                                MessageBox.Show("打开窗体错误:"+ex.Message);
                            }
                        }
                    }

                    break;
                default:
//.........这里部分代码省略.........
开发者ID:songques,项目名称:CSSIM_Solution,代码行数:101,代码来源:MainForm.cs

示例7: WndProc

        protected override void WndProc(ref Message m)
        {
            if (m.Msg == 0x004A)
            {
                try
                {
                    COPYDATASTRUCT cds = new COPYDATASTRUCT();
                    Type cdsType = cds.GetType();
                    cds = (COPYDATASTRUCT)m.GetLParam(cdsType);
                    uint flag = (uint)cds.dwData;
                    byte[] data = new byte[cds.cbData];
                    Marshal.Copy(cds.lpData, data, 0, cds.cbData);

                    if (flag == 1)
                    {
                        UpdateMessage(Encoding.Unicode.GetString(data));
                    }
                    else if (flag == 2)
                    {
                        int size = Marshal.SizeOf(typeof(ROOM));
                        IntPtr ptr = Marshal.AllocHGlobal(size);
                        Marshal.Copy(data, 0, ptr, size);
                        ROOM room = (ROOM)Marshal.PtrToStructure(ptr, typeof(ROOM));
                        Marshal.FreeHGlobal(ptr);

                        UpdatePlayerList(room);

                        this.panelInRoom.Visible = true;
                        this.panelOutRoom.Visible = false;
                    }
                    else if (flag == 3)
                    {
                        int size = Marshal.SizeOf(typeof(ADVLIST));
                        IntPtr ptr = Marshal.AllocHGlobal(size);
                        Marshal.Copy(data, 0, ptr, size);
                        ADVLIST advList = (ADVLIST)Marshal.PtrToStructure(ptr, typeof(ADVLIST));
                        Marshal.FreeHGlobal(ptr);

                        UpdateAdvList(advList);

                        this.panelInRoom.Visible = false;
                        this.panelOutRoom.Visible = true;

                        if (this.checkBoxAutoJoin.Checked)
                        {
                            for (int i = 0; i < advList.count; ++i)
                            {
                                if (advList.adv[i].title.IndexOf(this.textBoxTitleContain.Text, StringComparison.OrdinalIgnoreCase) >= 0 &&
                                    advList.adv[i].map.IndexOf(this.textBoxMapContain.Text, StringComparison.OrdinalIgnoreCase) >= 0)
                                {
                                    JoinGame(advList.adv[i].title);
                                }
                            }
                        }
                    }
                    else if (flag == 4)
                    {
                        //W3_NOTHING 0
                        //W3_LOBBY 1
                        //W3_FAKE 2 // i don't know what is this...
                        //W3_LOADING 3
                        //W3_INGAME 4
                        //W3_PAUSEDGAME 6
                        int backupGameState = GameState;
                        GameState = BitConverter.ToInt32(data, 0);
                        if (backupGameState == 1 && GameState == 0) // 从房间中退出
                        {
                            UpdateMessage("[已离开房间]");
                            ActiveWC3();
                        }
                        else if (GameState == 1) // 进入房间
                        {
                            this.listBoxMessage.Items.Clear();
                            this.panelInRoom.Visible = true;
                            this.panelOutRoom.Visible = false;
                            this.checkBoxAutoJoin.Checked = false;
                            this.checkBoxAutoTry.Checked = false;
                            ActiveWC3();

                        }
                        else if (GameState == 3) // 开始载入
                        {
                            UpdateMessage("[已开始载入]");
                        }
                        else if (GameState == 4) // 开始游戏
                        {
                            UpdateMessage("[已开始游戏]");
                            ActiveWC3();
                        }
                    }
                }
                catch (Exception e)
                {
                    //MessageBox.Show(e.ToString());
                }
            }
            else if (m.Msg == 0x0112)
            {
                if (m.WParam.ToInt32() == 0x123)
                {
//.........这里部分代码省略.........
开发者ID:Nxun,项目名称:War3-BN-Helper,代码行数:101,代码来源:Form1.cs


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