Results 1 to 6 of 6

Thread: Subclassing Question *Resolved*

Threaded View

  1. #1

    Thread Starter
    Fanatic Member Illspirit's Avatar
    Join Date
    Mar 2001
    Location
    Blackpool, England
    Posts
    815

    Subclassing Question *Resolved*

    Hi,

    I havent used subclassing much before, but I'm trying to stop picturebox control from being painted (long story, dont think its relevent to the Q).

    I've subclassed the picturebox and when i receive a WM_PAINT message, can i just disguard it? I want all the other messages to work as normal. Ive tried this...
    VB Code:
    1. Public Function WindProc(ByVal hwnd As Long, ByVal wMsg As Long, ByVal wParam As Long, ByVal lParam As Long) As Long
    2.    
    3.     If Not wMsg = WM_PAINT Then
    4.         WindProc = CallWindowProc(WndProcOld&, hwnd&, wMsg&, wParam&, lParam&)
    5.     End If
    6.     Debug.Print wMsg, Now
    7.    
    8. End Function

    ...but the debug window gets printed with loads of '15's over and over and over, which doesnt seem right. I'm a bit clueless here, can anyone point me in the right direction?

    Thanks,
    Illspirit
    Last edited by Illspirit; Mar 21st, 2003 at 01:48 PM.
    Illspirit - [email protected]

    SmartBarXP Lead Developer
    SmartBarXP - The leading desktop sidebar application for Microsoft Windows XP

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •  



Click Here to Expand Forum to Full Width