Is there a Windows API hook for "this application needs attention"?

In Windows XP, when a program wants to attract the attention of a user, it will flash orange in the taskbar. Perhaps someone with an instant messenger is familiar with this behavior. But when I play in full screen mode, I do not see this, and the messages go unanswered.

Now I am writing my own game engine, and I would like to be kind to my users. Is there any call to the Windows API, can I write a hook that will notify my program whenever any other program simply sets its taskbar button to “orange flashing mode”? That way, I could notify the user when this happens.

I would be surprised if this is not available. I saw the Mac OS Classic screen saver that was able to do this back in the mid-90s. Where I got this idea from.

EDIT: this symbol is marked as a duplicate of how-can-i-programmatically-determine-if-an-application-is-flashing-in-the-taskb , but I reopened it again because the answers are better, and to encourage more people discuss possible solutions, if any.

+3
source share
5 answers

I don’t think there is such a thing. You may be able to achieve this with an API connection , although I'm not sure Vista will let you do this. Works on XP though.

However, there are several other ideas in this direction that may be “the next best thing”:

  • Do not use the exclusive owner of audio devices so that sounds from other programs can be heard. I’m not sure how to do this, but some games block other sounds and some do not,
  • Allow the user to switch from your game using ALT-TAB and other key combinations;
  • If another window tries to become active, enable it and gracefully minimize it;

Other general tips include:

  • Try to reduce recovery / recovery time. I don't know anything about game programming, but for some games it takes a long time.
  • Correct image recovery while minimizing / restoring. Some games have problems with this.
  • Auto pause while minimizing. If this is a network game and cannot be paused, perhaps send a message to other players so that they know.
  • A bit unrelated, but I like it when the games show the clock somewhere (a real clock, not some kind of game time). That way, I can easily tell if I should go to bed without minimizing the program. :)
+3
source

It looks like this question was asked before SO: How can I programmatically determine if the taskbar is blinking

Short answer: not possible.

0
source

Of course it is possible. This is even a Win32 question (for many years ...) see Adv. api ng news: //comp.os.ms-windows.programmer.win32

0
source

Here are some links to get started with Api hooking.

www.internals.com/articles/apispy/apispy.htm www.wheaty.net/

Vista has no API connection problems at all, except that it does not allow you to connect secure processes.

0
source

It is possible. I do this on Windows 7, so I'm sure it is possible for Vista as well.

-one
source

All Articles