Cool, Cam I post that on the malafe.net site until I get it fixed?
Yes. And I neglected to mention that the C runtime files (the non .plugin files) need to go in the mala directory itself. If you put them in the plugin directory then the plugin won't find them - windows looks for them in the directory of the exe, not of the .plugin file.
TheShanMan: I'm curious how does that plugin work? Are you using GetForegroundWindow and then bringing MaLa to the foreground if it returns NULL?
Exactly. Since loadman is going to make this publicly available and you inquired about it, I'll quote what I said to loadman via PM:
It starts a thread which has a hidden window, and a timer fires every 1/4 second. In the timer handler it calls the windows API GetForegroundWindow. If the window is NULL (no window has focus), then it tries to set focus back to MaLa.
It pretty much logs everything it finds to a log file, since the original intention was simply to find the cause of the focus problem (I thought some background app was taking focus). So it might be helpful for people to isolate the cause of their focus problems (be it MaLa or some background app) if you periodically check your log file for cases where some other application has the focus, or focus is NULL.
Some notes regarding what is seen in the log file:
- Of course, MaLa shouldn't always have focus - focus will shift to mame and may even legitimately be NULL sometimes (not sure on that one - perhaps this happens before MaLa gets focus back), so just because something other than MaLa has focus doesn't automatically mean there's a problem.
- This only checks focus every 1/4 second, so you can't assume that this is a perfect record of focus changes. It could certainly miss focus changes. The intention was to catch the problem where focus is stuck somewhere that it shouldn't be, and every 1/4 second is plenty for that. Plus I wanted to keep this plugin from consuming any more cpu cycles than necessary.
- If you see focus shifting to some background app, I'm not sure you can blame MaLa, or expect MaLa to be "fixed" for that. You probably need to look into getting rid of the background app.