>Hi Carlos,
> OK, OK... But I don't uderstand one thing. Why you redirect OCX's wndproc to VFP wndproc. It's purpose.
>
>MartinJ
Martin:
Thank you for your response. I dont redirect the wndproc, I just asked if that was the way to do it, but it seems its not.
This is not an OCX we are talking about, its a window control created using CreateWindowEx.
All I want is to do some painting on its window after each WM_PAINT message. But it looks that this is way over my knowledge, there are to many things I should learn to understand how this works.
Even if I was able to bind to the WM_PAINT message, there are many things to consider, the region that needs updating, use BeginPaint instead of GetDC, etc. Too much for what i want to do.
I just want to draw a 1 pixel border around the client area of a window, and i have to do it every time the window redrwas itself.
Carlos
>
>
>>>Hi Carlos,
>>>
>>>If you want bindevent() to message for non VFP window message, you must hack window has get these message inclusive redirect window procedure:
>>>
>>>
>>>.ctl32_OldProc = GetWindowLong(This.ctl32_controlHwnd, GWL_WNDPROC)
>>>Bindevent(This.ctl32_controlHwnd, WM_PAINT, This, [ctl32_WM_Paint], 1)
>>>
>>>
>>>MartinJ
>>>
>>
>>Martin: Thank you for you comments, but I don't get it. This line I use to save the window procedure of vfp, to use it in the event handler:
>>
>>
>>.ctl32_OldProc = GetWindowLong(_vfp.HWnd, GWL_WNDPROC)
>>
>>
>>Procedure ctl32_WM_Paint:
>>
>>
>>Lparameters tnHWnd As Integer, tnMsg As Integer, tnwParam As Integer, tnLparam As Integer
>>
>>With This
>> If tnMsg = WM_PAINT Then
>> ?Transform(tnHWnd, [@0])
>> .CTL32_SETBORDER()
>> Endif
>>
>> m.lnResult = CallWindowProc(.ctl32_OldProc, tnHWnd, tnMsg, tnwParam, tnLparam)
>>Endwith
>>
>>Return m.lnResult
>>
>>
>>Tha above never fires now. Are you saying I should change the window procedure of the control window to that of _VFP? like:
>>
>>
>>.ctl32_VFPProc = GetWindowLong(_vfp.HWnd, GWL_WNDPROC)
>>.ctl32_CTLProc = GetWindowLong(This.ctl32_controlHwnd, GWL_WNDPROC)
>>
>>SetWindowLong(.ctl32_controlHwnd, GWL_WNDPROC, .ctl32_VFPProc)
>>
>>
>>This way I would get the WM_PAINT messages, where? The more I read about this, the more confused I get, if I understand, what that last code does is subclass the window. Do you have any links where I can read about concepts regarding this? I started 6 hours ago, now I want to learn this badly.
>>
>>Thanks again,
>>
>>Carlos