Gerhard Schreurs
New Member
Hi guys. I'm a web/app developer with not much experience in programming for windows and almost no experience with "low level" Windows API.
I want to control OBS from a C# Windows Forms app. I want to be able to START and STOP recording my screen. My best bet was to assign hotkeys in OBS for starting and stopping recording and somehow call / transmit these hotkeys from my Forms App.
Like I said, I'm not really experienced in this area. I am able to send text to windows, but I am almost clueless about how to "transmit" a hotkey and let OBS pick it up. I just red a bit about keyboard input, and I'm guessing that I need to create a WM_HOTKEY message, with a window handle and a hotkey identifier. Or, possibly I need to create a WM_SYSCOMMAND specifying a SC_HOTKEY. I'm not sure. I messed around a bit with Spy++ (for the first time in my life), trying to find out what messages are transmitted to OBS, but I can't figure it out. I could however see SPY++ pick up WIN+R (run command), for example.
Currently, I want to use CTRL+1 to start a recording, and CTR+2 to stop recording.
BTW: OBS is running minimized in the system tray.
I'd really appreciate an example code and/or steps on how to achieve this. And possibly there is another method to do this?
Kind regards...
I want to control OBS from a C# Windows Forms app. I want to be able to START and STOP recording my screen. My best bet was to assign hotkeys in OBS for starting and stopping recording and somehow call / transmit these hotkeys from my Forms App.
Like I said, I'm not really experienced in this area. I am able to send text to windows, but I am almost clueless about how to "transmit" a hotkey and let OBS pick it up. I just red a bit about keyboard input, and I'm guessing that I need to create a WM_HOTKEY message, with a window handle and a hotkey identifier. Or, possibly I need to create a WM_SYSCOMMAND specifying a SC_HOTKEY. I'm not sure. I messed around a bit with Spy++ (for the first time in my life), trying to find out what messages are transmitted to OBS, but I can't figure it out. I could however see SPY++ pick up WIN+R (run command), for example.
Currently, I want to use CTRL+1 to start a recording, and CTR+2 to stop recording.
BTW: OBS is running minimized in the system tray.
I'd really appreciate an example code and/or steps on how to achieve this. And possibly there is another method to do this?
Kind regards...