Code: Select all
#IfWinActive Games (D:)
$LButton::
OutputDebug 1
IF (A_TickCount > ABlock)
{
SendInput, {LButton Down}
OutputDebug 2
ABlock := A_TickCount + 1600 ;1600ms
KeyWait, LButton
SendInput, {LButton Up}
OutputDebug 3
}
Code: Select all
#IfWinActive Games (D:)
$LButton::
OutputDebug 1
IF (A_TickCount > ABlock)
{
SendInput, {LButton Down}
OutputDebug 2
ABlock := A_TickCount + 1600 ;1600ms
KeyWait, LButton
SendInput, {LButton Up}
OutputDebug 3
}
Code: Select all
#Requires AutoHotkey v1.1.33
winTitle := "ahk_exe notepad.exe"
#If mouseOver(winTitle)
LButton::MsgBox Test
#If
mouseOver(winTitle) {
MouseGetPos,,, hWnd
Return WinExist(winTitle " ahk_id" hWnd)
}
I don't know what to do with that.I want to make it work with "IfWinActive Games (D:)" or "#IfWinActive ahk_class CabinetWClass" .mikeyww wrote: ↑01 Jun 2023, 05:47Welcome to this AutoHotkey forum!
You can check for a mouseover.
Code: Select all
#Requires AutoHotkey v1.1.33 winTitle := "ahk_exe notepad.exe" #If mouseOver(winTitle) LButton::MsgBox Test #If mouseOver(winTitle) { MouseGetPos,,, hWnd Return WinExist(winTitle " ahk_id" hWnd) }
Code: Select all
;#IfWinActive ahk_class CabinetWClass ; if (Foc = "DirectUIHWND3")
#IfWinActive Games (D:)
$LButton::
IF (A_TickCount > ABlock) ;https://www.autohotkey.com/boards/viewtopic.php?style=19&p=466941#p466941
{
SendInput, {LButton Down}
OutputDebug 2
ABlock := A_TickCount + 400 ;1600ms
KeyWait, LButton
SendInput, {LButton Up}
OutputDebug 3
}
else
{
dir := Explorer_GetSelection()
dir_ini := dir . "\" . "anu.ini"
If FileExist(dir_ini)
{
IniRead, var_exe, %dir_ini%, SectionNameRun
Run,%comspec% /c "%dir%\%var_exe%",%dir%,hide ; cu asta la blood, nu mai arata la cursor clepsidra
}
else
{
SendInput, {LButton Down}
KeyWait, LButton
SendInput, {LButton Up}
}
}
;Loop, %la% ; For each parameter:
;{
;OutputDebug,[sa]
;}
Return
Explorer_GetSelection() { ; https://www.autohotkey.com/boards/viewtopic.php?t=60403#p255169
WinGetClass, winClass, % "ahk_id" . hWnd := WinExist("A")
if !(winClass ~="Progman|WorkerW|(Cabinet|Explore)WClass")
Return
shellWindows := ComObjCreate("Shell.Application").Windows
if (winClass ~= "Progman|WorkerW")
shellFolderView := shellWindows.FindWindowSW(0, 0, SWC_DESKTOP := 8, 0, SWFO_NEEDDISPATCH := 1).Document
else {
for window in shellWindows
if (hWnd = window.HWND) && (shellFolderView := window.Document)
break
}
for item in shellFolderView.SelectedItems
result .= (result = "" ? "" : "`n") . item.Path
if !result
result := shellFolderView.Folder.Self.Path
Return result
}
Disable(Hotkey="RButton", MS=1000) {
Hotkey, %Hotkey%, Disable_Return
Sleep, %MS%
Hotkey, %Hotkey%, Off
Disable_Return:
return
}
;;;;;;;;;;;;
Selected_Items() ;https://www.autohotkey.com/board/topic/122217-how-to-identify-a-selected-file/
{
If WinActive("ahk_class CabinetWClass") ; EXPLORER WINDOW
{
for window in ComObjCreate("Shell.Application").Windows
if window.HWND = WinExist("A")
this_window := window
if(this_window.Document.SelectedItems.Count > 1)
{
these_items := ""
for item in this_window.Document.SelectedItems
these_items .= item.Path . "`n"
return these_items
}
else
return this_window.Document.FocusedItem.Path
}
}
;;;;;;;;;;;;;;;;;;;;
Code: Select all
#Requires AutoHotkey v1.1.33
winTitle1 := "Games (D:)"
winTitle2 := "ahk_class CabinetWClass"
#If mouseOver(winTitle1, winTitle2) ; Check for mouse over either WinTitle
LButton::
MsgBox Test ; Replace this with your code for this hotkey
Return
#If
mouseOver(winTitle*) {
MouseGetPos,,, hWnd
For each, title in winTitle
If WinExist(title " ahk_id" hWnd)
Return True
}