Developing a ScreensaverFrom: Joe
Email: brunoj@philly.infi.net
If you are using some other method to screen save then you probably need to use the PeekMessage API continually to check for any appropriate Windows messages being sent to any window. It would be called something like this:
DIm msgX as MSG
if PeekMessage(msgX, 0&, WM_KEYFIRST, WM_KEYLAST, PM_NOREMOVE) then
' End App
Unload Me ' ?
endif
if PeekMessage(msgX, 0&, WM_MOUSEFIRST, WM_MOUSELAST, PM_NOREMOVE) then
' End App
Unload Me ' ?
endif
Of course the declarations and explanations of the constants I've mentioned above are in the API help files that ship with VB. Essentially this code is checking for any Key or Mouse message, which it will not remove from the message queue, and if it finds one it ends the app. It passes 0& as the hWnd to check for so that PeekMessage will return messages for any window.
I hope this gives you some ideas at least. Good luck with your screensaver.