Balloon Detection

Using WinXP. What I need to do (pref in VB or C #) is to detect when another (closed source) program displays a balloon with a notification in the tray - and grab the details. Any help would be greatly appreciated. Thanks

+3
source share
3 answers

In such situations, I used the Microsoft Spy ++ tool to capture window information, and then use pinvoke calls FindWindowto detect when that window is present.

I have not tried with a notification, but I assume that calling pinvoke in GetTextwill load the contents.

+1
source

, pinvoke .net.

, (Vista Business SP2), # 32769 ( ) TTS_BALLOON Windows.

: , , hWnd GetParent() . hwnd ( EnumWindows() FindWindowEx()) .

, , .

pinvoke.net, spy ++ .

!

+1

Win API. , , C ++, # VB.

andyjohnson , - # 32769, TTS_BALLOON, CBT hook ( Win32, ), , , .

, , , . , CallWndProc hook, WM_SHOWWINDOW.

Edit:

, .NET. , () DLL-. Windows DLL , DLL , .NET CLR, . ( CLR , , .)

So, you have to create your hooks in your own (unmanaged) DLL. It’s possible to go from here to a managed application, for example, Michael Kennedy did it in the Code Project , but to do it correctly and handle the types of hooks that I mentioned above, you will need to use interprocess communication, a step that Michael Kennedy left. In general, for the purpose that you described, it would be easier to just build everything in your own code.

0
source

Source: https://habr.com/ru/post/1729379/


All Articles