wxg22526451/
共1361个网摘 [
1 2 3 4 5 6 7 8 9 ...
46 ]
上一页 |
下一页 |
访问wxg22526451的个人空间
wxg22526451收录,时间:2008-9-4 17:52:11 | 相关网摘,我也收藏
//注册热键的api
[DllImport("user32")]
public static extern bool RegisterHotKey(IntPtr hWnd, int id, uint control, Keys vk);
//解除注册热键的api
[DllImport("user32")]
public static extern bool UnregisterHotKey(IntPtr hWnd, int id);
private void Form1_Load(object sender, System.EventArgs e)
{
RegisterHotKey(this.Handle, 123, 2, Keys.Q);
RegisterHotKey(this.Handle, 456, 2, Keys.W);
}
private void Form1_FormClosed(object sender, FormClosedEventArgs e)
{
UnregisterHotKey(this.Handle, 123);
UnregisterHotKey(this.Handle, 456);
}
protected override void WndProc(ref Message m)
{
switch (m.Msg)
{
case 0x0312:
if (m.WParam.ToString() == "123") // 按下CTRL Q隐藏
{
%
http://topic.csdn.net/u/20080904/17/90904687-3beb-44c8-a944-aefc38fc735a.html
共1361个网摘 [
1 2 3 4 5 6 7 8 9 ...
46 ]
上一页 |
下一页