Baloon Notify Click issue

Hey guys

Thanks so far. I haven't had chance to try anything yet as I'm currently building a display table out of reclaimed canal lock gates.... Heavy lol

I think there is something at peterssoftware that can move a form to the corners.

I'll take a look later.

Cheers

Nidge
 
Here you go. This is a start. But it is still really really ugly.

It subclasses the AccessForm - but the WinProc goes wild and will stuff up the CPU becuase of this.

If I were you I would create an invisible window with the Windows API and use this handle for the balloon. This will solve the WinProc problem.

Then you need to differentiate between the X and a click.
 

Attachments

Right,

i changed everything and i now get a different balloon notify thanks the the link you provided darbid. the only thing again that isnt working is the balloon click. i set up a TwipsPerPixel conversion and a mouse move on the form to try and locate the mouse click to fire an event but still nothing. im pretty sure its within reach of Access its just finding the way......


ive attached the updated file so far



Nidge
 

Attachments

A slightly more upddated one that is testing the pixels vs WM_LBUTTONCLK value to see if they match which is obviously what should trigger the event if they do match. the theory is i guess-

get the screen X size and divide by twips
get the WM_LBUTTONCLK which should record the co-ordinate
match the two to find a screen location match ( being on the balloon )
fire the event.

Still very much WIP.........


Nidge
 

Attachments

An Access version is attached.

From 800 x 600 to 1600 x 900 the A2K3 attachment seems to work okay.

May need someone to round the corners but it seems logically correct.

Chris.
 

Attachments

ChrisO - Out of the box I could not get yours to work. I have not played yet but on my MacBook(win7/access 2007) with 1680 - 1050 screen i do not see it.

Nigel - I had a look at yours you have been doing a lot of work. But did you read my other posts above. For whatever reason I do not think that the Balloon is sending the notifications of mousemovements to the form event. I have read somewhere that the Handle that you get from Me.hwnd is not the real windows handle (because of Access specific issues) and thus if this is true then the balloon is sending the messages to the wrong place.

In my opinion your only hope is with subclassing and then working out the messages yourself as in my example.

Hitech has added a good reference which shows in theory how the messages should work.
 
I'm going to look through the links today. I'm determined to get it working and as much as a replication would work, I prefer to try and achieve the potential unachievable lol

I have a windows spy to try and help me along.

Nidge
 
using your old example and hitechs link I have got you want you want.

Now you can get an event that happens when a user clicks the balloon. If the user does not interact or clicks the x you can tell this as well.

Remember in a winproc you cannot stop your code, debug or use a message box.

It is still a mess - because of me but you should work it out.
 

Attachments

i had a dog, and his name was BINGO........ lol

i placed this
Code:
Public Function WindowProc(ByVal hwnd As Long, ByVal Msg As Long, _ 
ByVal wParam As Long, ByVal lParam As Long) As Long

    [COLOR="red"]Dim strBalloonTip As String[/COLOR]

    If Msg = WM_LBUTTONDOWN Then

        Select Case lParam

        Case NIN_BALLOONUSERCLICK
            Debug.Print "click baloon"
           [COLOR="red"] strBalloonTip = "click balloon"[/COLOR]
            SetWindowLongA frmHWND, GWL_WNDPROC, lngOldProc

        Case NIN_BALLOONSHOW
            Debug.Print "show baloon"

        Case NIN_BALLOONHIDEs
            Debug.Print "hide"

        Case NIN_BALLOONTIMEOUT
            Debug.Print "timeout"
            SetWindowLongA frmHWND, GWL_WNDPROC, lngOldProc

        Case Else
            Debug.Print "lparam" & lParam

        End Select

    End If


    WindowProc = CallWindowProc(lngOldProc, hwnd, Msg, wParam, lParam)

    [COLOR="Red"]Select Case strBalloonTip

    Case "Click Balloon"

        MsgBox strBalloonTip

    Case Else
        Exit Function
    End Select[/COLOR]

End Function

and it successfully shows a message on the balloon click so, there is no reason why i cant call another routine. i placed it at the end to ensure it didnt halt the WindowProc as you suggest Darbid.


I'll do further testing but i do believe it works :D


im going to look at placing your WindowProc into my other example as the coding is much smaller but in the meantime,

thanks a million fella's. I'll post a finished product later

Nidge
 
Hi

One new thing I've noticed. When the balloon pops up, access to the application form halts as the balloon is effectively like a popup message.

I'll have a look at the other example to see if this behavior is there too as I'm sure the structures in both examples are different.


Cheers

Nidge
 
you can halt the winproc function I think as long as you first call this

Code:
SetWindowLongA frmHWND, GWL_WNDPROC, lngOldProc
This will send the messages back on their merry way to the normal place instead of to your function.

Yes please put a finished simpler one. That one you started was a monster with timers and everything.

In hitechs link there is something about focus. Maybe throw some DoEvents around EXCEPT for in the Winproc.
 
Lol yeah it was a sample for someone looking to notify for emails etc. There is a lot of junk and unused declarations too so I'll bin them. I first have to fit my fire doors and stuff!!

Nidge
 
Some people are never happy lol


I've cleaned out the dirt and made durevthe wrapper is easy. Added a couple of things but still have a problem. It's linked I think, to these elements-

FrmHwnd = me.hwnd
If I remove this, I can access the application window with a balloon popped. By adding it back in, the balloon is in front of every form.

I read it may be linked to the following-

NIN_TIP
NIN_INFO

They are both types of message balloons.



Nidge
 
I dont know an answer and I have nothing on those two messages TIP/INFO

I would try it with using the Access Application HWND again. The only reason for changing was to try to get the mousemove event of the form to work, but that did not.

I am not sure if subclassing the access application will cause other problems, I can guess that the Winproc will go wild but try it.

I did say this above :-) but my second suggestion is use the windows API to make a small invisible window and then use the HWND of this for your pop up. This little window will have the access window as its parent. Then set focus on your form. (in theory it works - but this is what gets me with the Windows API - in practice there is always something you have forgotten.)

The other alternative is to keep all the same and use some get focus code of the windows API to give the form focus again. I thought I read something on this in one of the links HiTach did.

You posted at 2.02AM on a Friday (my time) - you are either a NERD or have forgotten that Fridays is POETS day. Piss Off Early Tomorrows Saturday. :-)
 
Nerd lol?

No mate. I was doing a website for my father in law and time was running thin.... I have 3 business's so I usually look at my figures late at night as I don't get interrupted.

I'll read into hwnd. I'm not too familiar with it at the minute. I'm a self taught coder and don't do it for a job or anything but I do like to get things right.


Cheers

Nidge
 
I am self taught and still a beginner. But I like it to work.
 
The OT laws were Jewish law. Most Christians are gentiles. OT law was not invalidated, it just does not apply to most Christians. In order to be a Christian you do not have to first become a Jew.

What are you on about and what has that got to do with this thread.........
 
Heres an odd thing!

i can get the ballon click to move back to the application window by using

SetForegroundWindow

it works exactly 3 times then i cant get focus. if i close the application and restart, i can get the focus again for exactly 3 times again......

if i add
Code:
Application.quit

at the end of WindowProc underneath my msgbox, Access crashes.......


this is really bugging me now and determination is rife lol


Nidge
 

Users who are viewing this thread

Back
Top Bottom