private void ApplicationLauncherForm_Load(object sender, EventArgs e) { if (_windows == null) { _windows = new DesktopWindows(); } _imageList = new IconExtractor.ExecutableImageList(imageListRunningLarge, true); _imageList.NonExistantImage = -1; // Setup ObjectListViewRunning RebuildListRunning(); buttonListControlRunning_SelectPreviousForegroundWindow(); // Setup ObjectListViewShortcuts RebuildListShortcuts(); uint processId = 0; uint idAttach = MS.Win32.GetWindowThreadProcessId(MS.Win32.GetForegroundWindow(), out processId); uint idAttachTo = MS.Win32.GetCurrentThreadId(); MS.Win32.AttachThreadInput(idAttach, idAttachTo, true); MS.Win32.SetForegroundWindow(this.Handle); MS.Win32.SetFocus(this.Handle); MS.Win32.AttachThreadInput(idAttach, idAttachTo, false); }
public EditApplicationsDialog() { string exeFilename = System.Diagnostics.Process.GetCurrentProcess().MainModule.FileName; this.Icon = System.Drawing.Icon.ExtractAssociatedIcon(exeFilename); InitializeComponent(); listViewApplications.AddColumn("Application", 0, "Name"); _imageList = new IconExtractor.ExecutableImageList(imageListApplicationIcons); }
private void ShortcutsForm_Load(object sender, EventArgs e) { _imageList = new IconExtractor.ExecutableImageList(imageListShortcuts, false); _imageList.NonExistantImage = -1; _imageListIcons = new IconExtractor.ExecutableImageList(imageListIcons, true); _imageListIcons.NonExistantImage = -1; olvColumn1.ImageGetter = delegate(object row) { Shortcut shortcut = row as Shortcut; if (shortcut.Icon.Length > 0) { return(_imageList.GetExecutableIndex(shortcut.Icon)); } else { return(_imageList.GetExecutableIndex(shortcut.Executable)); } }; objectListViewShortcuts.SetObjects(Settings.Current.Shortcuts); //Rebind(); }