App without a window

BlitzMax Forums/BlitzMax Programming/App without a window

Grey Alien(Posted 2007) [#1]
Hi, is it possible to make an app in BMax (I have MaxGUI) that sits in the icon tray area and monitors keyboard and mouse so that it can respond to certain keys/clicks/gestures etc. when the user is just using Windows or other apps? Also will the app be able to get CPU cycles so it can keep track of elapsed time since a certain event and so on? Thanks.

I realise I could probably do this with a screensaver but I don't want to display anything on screen.


Winni(Posted 2007) [#2]
You'll have to wrap the respective Windows APIs for that, but then it should be possible. You should find more details in the MSDN Library.

Or maybe this might be useful, too: http://www.everything2.com/index.pl?node_id=1131042


FlameDuck(Posted 2007) [#3]
You should probably do this as a Windows service, but writing one in BlitzMAX is probably going to be a little tricky. And why do people insist on having icons for their programs in the tray area? It's so annoying.


TartanTangerine (was Indiepath)(Posted 2007) [#4]
Yes it's possible. To monitor events you'll need a system wide Messaging Hook to intercept the WM_KEYDOWN and WM_MOUSE but beware as the app will soon be identified as a keylogger (http://www.codeproject.com/system/KeyLogger.asp) and blacklisted very quickly.


Grey Alien(Posted 2007) [#5]
Hmm, OK thanks for the advice all. So it's possible then. This app would need a tray icon to identify that it's running and for users to click on to change settings.

I've looked into messaging hooks before in Delphi. Perhaps that'd be a good language to write it in, or C++ of course.