Would it be possible to disable all sounds in an Active X GUI without it affecting the systems sound level?
I have searched both the old and the current forum(s), and it looks like a have hit hard wall...
Something like this:
Gui, Add, ActiveX, h400 w600 DISABLE SOUND vWB, Shell.Explorer
Or maybe a DLL call is necessary?
It'd be nice if someone would point me to the right direction.
Mute/disable all sounds on Active X GUI? Topic is solved
Re: Mute/disable all sounds on Active X GUI? Topic is solved
You can prevent audioses.dll's COM interfaces from being instantiated. But this will disable all sounds throughout your AutoHotkey script, not just those created by the ActiveX object.
Code: Select all
ComFail(rclsid, riid, ppv) {
if (ppv)
{
NumPut(ppv+0, "ptr")
}
return 0x8007000E
}
FuncHook(hModule, ProcName, JumpTarget) {
static code := 0
if (!code)
{
if (A_PtrSize == 8)
code := [ 0x48, 0xB8, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0xFF, 0xE0 ]
else
code := [ 0xB8, 0x00, 0x00, 0x00, 0x00, 0xFF, 0xE0 ]
}
func := DllCall("GetProcAddress", "ptr", hModule, "astr", ProcName, "ptr")
if (!func)
return
VarSetCapacity(buf, code.Length())
for i, b in code
NumPut(b, buf, i-1, "uchar")
if (A_PtrSize == 8)
{
NumPut(JumpTarget, buf, 2, "int64")
}
else
{
NumPut(JumpTarget, buf, 1, "int")
}
DllCall("VirtualProtect", "ptr", func, "ptr", code.Length(), "uint", 0x40, "uint*", OldProtect)
DllCall("ntdll\RtlMoveMemory", "ptr", func, "ptr", &buf, "ptr", code.Length())
DllCall("VirtualProtect", "ptr", func, "ptr", code.Length(), "uint", OldProtect, "uint*", OldProtect)
}
FuncHook(DllCall("LoadLibrary", "str", "audioses.dll", "ptr"), "DllGetClassObject", RegisterCallback("ComFail", "f"))
Gui, Add, ActiveX, h480 w640 vWB, Shell.Explorer
WB.Navigate("https://youtube.com/watch?v=something")
Gui Show
Re: Mute/disable all sounds on Active X GUI?
I don't really mind disabling the sounds from my script all together, so this should do the job for now.
Thank you.
Thank you.
Who is online
Users browsing this forum: Google [Bot], wilkster and 123 guests