Skip to content

Instantly share code, notes, and snippets.

Embed
What would you like to do?
Gui, +HWNDhGUI
Gui, Add, Text, x50 y50 w700 h500 HWNDhText,
Gui, Show, w800 h620
mpv := "D:\Program Files\mpv\mpv.exe"
Run, %mpv% --idle --input-ipc-server=\\.\pipe\mpvsocket --wid=%hText% ; Or --wid=%hGUI%
return
GuiDropFiles:
mpv_loadfile(A_GuiEvent)
return
mpv_loadfile(ByRef filename) {
mpv_command("loadfile """ StrReplace(filename, "\", "\\") """")
}
mpv_command(ByRef sCommand) {
Run, %ComSpec% /c echo %sCommand% > \\.\pipe\mpvsocket,, Hide
}
GuiClose:
ExitApp
WM_KeyDown(wParam, lParam, nMsg, hWnd) {
static _ := OnMessage(0x100, "WM_KeyDown")
key := GetKeyName( Chr(wParam) )
ControlSend, mpv1, % "{" key "}", A
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
You can’t perform that action at this time.