Created
October 30, 2018 08:08
-
-
Save tmplinshi/05c1c395b86916f79b01d66400e6180f to your computer and use it in GitHub Desktop.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
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