I'm writing a couple extensions in C to get to some lower level platform features using mzc, and I'm having trouble figuring out good ways to achieve my goals.<br><br>I want to be able to interact with some win32 features including console lock notifications and hotkey notifications.<br>
<br>The problem is the notifications come in through the window message loop, and I don't know a good way to get that information back into the scheme environment.<br><br>I've got it working for the console locks using the following method:<br>
<br>the scheme_initialize() function starts a thread that creates a hidden dialog box with an event handler that toggles a global variable when the console gets locked or unlocked. The scheme_initialize() functions also installs a function just checks the value of this global variable and returns scheme_false or scheme_true. Then inside the scheme environment I basically poll on that function.<br>
<br>I would like to add some global hotkeys which I would also get notifications of in the same event loop as the console lock notifications.<br><br>My current thinking is to create an input port in the C code that blocks until a hot key message is processed in the event loop, and from the scheme environment launch a thread that loops while reading in from that port. <br>
<br>There might be a better way to do this, and I'm not sure how to trigger
the input port when a message does get processed if I do go with this
route.<br>
<br>My other thought is that this is inside a MrEd frame based program. If there were a way to
extend the message loop of the MrEd frame itself, it would also be
possible to just register the hotkey with the MrEd frame's HWND from
(send frame get-handle).<br><br>Can anybody offer any advice?<br><br>This is for my media playback program I am working on <a href="http://www.bazquux.com/wiki/Schemep3">http://www.bazquux.com/wiki/Schemep3</a>. I want to be able to pause playback while the computer is locked, and to be able to have global hotkeys for controlling playback.<br>
<br>Thanks for any help.<br><br>-- <br>Christopher W. Bowron <<a href="mailto:chris@bowron.us" target="_blank">chris@bowron.us</a>><br>[ Nothing is exciting if you know what the outcome will be ]<br> - Joseph Campbell