Thread Rating:
  • 0 Vote(s) - 0 Average
  • 1
  • 2
  • 3
  • 4
  • 5
Mute Microphone
#7
looked into this more.
Try this
Function MuteUnmuteMic
Trigger SW1     Help - how to add the trigger to the macro
Code:
Copy      Help
def APPCOMMAND_MICROPHONE_VOLUME_MUTE 0x180000
int h=GetForegroundWindow()
SendMessageW(h WM_APPCOMMAND 0 APPCOMMAND_MICROPHONE_VOLUME_MUTE)
 or QM 2 c# version
assign to whatever keyboard trigger you like
Macro MuteUnmuteMicC#
Code:
Copy      Help
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)


Messages In This Thread
Mute Microphone - by ken gray - 11-18-2021, 01:09 PM
RE: Mute Microphone - by stupomer - 04-07-2022, 05:08 PM
RE: Mute Microphone - by ken gray - 04-07-2022, 06:42 PM
RE: Mute Microphone - by stupomer - 04-08-2022, 01:13 PM
RE: Mute Microphone - by _pi - 04-14-2022, 02:28 PM
RE: Mute Microphone - by Kevin - 04-15-2022, 10:32 PM
RE: Mute Microphone - by Kevin - 04-16-2022, 01:29 AM
RE: Mute Microphone - by stupomer - 04-20-2022, 11:04 PM

Forum Jump:


Users browsing this thread: 1 Guest(s)