|
-
April 25th, 2006, 12:08 AM
#1
protecting you window from IM windows and other dangers :P
Hey everyone:
I want the user to choose when they close down my application, so I listen for user input... but these pesky IM windows always interrupt my app and steal focus. I've tried not responding to the following messages.... then I tried what you'll see below.
I thought by handling them I'd be OK... but IM windows (from Gaim for instance) totally kills focus of my program. Thoughts? Thanks!
case WM_KILLFOCUS:
case WM_QUIT:
case WM_CLOSE:
case WM_DESTROY:
return(DefWindowProc(hWnd, message, wParam, lParam));
-
April 25th, 2006, 04:49 AM
#2
Re: protecting you window from IM windows and other dangers :P
Can you plz explain what you mean by "i want the user to choose when they close down my application..."? Anyone can close your app any time by clicking the 'X' button, no? No need to bother with anything... I know i am missing something here
-
April 25th, 2006, 11:34 AM
#3
Re: protecting you window from IM windows and other dangers :P
 Originally Posted by Amn
Can you plz explain what you mean by "i want the user to choose when they close down my application..."? Anyone can close your app any time by clicking the 'X' button, no? No need to bother with anything... I know i am missing something here 
Sure, please let me explain myself a little better.
I have distinct ways that the user can shut down my application. They know how to do it. What I don't want to happen is for another application to cause mine to lose focus, or to shut it down. I'm writing a screensaver and when anything like an IM window pops up, it ends the screensaver. I'd rather terminate on user input (mouse moves, keystrokes, mouse buttons, etc...) and not simply other app's messages. I'm writing for NT based machines (XP, 2000, etc...).
Does this make sense?
-
April 25th, 2006, 02:44 PM
#4
Re: protecting you window from IM windows and other dangers :P
I would think it could be easily done by watching the position of the mouse for changes, and the keyboard, not messages sent to the window. Isn't that how screensavers are normally?
Please remember to rate the posts and threads that you find useful.
How can something be both new and improved at the same time?
-
April 25th, 2006, 05:22 PM
#5
Re: protecting you window from IM windows and other dangers :P
 Originally Posted by WizBang
I would think it could be easily done by watching the position of the mouse for changes, and the keyboard, not messages sent to the window. Isn't that how screensavers are normally?
That's what I thought... When my screensaver is running, IM windows do not cause it to terminate (kinda defeats the purpose).
Viggy
-
April 25th, 2006, 07:12 PM
#6
Re: protecting you window from IM windows and other dangers :P
Possibly the IM window does some mouse move/keyboard simulation using SendInput or other API.
Posting Permissions
- You may not post new threads
- You may not post replies
- You may not post attachments
- You may not edit your posts
-
Forum Rules
|
Click Here to Expand Forum to Full Width
|