private void SearchOnGoogle_ContextItem_Click(object sender, RoutedEventArgs e) { var path = ((ImageInfo)imageGrid.SelectedItems.Last()).ImgPath; var s = System.Diagnostics.Process.Start($"www.images.google.com/"); Thread.Sleep(1000); ExplorerSearchUtil.ShowInFolder(System.Diagnostics.ProcessWindowStyle.Normal, path); /* * System.Diagnostics.Process[] procs = System.Diagnostics.Process.GetProcessesByName("EXPLORER"); * foreach (System.Diagnostics.Process proc in procs) * { * if (proc.StartInfo.Arguments.IndexOf("GTGTGT") > -1) * proc.Kill(); * } * StringBuilder sb = new StringBuilder(); * foreach (Process p in Process.GetProcesses(".")) * { * try * { * if (p.MainWindowTitle.Length > 0) * { * Debug.Write("\r\n"); * Debug.Write("\r\n Window Title:" + p.MainWindowTitle.ToString()); * Debug.Write("\r\n Process Name:" + p.ProcessName.ToString()); * Debug.Write("\r\n Window Handle:" + p.MainWindowHandle.ToString()); * Debug.Write("\r\n Memory Allocation:" + p.PrivateMemorySize64.ToString()); * } * } * catch { } * } * Debug.WriteLine(sb); */ //ExplorerSearchUtil.MoveWindow(p, 0, 0, 300, 300, true); }
private void ShowInFolder_ContextItem_Click(object sender, RoutedEventArgs e) { var selected = imageGrid.SelectedItems.Select(item => { return(((ImageInfo)item).ImgPath); }).ToArray(); if (selected.Length > 1) { ExplorerSearchUtil.ShowInFolder(selected); } else { var imgPath = (e.OriginalSource as MenuItem).Tag.ToString(); ExplorerSearchUtil.ShowInFolder(imgPath); } }