protected override void WndProc(ref Message m) { base.WndProc(ref m); if (m.Msg == 0x0312) { int id = m.WParam.ToInt32(); if (id == 1999) { if (isChange) { Wallpaper.ChangerWallpaper(macdinh); isChange = false; } else { Wallpaper.ChangerWallpaper(chuyen); isChange = true; } } else if (id == 2000) { Wallpaper.ShowWindow(this.Handle, 0); } else if (id == 2001) { Wallpaper.ShowWindow(this.Handle, 1); } } }
public Form1() { InitializeComponent(); Wallpaper.RegisterHotKey(this.Handle, 1999, (int)KeyFirst.Shift, Keys.F3.GetHashCode()); Wallpaper.RegisterHotKey(this.Handle, 2000, (int)KeyFirst.Shift, Keys.F9.GetHashCode()); Wallpaper.RegisterHotKey(this.Handle, 2001, (int)KeyFirst.Shift, Keys.F10.GetHashCode()); }
private void Form1_FormClosing(object sender, FormClosingEventArgs e) { Wallpaper.UnregisterHotKey(this.Handle, 1999); }