From: Tony Toews [MVP] on
Karl E. Peterson <karl(a)exmvps.org> wrote:

>The important thing to do with any of these samples is to go straight
>to the message processing routine, and see what it's doing. Then wire
>up the hook however you're most comfortable.

I'm not that good at the internals of Windows and such to figure all
that out.

Tony
--
Tony Toews, Microsoft Access MVP
Tony's Main MS Access pages - http://www.granite.ab.ca/accsmstr.htm
Tony's Microsoft Access Blog - http://msmvps.com/blogs/access/
For a convenient utility to keep your users FEs and other files
updated see http://www.autofeupdater.com/
Granite Fleet Manager http://www.granitefleet.com/
From: Tony Toews [MVP] on
Shotgun Thom <tmoran4511(a)gmail.com> wrote:

>Take a look at this List Box control:
>
>http://www.planet-source-code.com/vb/scripts/ShowCode.asp?txtCodeId=69001&lngWId=1
>
>You can embed the control in your project so there would be no
>dependencies to ship.
>
>Also includes it's own Image List control so you wouldn't need to add
>the VB6 control.
>
>The demo included is very good and shows the many possibilities.
>Works well.

Wow, that is impressive. Very nice demo the programmer made.
Awesome! Exactly what I was looking for.

Tony
--
Tony Toews, Microsoft Access MVP
Tony's Main MS Access pages - http://www.granite.ab.ca/accsmstr.htm
Tony's Microsoft Access Blog - http://msmvps.com/blogs/access/
For a convenient utility to keep your users FEs and other files
updated see http://www.autofeupdater.com/
Granite Fleet Manager http://www.granitefleet.com/
From: Karl E. Peterson on
Tony Toews [MVP] wrote:
> Karl E. Peterson <karl(a)exmvps.org> wrote:
>
>> The important thing to do with any of these samples is to go straight
>> to the message processing routine, and see what it's doing. Then wire
>> up the hook however you're most comfortable.
>
> I'm not that good at the internals of Windows and such to figure all
> that out.

Okay, I can understand that. But I will say that, as often as not,
it's the implementation details that obscure the actual task being
accomplished. When looking at samples like this, zero in on the Select
Case block in the message sink routine, where different code is
executed based on which message is recieved. That part is almost
always directly transplantable between any one of the numerous methods
for actually accomplishing the subclass.

As an example, if I want to track the user resizing a window, and
potentially limit that activity, this is really all there is to it:

Dim mmi As MINMAXINFO
Dim EatIt As Boolean

' Special processing for messages we care about.
Select Case uiMsg
Case WM_GETMINMAXINFO
If m_Enabled Then
' Snatch copy of current minmax.
Call CopyMemory(mmi, ByVal lParam, Len(mmi))
' Give client chance to alter defaults.
RaiseEvent GetMinMax(mmi.ptMinTrackSize.x,
mmi.ptMinTrackSize.y, _
mmi.ptMaxTrackSize.x,
mmi.ptMaxTrackSize.y)
' Make sure maximum really is maximum, to avoid flash.
mmi.ptMaxSize = mmi.ptMaxTrackSize
' Send altered values back to Windows.
Call CopyMemory(ByVal lParam, mmi, Len(mmi))
EatIt = True
End If

That snippet can really be moved from project to project to project,
almost without consideration whatsoever of what means are being used to
actually hook the message.

Taken from http://vb.mvps.org/samples/HookXP

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


From: Karl E. Peterson on
Tony Toews [MVP] wrote:
> Shotgun Thom <tmoran4511(a)gmail.com> wrote:
>
>> Take a look at this List Box control:
>>
>> http://www.planet-source-code.com/vb/scripts/ShowCode.asp?txtCodeId=69001&lngWId=1
>>
>> You can embed the control in your project so there would be no
>> dependencies to ship.
>>
>> Also includes it's own Image List control so you wouldn't need to add
>> the VB6 control.
>>
>> The demo included is very good and shows the many possibilities.
>> Works well.
>
> Wow, that is impressive. Very nice demo the programmer made.
> Awesome! Exactly what I was looking for.

That is a very impressive piece of work, there!

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


From: Tony Toews [MVP] on
Karl E. Peterson <karl(a)exmvps.org> wrote:

>That is a very impressive piece of work, there!

If Karl approves then I'm so happy I'm ... (fill in the blanks)
<smile>

Tony
--
Tony Toews, Microsoft Access MVP
Tony's Main MS Access pages - http://www.granite.ab.ca/accsmstr.htm
Tony's Microsoft Access Blog - http://msmvps.com/blogs/access/
For a convenient utility to keep your users FEs and other files
updated see http://www.autofeupdater.com/
Granite Fleet Manager http://www.granitefleet.com/