From: Bee on
Hi Mike. Your post is not showing in the MS newsgroup where I am responding.

FIrst I really dislike UserControls. I already have on in my app that I use
is several places.
Soometimes when I crash in the IDE the control changes to a picturebox and I
have to reset them back.

Anyway, I spent two days fiddling with a UserControl and with a dimensionsed
picturebox set to lay directly on the form.
Both seem to work ok but the usercontrol snaps right in whereas the picbox
thingy is more interface intensive.

Still not sure what path to take. I use scrollbars all over the place so ...
Nobody suggested an app to compare and fix but that is maybe too much more
learning ccurve forme right now.
I have enough learning curve trouble with usercontrols and their
idiosyncrasies.

Thinking ...


"Bee" wrote:

> Since nothing that I have tried or has been suggested works, then maybe yes
> if it means that I can somehow trap and kill any errant messages.
> Tried DoEvents, Timers, ReEntry stopping.
>
> I remember, years ago, that I saw an example app, maybe from a textbook,
> that seemed to show all messages being processed and gave an understandable
> description. It allowed seletion of controls for monitoring. Unfortunately,
> I have been unable to find that example in my dozens of VB books.
>
> So, is there such a verbose app with source code around that I might
> understand?
>
> "Karl E. Peterson" wrote:
>
> > Bee wrote:
> > > An no, I do not know how to subclass this control to watch messages.
> >
> > Do you want to?
> >
> > --
> > ..NET: It's About Trust!
> > http://vfred.mvps.org
> >
> >
> > .
> >
From: Karl E. Peterson on
Bee wrote:
>>> An no, I do not know how to subclass this control to watch messages.
>>
>> Do you want to?
>
> Since nothing that I have tried or has been suggested works, then maybe yes
> if it means that I can somehow trap and kill any errant messages.

Of course it means that.

> Tried DoEvents, Timers, ReEntry stopping.

That won't get to the core of the problem.

> I remember, years ago, that I saw an example app, maybe from a textbook,
> that seemed to show all messages being processed and gave an understandable
> description. It allowed seletion of controls for monitoring. Unfortunately,
> I have been unable to find that example in my dozens of VB books.
>
> So, is there such a verbose app with source code around that I might
> understand?

I dunno, but you might want to look at a couple of mine:

http://vb.mvps.org/samples/HookXP (new & improved!)
http://vb.mvps.org/samples/HookMe

And all the assorted "See Also" and "Published" links on those pages.
Here's a very simple learning opportunity. Grab the first one
(HookXP), and add MHookXP.bas and IHookXP.cls to a new project. Then
put a couple scrollbars on Form1. Add this code (indented, to
highlight wordwrap):

Option Explicit

Implements IHookXP

Private Sub Form_Load()
Call HookSet(HScroll1.hWnd, Me)
Call HookSet(VScroll1.hWnd, Me)
End Sub

Private Function IHookXP_Message(ByVal hWnd As Long, ByVal uiMsg As
Long, ByVal wParam As Long, ByVal lParam As Long, ByVal dwRefData As
Long) As Long
Debug.Print "hWnd: 0x"; Hex$(hWnd), "Msg: 0x"; Hex$(uiMsg), _
"wParam: 0x"; Hex$(wParam), "lParam: 0x";
Hex$(lParam), _
"RefData: "; dwRefData
IHookXP_Message = HookDefault(hWnd, uiMsg, wParam, lParam)
End Function

Run. You'll see all your interactions with either scrollbar detailed
in the Debug window. To prevent default processing, simply avoid
calling HookDefault for any given message.

--
..NET: It's About Trust!
http://vfred.mvps.org


From: Bee on
Thanks. I'll give it a try.

"Karl E. Peterson" wrote:

> Bee wrote:
> >>> An no, I do not know how to subclass this control to watch messages.
> >>
> >> Do you want to?
> >
> > Since nothing that I have tried or has been suggested works, then maybe yes
> > if it means that I can somehow trap and kill any errant messages.
>
> Of course it means that.
>
> > Tried DoEvents, Timers, ReEntry stopping.
>
> That won't get to the core of the problem.
>
> > I remember, years ago, that I saw an example app, maybe from a textbook,
> > that seemed to show all messages being processed and gave an understandable
> > description. It allowed seletion of controls for monitoring. Unfortunately,
> > I have been unable to find that example in my dozens of VB books.
> >
> > So, is there such a verbose app with source code around that I might
> > understand?
>
> I dunno, but you might want to look at a couple of mine:
>
> http://vb.mvps.org/samples/HookXP (new & improved!)
> http://vb.mvps.org/samples/HookMe
>
> And all the assorted "See Also" and "Published" links on those pages.
> Here's a very simple learning opportunity. Grab the first one
> (HookXP), and add MHookXP.bas and IHookXP.cls to a new project. Then
> put a couple scrollbars on Form1. Add this code (indented, to
> highlight wordwrap):
>
> Option Explicit
>
> Implements IHookXP
>
> Private Sub Form_Load()
> Call HookSet(HScroll1.hWnd, Me)
> Call HookSet(VScroll1.hWnd, Me)
> End Sub
>
> Private Function IHookXP_Message(ByVal hWnd As Long, ByVal uiMsg As
> Long, ByVal wParam As Long, ByVal lParam As Long, ByVal dwRefData As
> Long) As Long
> Debug.Print "hWnd: 0x"; Hex$(hWnd), "Msg: 0x"; Hex$(uiMsg), _
> "wParam: 0x"; Hex$(wParam), "lParam: 0x";
> Hex$(lParam), _
> "RefData: "; dwRefData
> IHookXP_Message = HookDefault(hWnd, uiMsg, wParam, lParam)
> End Function
>
> Run. You'll see all your interactions with either scrollbar detailed
> in the Debug window. To prevent default processing, simply avoid
> calling HookDefault for any given message.
>
> --
> ..NET: It's About Trust!
> http://vfred.mvps.org
>
>
> .
>