Я создал этот сценарий для проверки концепции на языке ahk, который осуществляет переход к заданной папке с активной вкладки проводника, и хотя программно перейти к папке с заданной вкладки в C++ довольно легко, мне это не удалось еще не получить активную вкладку. Есть ли какая-либо документация по этому поводу в API Windows?
Кстати, вот мой код:
F1:: {
foundTabIndex := GetExplorerTab()
if (IsInteger(foundTabIndex)) {
shell := ComObject("Shell.Application")
win := shell.Windows().Item(foundTabIndex)
win.Navigate("C:\")
}
}
GetExplorerTab() {
activeTab := 0
try activeTab := ControlGetHwnd("ShellTabWindowClass1", "A")
static IID_IShellBrowser := "{000214E2-0000-0000-C000-000000000046}"
; Initialize an index counter
tabIndex := 0
; Variable to store the found tab index
foundTabIndex := false
; Flag to check if any File Explorer windows are open
foundWindow := false
; Iterate through all File Explorer windows
for w in ComObject("Shell.Application").Windows {
foundWindow := true ; Set flag to true since we found at least one window
shellBrowser := ComObjQuery(w, IID_IShellBrowser, IID_IShellBrowser)
ComCall(3, shellBrowser, "uint*", &thisTab := 0)
; Check if the current tab matches activeTab
if (activeTab && thisTab = activeTab) {
; Store the index of the matching tab
foundTabIndex := tabIndex
; Break out of the loop since we found the matching tab
break
}
; Increment the index for the next tab
tabIndex++
}
; Return the foundTabIndex if a matching tab was found, otherwise return false
return foundTabIndex
}```
Подробнее здесь: https://stackoverflow.com/questions/786 ... n-c-winapi
Можно ли получить активное окно/вкладку проводника файлов в C++ winapi? [закрыто] ⇐ C++
Программы на C++. Форум разработчиков
1719952442
Anonymous
Я создал этот сценарий для проверки концепции на языке ahk, который осуществляет переход к заданной папке с активной вкладки проводника, и хотя программно перейти к папке с заданной вкладки в C++ довольно легко, мне это не удалось еще не получить активную вкладку. Есть ли какая-либо документация по этому поводу в API Windows?
Кстати, вот мой код:
F1:: {
foundTabIndex := GetExplorerTab()
if (IsInteger(foundTabIndex)) {
shell := ComObject("Shell.Application")
win := shell.Windows().Item(foundTabIndex)
win.Navigate("C:\")
}
}
GetExplorerTab() {
activeTab := 0
try activeTab := ControlGetHwnd("ShellTabWindowClass1", "A")
static IID_IShellBrowser := "{000214E2-0000-0000-C000-000000000046}"
; Initialize an index counter
tabIndex := 0
; Variable to store the found tab index
foundTabIndex := false
; Flag to check if any File Explorer windows are open
foundWindow := false
; Iterate through all File Explorer windows
for w in ComObject("Shell.Application").Windows {
foundWindow := true ; Set flag to true since we found at least one window
shellBrowser := ComObjQuery(w, IID_IShellBrowser, IID_IShellBrowser)
ComCall(3, shellBrowser, "uint*", &thisTab := 0)
; Check if the current tab matches activeTab
if (activeTab && thisTab = activeTab) {
; Store the index of the matching tab
foundTabIndex := tabIndex
; Break out of the loop since we found the matching tab
break
}
; Increment the index for the next tab
tabIndex++
}
; Return the foundTabIndex if a matching tab was found, otherwise return false
return foundTabIndex
}```
Подробнее здесь: [url]https://stackoverflow.com/questions/78692768/is-it-possible-to-get-the-active-file-explorer-window-tab-in-c-winapi[/url]
Ответить
1 сообщение
• Страница 1 из 1
Перейти
- Кемерово-IT
- ↳ Javascript
- ↳ C#
- ↳ JAVA
- ↳ Elasticsearch aggregation
- ↳ Python
- ↳ Php
- ↳ Android
- ↳ Html
- ↳ Jquery
- ↳ C++
- ↳ IOS
- ↳ CSS
- ↳ Excel
- ↳ Linux
- ↳ Apache
- ↳ MySql
- Детский мир
- Для души
- ↳ Музыкальные инструменты даром
- ↳ Печатная продукция даром
- Внешняя красота и здоровье
- ↳ Одежда и обувь для взрослых даром
- ↳ Товары для здоровья
- ↳ Физкультура и спорт
- Техника - даром!
- ↳ Автомобилистам
- ↳ Компьютерная техника
- ↳ Плиты: газовые и электрические
- ↳ Холодильники
- ↳ Стиральные машины
- ↳ Телевизоры
- ↳ Телефоны, смартфоны, плашеты
- ↳ Швейные машинки
- ↳ Прочая электроника и техника
- ↳ Фототехника
- Ремонт и интерьер
- ↳ Стройматериалы, инструмент
- ↳ Мебель и предметы интерьера даром
- ↳ Cантехника
- Другие темы
- ↳ Разное даром
- ↳ Давай меняться!
- ↳ Отдам\возьму за копеечку
- ↳ Работа и подработка в Кемерове
- ↳ Давай с тобой поговорим...
Мобильная версия