04-16-2022, 01:29 AM
looked into this more.
Try this
Function MuteUnmuteMic
Trigger SW1
or QM 2 c# version
assign to whatever keyboard trigger you like
Macro MuteUnmuteMicC#
Try this
Function MuteUnmuteMic
Trigger SW1
def APPCOMMAND_MICROPHONE_VOLUME_MUTE 0x180000
int h=GetForegroundWindow()
SendMessageW(h WM_APPCOMMAND 0 APPCOMMAND_MICROPHONE_VOLUME_MUTE)
assign to whatever keyboard trigger you like
Macro MuteUnmuteMicC#
str code=
;using System;
;using System.Runtime.InteropServices;
;using System.Reflection;
;namespace MicMute
;{
;;class Program
;;{
;;;;private const int WM_APPCOMMAND = 0x319;
;;;;private const int APPCOMMAND_MICROPHONE_VOLUME_MUTE = 0x180000;
;;;;[DllImport("user32.dll", SetLastError = false)]
;;;;public static extern IntPtr GetForegroundWindow();
;;;;[DllImport("user32.dll", SetLastError = false)]
;;;;public static extern IntPtr SendMessageW(IntPtr hWnd,int Msg,IntPtr wParam,IntPtr lParam);
;;;;static void Main(string[] args)
;;;;{
;;;;;;try
;;;;;;{
;;;;;;;;IntPtr h = GetForegroundWindow();
;;;;;;;;SendMessageW(h,WM_APPCOMMAND,IntPtr.Zero,(IntPtr)APPCOMMAND_MICROPHONE_VOLUME_MUTE);
;;;;;;}
;;;;;;catch (Exception)
;;;;;;{
;;;;;;}
;;;;}
;;}
;}
CsExec(code)