AppBar callback notification 
Author Message
 AppBar callback notification

I found an example to make an appbar (i.e. like Windows Taskbar) for
VB4. In VB5 shouldn't I be able to use AddressOf to get callback
notification. My attempt shown below doesn't receive any messages. I
suppose I could just subclass hooking all messages to the form, but I'd
rather do it the right way.

Dim BarData As APPBARDATA

    BarData.cbSize = Len(BarData)
    BarData.hwnd = hwnd
'callback message
'   BarData.uCallbackMessage = WM_MOUSEMOVE     'VB4
'or
    BarData.uCallbackMessage = PtrToLong(AddressOf APPBARCALLBACK)
'VB5? (my attempt)
    lResult = SHAppBarMessage(ABM_NEW, BarData)

 - - - - - - - - - - - - - - - - - - - - - - -
Public Function PtrToLong(ByVal lngFnPtr As Long) As Long
    ' convert address into a long
    PtrToLong = lngFnPtr
End Function

Public Sub APPBARCALLBACK(ByVal hw As Long, ByVal uMsg As _
Long, ByVal wParam As Long, ByVal lParam As Long)
    ...deal with messages here...
End Sub

Thanks for any help.
Art



Sat, 21 Oct 2000 03:00:00 GMT  
 AppBar callback notification

It's just a rudimentary example:
http://www.apexsc.com/vb/ftp1s.html
look for APPBAR4.ZIP

Quote:

> Would it be possible to share the page or site where you got VB source
> for AppBar API functions.  I have been searching for such an
> implementation.  I would like to take a look at it-and help if it is
> not asking to much ;)

> Thanks in advance,
> Chris Grant

> On Tue, 05 May 1998 22:10:55 -0400, Arthur Marks

> >I found an example to make an appbar (i.e. like Windows Taskbar) for
> >VB4. In VB5 shouldn't I be able to use AddressOf to get callback
> >notification. My attempt shown below doesn't receive any messages. I
> >suppose I could just subclass hooking all messages to the form, but I'd
> >rather do it the right way.

> >Dim BarData As APPBARDATA

> >    BarData.cbSize = Len(BarData)
> >    BarData.hwnd = hwnd
> >'callback message
> >'   BarData.uCallbackMessage = WM_MOUSEMOVE     'VB4
> >'or
> >    BarData.uCallbackMessage = PtrToLong(AddressOf APPBARCALLBACK)
> >'VB5? (my attempt)
> >    lResult = SHAppBarMessage(ABM_NEW, BarData)

> > - - - - - - - - - - - - - - - - - - - - - - -
> >Public Function PtrToLong(ByVal lngFnPtr As Long) As Long
> >    ' convert address into a long
> >    PtrToLong = lngFnPtr
> >End Function

> >Public Sub APPBARCALLBACK(ByVal hw As Long, ByVal uMsg As _
> >Long, ByVal wParam As Long, ByVal lParam As Long)
> >    ...deal with messages here...
> >End Sub

> >Thanks for any help.
> >Art



Sat, 21 Oct 2000 03:00:00 GMT  
 AppBar callback notification

Would it be possible to share the page or site where you got VB source
for AppBar API functions.  I have been searching for such an
implementation.  I would like to take a look at it-and help if it is
not asking to much ;)

Thanks in advance,
Chris Grant

On Tue, 05 May 1998 22:10:55 -0400, Arthur Marks

Quote:

>I found an example to make an appbar (i.e. like Windows Taskbar) for
>VB4. In VB5 shouldn't I be able to use AddressOf to get callback
>notification. My attempt shown below doesn't receive any messages. I
>suppose I could just subclass hooking all messages to the form, but I'd
>rather do it the right way.

>Dim BarData As APPBARDATA

>    BarData.cbSize = Len(BarData)
>    BarData.hwnd = hwnd
>'callback message
>'   BarData.uCallbackMessage = WM_MOUSEMOVE     'VB4
>'or
>    BarData.uCallbackMessage = PtrToLong(AddressOf APPBARCALLBACK)
>'VB5? (my attempt)
>    lResult = SHAppBarMessage(ABM_NEW, BarData)

> - - - - - - - - - - - - - - - - - - - - - - -
>Public Function PtrToLong(ByVal lngFnPtr As Long) As Long
>    ' convert address into a long
>    PtrToLong = lngFnPtr
>End Function

>Public Sub APPBARCALLBACK(ByVal hw As Long, ByVal uMsg As _
>Long, ByVal wParam As Long, ByVal lParam As Long)
>    ...deal with messages here...
>End Sub

>Thanks for any help.
>Art



Sun, 22 Oct 2000 03:00:00 GMT  
 AppBar callback notification

Quote:

> It's a bit crude I know, but I've improved it since then :-)

> I actually didn't know my code was posted there - I wonder who sent it to
> Carl and Gary.

...

Quote:
> I've since expanded it to attach to all sides etc but it is now so
> integrated with my application code that it would take a bit of work to
> strip it out.

> If you need to ask any questions, fire away :-)

  Well then...I'm waffling a bit on what method to use to move the form while
snapping an outline ghost of the form to the side where the cursor is closest.
Were you able to do this? (I am in awe.) I have no problem figuring out which
side to snap to, but I don't know whether to use API (WM_SYSCOMMAND and
MOUSE_MOVE?) or VB Mouse_ events to do the actual moving. No need to
dis-integrate your code. If you could just give a qualitative explanation I'd
be especially grateful. (I'm sort of opposed to smiley faces, but you may
imagine the one of your choice now)

Thanks,
Art



Sun, 22 Oct 2000 03:00:00 GMT  
 AppBar callback notification

It's a bit crude I know, but I've improved it since then :-)

I actually didn't know my code was posted there - I wonder who sent it to
Carl and Gary.

Basically the code is a conversion of a C/C++ sample I found on MSDN, and
uses a picturebox for message handling. You probably should try to convert
it to correct messagehandling in VB5 and trap the messages.

I've since expanded it to attach to all sides etc but it is now so
integrated with my application code that it would take a bit of work to
strip it out.

If you need to ask any questions, fire away :-)
Cheers,
Dino

Quote:

>It's just a rudimentary example:
>http://www.apexsc.com/vb/ftp1s.html
>look for APPBAR4.ZIP


>> Would it be possible to share the page or site where you got VB source
>> for AppBar API functions.  I have been searching for such an
>> implementation.  I would like to take a look at it-and help if it is
>> not asking to much ;)

>> Thanks in advance,
>> Chris Grant

>> On Tue, 05 May 1998 22:10:55 -0400, Arthur Marks

>> >I found an example to make an appbar (i.e. like Windows Taskbar) for
>> >VB4. In VB5 shouldn't I be able to use AddressOf to get callback
>> >notification. My attempt shown below doesn't receive any messages. I
>> >suppose I could just subclass hooking all messages to the form, but I'd
>> >rather do it the right way.

>> >Dim BarData As APPBARDATA

>> >    BarData.cbSize = Len(BarData)
>> >    BarData.hwnd = hwnd
>> >'callback message
>> >'   BarData.uCallbackMessage = WM_MOUSEMOVE     'VB4
>> >'or
>> >    BarData.uCallbackMessage = PtrToLong(AddressOf APPBARCALLBACK)
>> >'VB5? (my attempt)
>> >    lResult = SHAppBarMessage(ABM_NEW, BarData)

>> > - - - - - - - - - - - - - - - - - - - - - - -
>> >Public Function PtrToLong(ByVal lngFnPtr As Long) As Long
>> >    ' convert address into a long
>> >    PtrToLong = lngFnPtr
>> >End Function

>> >Public Sub APPBARCALLBACK(ByVal hw As Long, ByVal uMsg As _
>> >Long, ByVal wParam As Long, ByVal lParam As Long)
>> >    ...deal with messages here...
>> >End Sub

>> >Thanks for any help.
>> >Art



Mon, 23 Oct 2000 03:00:00 GMT  
 AppBar callback notification

I don't do this in my current app (did try, but had some "funnies" on
attaching to the new side). I have a config option to do this.

I think I might have gotten this working in another app, but that one is a
little different - it creates for form via the CreateWindowEx API call, and
then GDIs all the buttons onto it afterwards. This is not one I would
distribute, as the coding style is a little dangerous.

I'll have a look and see if I still have the code where I attempted to drag
the form around somewhere.
TTFN
Cheers,
Dino

Quote:


>> It's a bit crude I know, but I've improved it since then :-)

>> I actually didn't know my code was posted there - I wonder who sent it to
>> Carl and Gary.

>...

>> I've since expanded it to attach to all sides etc but it is now so
>> integrated with my application code that it would take a bit of work to
>> strip it out.

>> If you need to ask any questions, fire away :-)

>  Well then...I'm waffling a bit on what method to use to move the form
while
>snapping an outline ghost of the form to the side where the cursor is
closest.
>Were you able to do this? (I am in awe.) I have no problem figuring out
which
>side to snap to, but I don't know whether to use API (WM_SYSCOMMAND and
>MOUSE_MOVE?) or VB Mouse_ events to do the actual moving. No need to
>dis-integrate your code. If you could just give a qualitative explanation
I'd
>be especially grateful. (I'm sort of opposed to smiley faces, but you may
>imagine the one of your choice now)

>Thanks,
>Art



Mon, 23 Oct 2000 03:00:00 GMT  
 AppBar callback notification

I noticed that in the AppBar example, no matter what you put the
AutoHide boolean on, it always started out auto-hide.
Example:
AutoHide true ... does not resize the desktop and goes auto-hide.

AutoHide false ... does resize the desktop but also goes auto-hide
until you activate another application or the taskbar (which is
technically another application)

Would you happen to have an updated version of this that actually does
not go auto-hide when you have auto-hide set to false.

Thanks,
Chris

On Thu, 7 May 1998 16:03:05 +1200, "Dean Cleaver"

Quote:

>I don't do this in my current app (did try, but had some "funnies" on
>attaching to the new side). I have a config option to do this.

>I think I might have gotten this working in another app, but that one is a
>little different - it creates for form via the CreateWindowEx API call, and
>then GDIs all the buttons onto it afterwards. This is not one I would
>distribute, as the coding style is a little dangerous.

>I'll have a look and see if I still have the code where I attempted to drag
>the form around somewhere.
>TTFN
>Cheers,
>Dino



>>> It's a bit crude I know, but I've improved it since then :-)

>>> I actually didn't know my code was posted there - I wonder who sent it to
>>> Carl and Gary.

>>...

>>> I've since expanded it to attach to all sides etc but it is now so
>>> integrated with my application code that it would take a bit of work to
>>> strip it out.

>>> If you need to ask any questions, fire away :-)

>>  Well then...I'm waffling a bit on what method to use to move the form
>while
>>snapping an outline ghost of the form to the side where the cursor is
>closest.
>>Were you able to do this? (I am in awe.) I have no problem figuring out
>which
>>side to snap to, but I don't know whether to use API (WM_SYSCOMMAND and
>>MOUSE_MOVE?) or VB Mouse_ events to do the actual moving. No need to
>>dis-integrate your code. If you could just give a qualitative explanation
>I'd
>>be especially grateful. (I'm sort of opposed to smiley faces, but you may
>>imagine the one of your choice now)

>>Thanks,
>>Art



Mon, 23 Oct 2000 03:00:00 GMT  
 AppBar callback notification

I've tried that.  It does not work.

On Fri, 8 May 1998 08:38:34 +1200, "Dean Cleaver"

Quote:

>Oops. Add this to the bottom of the Form_Load

>    tmrHide.Enabled = bAutoHide

>Remember to change it if you ever change the state of bAutoHide
>HTH
>Cheers,
>Dino.


>>I noticed that in the AppBar example, no matter what you put the
>>AutoHide boolean on, it always started out auto-hide.
>>Example:
>>AutoHide true ... does not resize the desktop and goes auto-hide.

>>AutoHide false ... does resize the desktop but also goes auto-hide
>>until you activate another application or the taskbar (which is
>>technically another application)

>>Would you happen to have an updated version of this that actually does
>>not go auto-hide when you have auto-hide set to false.

>>Thanks,
>>Chris

>>On Thu, 7 May 1998 16:03:05 +1200, "Dean Cleaver"

>>>I don't do this in my current app (did try, but had some "funnies" on
>>>attaching to the new side). I have a config option to do this.

>>>I think I might have gotten this working in another app, but that one is a
>>>little different - it creates for form via the CreateWindowEx API call,
>and
>>>then GDIs all the buttons onto it afterwards. This is not one I would
>>>distribute, as the coding style is a little dangerous.

>>>I'll have a look and see if I still have the code where I attempted to
>drag
>>>the form around somewhere.
>>>TTFN
>>>Cheers,
>>>Dino



>>>>> It's a bit crude I know, but I've improved it since then :-)

>>>>> I actually didn't know my code was posted there - I wonder who sent it
>to
>>>>> Carl and Gary.

>>>>...

>>>>> I've since expanded it to attach to all sides etc but it is now so
>>>>> integrated with my application code that it would take a bit of work to
>>>>> strip it out.

>>>>> If you need to ask any questions, fire away :-)

>>>>  Well then...I'm waffling a bit on what method to use to move the form
>>>while
>>>>snapping an outline ghost of the form to the side where the cursor is
>>>closest.
>>>>Were you able to do this? (I am in awe.) I have no problem figuring out
>>>which
>>>>side to snap to, but I don't know whether to use API (WM_SYSCOMMAND and
>>>>MOUSE_MOVE?) or VB Mouse_ events to do the actual moving. No need to
>>>>dis-integrate your code. If you could just give a qualitative explanation
>>>I'd
>>>>be especially grateful. (I'm sort of opposed to smiley faces, but you may
>>>>imagine the one of your choice now)

>>>>Thanks,
>>>>Art



Mon, 23 Oct 2000 03:00:00 GMT  
 AppBar callback notification

Oops. Add this to the bottom of the Form_Load

    tmrHide.Enabled = bAutoHide

Remember to change it if you ever change the state of bAutoHide
HTH
Cheers,
Dino.

Quote:

>I noticed that in the AppBar example, no matter what you put the
>AutoHide boolean on, it always started out auto-hide.
>Example:
>AutoHide true ... does not resize the desktop and goes auto-hide.

>AutoHide false ... does resize the desktop but also goes auto-hide
>until you activate another application or the taskbar (which is
>technically another application)

>Would you happen to have an updated version of this that actually does
>not go auto-hide when you have auto-hide set to false.

>Thanks,
>Chris

>On Thu, 7 May 1998 16:03:05 +1200, "Dean Cleaver"

>>I don't do this in my current app (did try, but had some "funnies" on
>>attaching to the new side). I have a config option to do this.

>>I think I might have gotten this working in another app, but that one is a
>>little different - it creates for form via the CreateWindowEx API call,
and
>>then GDIs all the buttons onto it afterwards. This is not one I would
>>distribute, as the coding style is a little dangerous.

>>I'll have a look and see if I still have the code where I attempted to
drag
>>the form around somewhere.
>>TTFN
>>Cheers,
>>Dino



>>>> It's a bit crude I know, but I've improved it since then :-)

>>>> I actually didn't know my code was posted there - I wonder who sent it
to
>>>> Carl and Gary.

>>>...

>>>> I've since expanded it to attach to all sides etc but it is now so
>>>> integrated with my application code that it would take a bit of work to
>>>> strip it out.

>>>> If you need to ask any questions, fire away :-)

>>>  Well then...I'm waffling a bit on what method to use to move the form
>>while
>>>snapping an outline ghost of the form to the side where the cursor is
>>closest.
>>>Were you able to do this? (I am in awe.) I have no problem figuring out
>>which
>>>side to snap to, but I don't know whether to use API (WM_SYSCOMMAND and
>>>MOUSE_MOVE?) or VB Mouse_ events to do the actual moving. No need to
>>>dis-integrate your code. If you could just give a qualitative explanation
>>I'd
>>>be especially grateful. (I'm sort of opposed to smiley faces, but you may
>>>imagine the one of your choice now)

>>>Thanks,
>>>Art



Tue, 24 Oct 2000 03:00:00 GMT  
 AppBar callback notification

You must have a different copy then. Works fine on mine :-)
Cheers,
Dino

Quote:

>I've tried that.  It does not work.

>On Fri, 8 May 1998 08:38:34 +1200, "Dean Cleaver"

>>Oops. Add this to the bottom of the Form_Load

>>    tmrHide.Enabled = bAutoHide

>>Remember to change it if you ever change the state of bAutoHide
>>HTH
>>Cheers,
>>Dino.


>>>I noticed that in the AppBar example, no matter what you put the
>>>AutoHide boolean on, it always started out auto-hide.
>>>Example:
>>>AutoHide true ... does not resize the desktop and goes auto-hide.

>>>AutoHide false ... does resize the desktop but also goes auto-hide
>>>until you activate another application or the taskbar (which is
>>>technically another application)

>>>Would you happen to have an updated version of this that actually does
>>>not go auto-hide when you have auto-hide set to false.

>>>Thanks,
>>>Chris

>>>On Thu, 7 May 1998 16:03:05 +1200, "Dean Cleaver"

>>>>I don't do this in my current app (did try, but had some "funnies" on
>>>>attaching to the new side). I have a config option to do this.

>>>>I think I might have gotten this working in another app, but that one is
a
>>>>little different - it creates for form via the CreateWindowEx API call,
>>and
>>>>then GDIs all the buttons onto it afterwards. This is not one I would
>>>>distribute, as the coding style is a little dangerous.

>>>>I'll have a look and see if I still have the code where I attempted to
>>drag
>>>>the form around somewhere.
>>>>TTFN
>>>>Cheers,
>>>>Dino



>>>>>> It's a bit crude I know, but I've improved it since then :-)

>>>>>> I actually didn't know my code was posted there - I wonder who sent
it
>>to
>>>>>> Carl and Gary.

>>>>>...

>>>>>> I've since expanded it to attach to all sides etc but it is now so
>>>>>> integrated with my application code that it would take a bit of work
to
>>>>>> strip it out.

>>>>>> If you need to ask any questions, fire away :-)

>>>>>  Well then...I'm waffling a bit on what method to use to move the form
>>>>while
>>>>>snapping an outline ghost of the form to the side where the cursor is
>>>>closest.
>>>>>Were you able to do this? (I am in awe.) I have no problem figuring out
>>>>which
>>>>>side to snap to, but I don't know whether to use API (WM_SYSCOMMAND and
>>>>>MOUSE_MOVE?) or VB Mouse_ events to do the actual moving. No need to
>>>>>dis-integrate your code. If you could just give a qualitative
explanation
>>>>I'd
>>>>>be especially grateful. (I'm sort of opposed to smiley faces, but you
may
>>>>>imagine the one of your choice now)

>>>>>Thanks,
>>>>>Art



Tue, 24 Oct 2000 03:00:00 GMT  
 AppBar callback notification

Why dont you be a bud and upload the one you have ;)

thanks,
chris grant
On Fri, 8 May 1998 13:28:11 +1200, "Dean Cleaver"

Quote:

>You must have a different copy then. Works fine on mine :-)
>Cheers,
>Dino


>>I've tried that.  It does not work.

>>On Fri, 8 May 1998 08:38:34 +1200, "Dean Cleaver"

>>>Oops. Add this to the bottom of the Form_Load

>>>    tmrHide.Enabled = bAutoHide

>>>Remember to change it if you ever change the state of bAutoHide
>>>HTH
>>>Cheers,
>>>Dino.


>>>>I noticed that in the AppBar example, no matter what you put the
>>>>AutoHide boolean on, it always started out auto-hide.
>>>>Example:
>>>>AutoHide true ... does not resize the desktop and goes auto-hide.

>>>>AutoHide false ... does resize the desktop but also goes auto-hide
>>>>until you activate another application or the taskbar (which is
>>>>technically another application)

>>>>Would you happen to have an updated version of this that actually does
>>>>not go auto-hide when you have auto-hide set to false.

>>>>Thanks,
>>>>Chris

>>>>On Thu, 7 May 1998 16:03:05 +1200, "Dean Cleaver"

>>>>>I don't do this in my current app (did try, but had some "funnies" on
>>>>>attaching to the new side). I have a config option to do this.

>>>>>I think I might have gotten this working in another app, but that one is
>a
>>>>>little different - it creates for form via the CreateWindowEx API call,
>>>and
>>>>>then GDIs all the buttons onto it afterwards. This is not one I would
>>>>>distribute, as the coding style is a little dangerous.

>>>>>I'll have a look and see if I still have the code where I attempted to
>>>drag
>>>>>the form around somewhere.
>>>>>TTFN
>>>>>Cheers,
>>>>>Dino



>>>>>>> It's a bit crude I know, but I've improved it since then :-)

>>>>>>> I actually didn't know my code was posted there - I wonder who sent
>it
>>>to
>>>>>>> Carl and Gary.

>>>>>>...

>>>>>>> I've since expanded it to attach to all sides etc but it is now so
>>>>>>> integrated with my application code that it would take a bit of work
>to
>>>>>>> strip it out.

>>>>>>> If you need to ask any questions, fire away :-)

>>>>>>  Well then...I'm waffling a bit on what method to use to move the form
>>>>>while
>>>>>>snapping an outline ghost of the form to the side where the cursor is
>>>>>closest.
>>>>>>Were you able to do this? (I am in awe.) I have no problem figuring out
>>>>>which
>>>>>>side to snap to, but I don't know whether to use API (WM_SYSCOMMAND and
>>>>>>MOUSE_MOVE?) or VB Mouse_ events to do the actual moving. No need to
>>>>>>dis-integrate your code. If you could just give a qualitative
>explanation
>>>>>I'd
>>>>>>be especially grateful. (I'm sort of opposed to smiley faces, but you
>may
>>>>>>imagine the one of your choice now)

>>>>>>Thanks,
>>>>>>Art



Tue, 24 Oct 2000 03:00:00 GMT  
 AppBar callback notification

I only have VB5, and don't have anywhere to "upload" it to - but I could
mail it to you.

VB5 version OK?

Cheers,
Dino.


Quote:
>Why dont you be a bud and upload the one you have ;)

>thanks,
>chris grant
>On Fri, 8 May 1998 13:28:11 +1200, "Dean Cleaver"




Tue, 24 Oct 2000 03:00:00 GMT  
 
 [ 12 post ] 

 Relevant Pages 

1. Real-time Notification Callbacks

2. OLE Callback vs Implemented Interface Callback

3. OLE Callback vs Implemented Interface Callback

4. creating a callback function in c++ dll to callback a VB function in an exe

5. Appbar in vb.net posssible??

6. AppBar

7. AppBar?

8. appbar type form in vb.net Possibe??

9. APPBAR from VB (Guru Challenge)

10. How to Hide the appbar(taskbar) in Windows?

11. How to Hide the appbar(taskbar) in Windows?

12. AppBar HELP?

 

 
Powered by phpBB® Forum Software