public MainWindow() { InitializeComponent(); hookDelegate = new deleHooky(HookDelegate); hookHandle=SetWindowsHookEx(WH_KEYBOARD_LL,hookDelegate,LoadLibrary("User32"),0); NotificationIcon = new System.Windows.Forms.NotifyIcon(); NotificationIcon.Icon = new System.Drawing.Icon("gg.ico"); NotificationIcon.Visible = true; NotificationIcon.Text = "GG is running. Press hotkey or click here to begin."; NotificationIcon.Click += new EventHandler(delegate(object o, EventArgs e) { ShowHide(); if (OptionsShowing) ShowHideOptions(); }); /* ni.BalloonTipClicked += new EventHandler(delegate(object o, EventArgs e) { showhide(); if (showopt) showhideopt(); }); */ // createshortcut(); }
static extern IntPtr SetWindowsHookEx(int idHook, deleHooky callback, IntPtr hInstance, uint theardID);