Baloon Notify Click issue

NigelShaw

Registered User.
Local time
Today, 19:58
Joined
Jan 11, 2008
Messages
1,575
Hi

i have attached a db that i recently posted in .mdb format. the Balloon works great and displays as it should. i would like to try and get this to do something when you click it. Currently, it disappears but i can seem to find a way of actioning anything else.... i suspect it has something to with
Code:
Private Const NIN_BALLOONUSERCLICK = (WM_USER + 5)

but its a bit beyond me to get it working. Has anyone else needed this before or managed to get the balloon to do something when clicked?

my purpose is because i have a function that will display the balloon if a new update is available. By clicking the balloon, the user can be directed to the update download location.


all help appreciated as always


Nidge
 

Attachments

Last edited:
A similar balloon is shown when i receive a message from outlook. I contains a hyperlink. Clicking it brings me to the actual mail.

Perhaps you should add a hyperlink in the message?

HTH:D
 
Hi

Dont know if you can hyperlink to a routine as the user would need to be directed to the web for the download but also the app would need to quit.

am i the only person who has even used the balloon notify?

regs


Nigel
 
I don't use the balloon notify. It reminds me too much of the annoying paperclip.

The regular msgbox works for me.

HTH:D
 
Yeah but I wanted a different approach. Something that didn't halt the user. A messagebox halts but a balloon doesn't and they look nice. I hated that damn paperclip too
 
When you use
Code:
    DoCmd.OpenForm "FORM1", acNormal, , , , acWindowNormal
Code will continue when the form is opened. You could use this to create your own messagebox.

When you use
Code:
    DoCmd.OpenForm "FORM1", acDialog, , , , acWindowNormal
Code will stop until the form is closed.

HTH:D
 
Hi

Yes but there is still a messagebox that the user 'needs' to click in order to continue whereas, I wanted an optional message. A balloon pops up in the corner nice and simple. The user can read it and if they want to, click it to get the update. The notion is that it will appear and then disappear but in doing so, the user is aware of the update being available so then has a choice at a later time to manually update.

Ultimately, I want the option not the requirement.

Cheers

Nigel
 
Hi Nigel,

I have not done it but you are going to have to subclass the balloon and then listen for a mouse click.

For subclassing this balloon I think you could see my example of how to do that. http://www.access-programmers.co.uk/forums/showthread.php?t=196922&highlight=tooltip

google around and find the message that happens when it isd clicked and then listen for this event.

This is just the theory of it and I think you will have to differentiate between a click on the balloon and a click on the X.
 
Hi Darbid,

i looked at your db and i'll be honest, at a look it doesnt help me that much as i would need to get my head around it thoroughly lol...

A long extensive google search brings up lots if i were using VB and the code is similar to that in my sample but the part about clicking the balloon just doesnt seem to exist.....

i'll keep looking i guesss (sigh)



cheers


Nigel
 
You are in the NOT EASY WORLD again.

My example uses a WIN PROC which is the event that happens when the window (In this case a balloon tip) starts sending messages around. This is how windows works. Each control has a handle and it sends messages to its parents or children to do or that it is doing something.


When you use the Windows API and create something you also create the PROC which is where events are sent. But I think it is easier with the NotifyIcon.

With the NotifyIcon - there are 2 important parts in the set up . You must have the NIF_Message in the flags so that it will even start sending messages

Code:
.uFlags = NIF_ICON Or NIF_TIP Or NIF_MESSAGE
I THINK this is the key - that the messages you actually want have to do with MOUSEMOVEments. See later the explanation but this then mapps directly to the mousemove event of the form handle.

Code:
.uCallbackMessage = WM_MOUSEMOVE
Here is a working example. It looks like this will work in VBA access as well although the form might be different and that twipsperinch function is not in VBA but google and you will get the VBA one.

http://www.vbforums.com/showthread.php?t=514392&highlight=Detect+Balloon+Click

If you do not have VB6 dont stress there is an .EXE there and a text editor should be able to read the code - at least the BAS.

An explanation of how this example works is here

When you pass the mouse pointer over the icon in the taskbar status area, the form receives the message WM_MOUSEMOVE. This message maps to the form's MouseMove event. The X argument is the product of one of the mouse constants that indicates the mouse input (such as a left-click, right-click, single-click, or double-click) and the TwipsPerPixelX property of the screen. The mouse input is produced by dividing the X argument with this property. The mouse input is then used in a Select Case statement to execute a series of instructions.
source http://support.microsoft.com/kb/162613


More generally here is one that goes through all events of the Balloon tool tip

http://www.technofundo.com/tech/win/SNIcon.html

Notice this part here

Code:
.uCallbackMessage = WM_USER_SHELLICON


unhelpful result of google http://www.codeguru.com/forum/showthread.php?t=431546

http://www.vbmonster.com/Uwe/Forum....-let-balloon-ToolTip-return-till-users-clicks
 
PS:

I kinda had a quick go at it. I started with your example.

The first thing I noticed is that you use the Access application HWND, but we need the form instead so that we can detect mousmovements.

I noticed is your modifytray is different to the set tray. The examples make them the same.

But I could not get the mousemove event to fire when the mouse hovers over the Balloon. Which should be happening.

You might find the same thing.

I do not think that there is an Application mouse event, which is where maybe the events are going even when you use the form HWND.
 
Hi

Yes but there is still a messagebox that the user 'needs' to click in order to continue whereas, I wanted an optional message. A balloon pops up in the corner nice and simple. The user can read it and if they want to, click it to get the update. The notion is that it will appear and then disappear but in doing so, the user is aware of the update being available so then has a choice at a later time to manually update.

Ultimately, I want the option not the requirement.

Cheers

Nigel
If you program the timer event of the "messagebox" form to close after 5 seconds, you don't need to do anything. It works just like the baloon.

HTH:D
 
Hi Darbid,

thanks for your help so far. i think if we get it working, it could be a nice useful tool for everyone to benefit..

Gus,

the balloon needs a purpose. i can already set the timer quite easily but if the user feels the need to click it, it does nothing which would be frustrating i guess. everything needs a purpose otherwise you'd fill your program with useless but nice things :D


cheers


Nidge
 
Use the OnClick event of the form and any controls you might have to close the form and the behaviour of the form should be the same as a baloon.

HTH:D
 
I like the determination gus, you're really championing the form option lol.

I really want the balloon option and I firmly believe anything is possible.

Cheers lol

Nidge
 
Nigel I have thought about this a little more.

As you can see the example I gave you uses the Form Handle for the balloon. Thus as MS says when you click the Balloon the Form event is fired. This works in VB6 but it did not work when I tried it with Access. I have read somewhere that Access forms are heavily sub-classed by MS and that the handle we get is not the handle that windows has for the form. This would explain why the Form Mouse event does not fire.

If you come to the same conclusion you are going to have to do one of two things. Sub-class the balloon window yourself, or use the Application Handle like you are. Which means you would need to see if you can get Access mouse events (I do not think this is possible, but might be).

I would first try to sub-class. Then I would give up and create my own form that pops up at the bottom right hand side of the screen. The only hard thing to do is get the position right for all screen/resolution types.
 
I like the determination gus, you're really championing the form option lol.

I really want the balloon option and I firmly believe anything is possible.

Cheers lol

Nidge
You don't have to make it more difficult than it is.

In addition you might want to set the popup property of the form to True. It anables the form to step out of the Access window. Using the move event you can then place it anywhere on your screen.

Enjoy!
 
Here a sample database (db10) and another sample database which i didn't make to fade it out. just like the real deal. Just combine the two.

Enjoy!
 

Attachments

thats pretty good stuff.

But the trick here....even for the C#/C+/VB guys is to get that form down in the right corners in the right position.
 

Users who are viewing this thread

Back
Top Bottom