本文整理汇总了C#中Parameters.PopStructure方法的典型用法代码示例。如果您正苦于以下问题:C# Parameters.PopStructure方法的具体用法?C# Parameters.PopStructure怎么用?C# Parameters.PopStructure使用的例子?那么, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类Parameters
的用法示例。
在下文中一共展示了Parameters.PopStructure方法的1个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的C#代码示例。
示例1: HwndSourceHook
private static IntPtr HwndSourceHook(IntPtr hwnd, int msg, IntPtr wParam, IntPtr lParam, ref bool handled)
{
if (msg == NativeMethods.WM_COPYDATA)
{
var paramaters = new Parameters(lParam);
if (paramaters.IsReady)
{
var function = (Function)paramaters.PopInt();
switch (function)
{
case Function.GetTitle:
case Function.GetIcon:
case Function.GetSettingsPath:
LastStringResult = paramaters.PopString();
break;
case Function.GetIconRect:
var rect = (Rect)paramaters.PopStructure(typeof(Rect));
LastRectangleResult = new Rectangle(rect.left, rect.top, rect.width, rect.height);
break;
case Function.GetConfig:
keepInDock = paramaters.PopInt() != 0;
activatable = paramaters.PopInt() != 0;
exposable = paramaters.PopInt() != 0;
bounceable = paramaters.PopInt() != 0;
break;
case Function.GetEvent:
switch ((Event)paramaters.PopInt())
{
case Event.LButtonClick:
OnEventLButtonClick();
break;
case Event.MenuSelect:
int nId = paramaters.PopInt();
OnEventMenuSelect(nId);
break;
}
break;
case Function.GetMenu:
OnEventGetMenu();
break;
}
handled = true;
return (IntPtr)1;
}
}
if (msg == Parameters.Identificator)
{
if (wParam == (IntPtr)1)
{
Id = IntPtr.Zero;
Register(iconName, title, bounceable);
SetConfig();
Indicator = indicator;
handled = true;
return (IntPtr)1;
}
}
handled = false;
return IntPtr.Zero;
}