News:

MASM32 SDK Description, downloads and other helpful links
MASM32.com New Forum Link
masmforum WebSite

Manual SubClassing

Started by xandaz, February 18, 2012, 07:34:50 AM

Previous topic - Next topic

xandaz

    i'm not sure that this is very useful but if for some reason you need to do a manual subclassing you have here an example.

ragdog

Hi

I use to subclassing a window always this way



            invoke  CreateWindowEx,0,addr MyListViewClass,0,WS_VISIBLE+WS_CHILD+LVS_REPORT,
                        0,0,rect.right,rect.bottom,hWnd,0,hInstance,0
            mov     hListView,eax   

            invoke   SetWindowLong,eax,GWL_WNDPROC,LVProc           <<<<<<<<<<<<<<<<
             mov   ListviewOldProc,eax                                                 <<<<<<<<<<<<<<<<


Now can i in this subclass us Wm_paint or what ever

Greets,

xandaz

    Sure Ragdog. Thats the traditional way to do it. I made that post because i'm going trought some issues with a controls library i'm building. The parent window doesn't get notified of some useful messages and i needed to subclass it. Also i needed the wm_create message. if the parent window isn't getting it you need to go manual on it because when the CreateWindow returns, the message has already gone for default processing.
   so.... that's why... Thanks

dedndave

WndProc PROC    hWnd:DWORD,uMsg:DWORD,wParam:DWORD,lParam:DWORD

you might want to add...

WndProc PROC USES EDI hWnd:DWORD,uMsg:DWORD,wParam:DWORD,lParam:DWORD

:P

xandaz

   oh yeah right dave.... keep forgetting that.... thanks