本文整理汇总了C#中Window.getTitle方法的典型用法代码示例。如果您正苦于以下问题:C# Window.getTitle方法的具体用法?C# Window.getTitle怎么用?C# Window.getTitle使用的例子?那么恭喜您, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类Window
的用法示例。
在下文中一共展示了Window.getTitle方法的2个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的C#代码示例。
示例1: EnumWindowsProc
private bool EnumWindowsProc(IntPtr hWnd, int lParam)
{
if (IsWindowVisible(hWnd)) {
Window window = new Window(hWnd);
if (!settings.isWindowTitleExcluded(window.getTitle()) && !window.hasNoTitle())
{
if ((showTabs || settings.isListTabsAsWindows()) && window.getProcessName() == "firefox")
{
windows.AddRange(getFirefoxTabs(window));
}
else if ((showTabs || settings.isListTabsAsWindows()) && window.getProcessName() == "iexplore")
{
windows.AddRange(getIETabs(window));
}
else
{
windows.Add(window);
}
}
}
return true;
}
示例2: getFirefoxTabs
private List<Window> getFirefoxTabs(Window firefoxWindow)
{
List<Window> tabs = new List<Window>();
string path = Directory.GetParent(Environment.GetFolderPath(Environment.SpecialFolder.ApplicationData)).FullName;
if (Environment.OSVersion.Version.Major >= 6) path = Directory.GetParent(path).ToString();
path += "/AppData/Roaming/Mozilla/Firefox/Profiles";
path = Directory.GetDirectories(path)[0];
path += "/sessionstore-backups/";
String recovery = path + "/recovery.js";
String recoveryTmp = path + "/recovery.js.tmp";
String file = File.Exists(recoveryTmp) ? recoveryTmp : recovery;
StreamReader streamReader = new StreamReader(file);
String content = streamReader.ReadToEnd();
JObject data = JObject.Parse(content);
int currentTabIndex = 0, i = 0;
foreach (JObject tab in data["windows"][0]["tabs"])
{
String title = (String) tab["entries"].Last["title"];
title += " - Mozilla Firefox";
currentTabIndex = title == firefoxWindow.getTitle() ? i : currentTabIndex;
tabs.Add(new FirefoxTabWindow(firefoxWindow.getHandle(), currentTabIndex, i++, title));
}
foreach(FirefoxTabWindow w in tabs) {
w.currentTabIndex = currentTabIndex;
}
return tabs;
}