日本免费全黄少妇一区二区三区-高清无码一区二区三区四区-欧美中文字幕日韩在线观看-国产福利诱惑在线网站-国产中文字幕一区在线-亚洲欧美精品日韩一区-久久国产精品国产精品国产-国产精久久久久久一区二区三区-欧美亚洲国产精品久久久久

Progress Bar Windows 7 任務欄開發(fā)之進度條( 二 )


int _maxTimes = 0; 
Window _window; 
 
public void Flash(int times, double millliseconds, Window window) 
{ 
_timer = new DispatcherTimer(); 
_maxTimes = times; 
_timer.Interval = TimeSpan.FromMilliseconds(millliseconds); 
_timer.Tick= OnTick; 
_window = window; 
_timer.Start(); 
} 
 
void OnTick(object sender, EventArgs e) 
{ 
if (_count < _maxTimes) 
{ 
Win32.FlashWindow(new WindowInteropHelper(_window).Handle, (_count % 2) == 0); 
} 
else 
{ 
_timer.Stop(); 
} 
} 
} 
 
internal static class Win32 
{ 
[DllImport("user32.dll")] 
public static extern bool FlashWindow(IntPtr hwnd, bool bInvert); 
}
通過FlashWindowHelper 類可以輕松的使任務欄圖標閃動起來:
private void flashTaskbar_Click(object sender, RoutedEventArgs e) 
{ 
FlashWindowHelper helper = new FlashWindowHelper(); 
helper.Flash(8, 400, Application.Current.MainWindow); 
}
閃動效果
出處: http://www.cnblogs.com/gnielee/

推薦閱讀