我被困.
现在,我使用以下代码来收听热键:
[DllImport("user32.dll")]
public static extern bool RegisterHotKey(IntPtr hWnd,
int id, int fsModifiers, int vlc);
[DllImport("user32.dll")]
public static extern bool UnregisterHotKey(IntPtr hWnd, int id);
protected override void WndProc(ref Message m)
{
if (m.Msg == 0x0312)
{
// whatever i need
}
base.WndProc(ref m);
}
Run Code Online (Sandbox Code Playgroud)
和这个注册热键的功能:
Form1.RegisterHotKey(this.Handle, this.GetType().GetHashCode(), 0, (int)chr);
Run Code Online (Sandbox Code Playgroud)
它完美地运作.我的问题是如何将多个热键注册为相同的组合,例如:
编辑:我发现(如Zooba所说)如何"解密"发送了哪个热键,这是解决方案:
protected override void WndProc(ref Message m)
{
if (m.Msg == …Run Code Online (Sandbox Code Playgroud) 我试图得到当前托盘图标的hwnd.我做的是使用以下代码获取系统trat窗口的hWnd:
[DllImport("user32.dll", SetLastError = true)]
static extern IntPtr FindWindowEx(IntPtr hWndParent, IntPtr hWndChildAfter, string lpClassName, string lpWindowName);
[DllImport("user32.dll", SetLastError = true)]
static extern IntPtr FindWindow(string lpClassName, string lpWindowName);
static IntPtr GetSystemTrayHandle()
{
IntPtr hWndTray = FindWindow("Shell_TrayWnd", null);
if (hWndTray != IntPtr.Zero)
{
hWndTray = FindWindowEx(hWndTray, IntPtr.Zero, "TrayNotifyWnd", null);
if (hWndTray != IntPtr.Zero)
{
hWndTray = FindWindowEx(hWndTray, IntPtr.Zero, "SysPager", null);
if (hWndTray != IntPtr.Zero)
{
hWndTray = FindWindowEx(hWndTray, IntPtr.Zero, "ToolbarWindow32", null);
return hWndTray;
}
}
}
return IntPtr.Zero;
}
Run Code Online (Sandbox Code Playgroud)
我从这里拿到了:找到系统托盘中列出的应用程序和服务?
然后我使用以下代码填充了该hWnd的子窗口: …
我想让我的网站跨浏览器,但有一个问题.
Safari的放大/缩小功能破坏了我的网站布局 - 它不会很好地改变字体大小(或者至少像IE,Firefox和Chrome那样).
我该如何解决?
我有2个元素 - 窗口和按钮.
我想绑定Window的BorderBrush价值的Button的isPressed Background价值.
两个元素都有自定义样式.这里是样式:
按钮样式:
<Style x:Key="TitleBarButton" TargetType="Button">
<Setter Property="Foreground" Value="Black"/>
<Setter Property="Background" Value="Transparent"/>
<Setter Property="BorderThickness" Value="0"/>
<Setter Property="Padding" Value="12,8.5"/>
<Setter Property="FocusVisualStyle" Value="{x:Null}"/>
<Setter Property="FontFamily" Value="Marlett"/>
<Setter Property="FontSize" Value="12"/>
<Setter Property="SnapsToDevicePixels" Value="true"/>
<Setter Property="IsTabStop" Value="False"/>
<Setter Property="Template">
<Setter.Value>
<ControlTemplate TargetType="Button">
<Border BorderThickness="{TemplateBinding BorderThickness}" BorderBrush="{TemplateBinding BorderBrush}" Background="{TemplateBinding Background}" Padding="{TemplateBinding Padding}">
<Grid>
<ContentPresenter HorizontalAlignment="Center" VerticalAlignment="Center" TextBlock.FontFamily="{TemplateBinding FontFamily}" TextBlock.FontSize="{TemplateBinding FontSize}" />
</Grid>
</Border>
<ControlTemplate.Triggers>
<Trigger Property="IsMouseOver" Value="True">
<Setter Property="Background" Value="#EFEFF2" />
</Trigger>
<Trigger …Run Code Online (Sandbox Code Playgroud) 我有一个带渐变的箭头:
var g = field.gradient("l(0, 1, 2, 1)#fff-#5C5C5C");
var arrow = field.path(Snap.format("M390 385 L335 335 L410 355 Q375 355 390 385")).attr({fill: g, opacity: 0.5, cursor: 'pointer'});
Run Code Online (Sandbox Code Playgroud)
我想要产生一种效果,即渐变正在像波浪一样改变/移动.
这是我想要的flash页面:http://www.888poker.com/poker-client/euromania_popup.htm?isftd = 1&origcid = 123456
我在我的网站上使用ajax并且为了使用ajax,我可以写例如文件的名称:
id = "123";
$.getJSON(jquerygetevent.php?id=" + id, function(json)
{
//do something
});
Run Code Online (Sandbox Code Playgroud)
我怎样才能保护网址?我不希望别人看到它并使用它......
我想从保存URL的变量中获取参数.
我得到了以下变量:$lastPage它保存了上一页的URI.
我想从中获取一个参数.
我在javascript中获得了以下脚本(我用于其他东西)
function getUrlVar(key)
{
var result = new RegExp(key + '=([^&]*)', 'i').exec(window.location.search);
return result && unescape(result[1]) || '';
}
Run Code Online (Sandbox Code Playgroud)
我希望这样的东西,但对于PHP.
非常感谢你
javascript ×3
c# ×2
.net ×1
animation ×1
binding ×1
client-side ×1
enumerate ×1
fonts ×1
hotkeys ×1
html ×1
obfuscation ×1
php ×1
safari ×1
snap.svg ×1
system-tray ×1
url ×1
winforms ×1
wpf ×1
wpf-controls ×1
zoom ×1