C#winform如何将隐藏的主窗体,用windows快捷键显示出来,如QQ按Ctr+Shift+alt即显示出来

来源:百度知道 编辑:UC知道 时间:2024/06/05 08:00:19
如题:感谢!100分赏。

全局钩子
我做的例子
按F10,隐藏,Ctr+Shift+alt 显示
using System;
using System.Collections.Generic;
using System.ComponentModel;
using System.Data;
using System.Drawing;
using System.Linq;
using System.Text;
using System.Windows.Forms;
using System.Drawing.Drawing2D;
using System.Runtime.InteropServices;
using System.Reflection;

namespace WindowsFormsApplication1
{
public partial class Form1 : Form
{
Hook m_hook = new Hook();
public Form1()
{
InitializeComponent();
ActiveHook.SetWindowPos(this.Handle, IntPtr.Zero, 0, 0, 800, 600, ActiveHook.SWP_NOACTIVATE);
m_hook.OnKeyDown += new Hook.KeyboardDelegate(OnHookKeyDown);
}
void OnHookKeyDown(KeyEventArgs e)
{
OnKeyDown(e);
if (e.Handled)
{
return;