本文整理汇总了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;
}
示例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;
}
}
示例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;
}
}
示例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;
}
}
示例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);
}
示例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:
//.........这里部分代码省略.........
示例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)
{
//.........这里部分代码省略.........