Saulius Zrelskis wrote:
Before returning, CreateWindow sends a WM_CREATE message to the window
procedure.
So this message _never_ processed in hb_gt_wvt_WndProc, because window handle
is still unknown for hb_gt_wvt_Find.
This also appends to messages WM_GETMINMAXINFO, WM_NCCREATE and WM_NCCALCSIZE.

Any hint how to resolve this?

Hi,


Warning: I do not know anything about WVT, so, my answer will be more generic, but could not fit in case of WVT.

I understand the main problem is binding the hWnd to some internal window structure/object representing hWnd in application. Before CreateWindow returns (and hWnd is obtained and bound), event handler receives some messages and it is unable to locate window structure.

I use the following method: before CreateWindow() call I put structure pointer into static variable. After first (any) message is received I do hWnd and structure binding, and forward message to real handler.

To isolate this binding functionality and avoid situation then message for a different (not the one that was just created) window will be dequeued, I use a separate window procedure for binding purpose. After hWnd and structure is bound, I set the real window handler using SetWindowLong(hWnd, GWL_WNDPROC, ...) and forward event to real handler.

Is it clear?


Regards,
Mindaugas

_______________________________________________
Harbour mailing list (attachment size limit: 40KB)
Harbour@harbour-project.org
http://lists.harbour-project.org/mailman/listinfo/harbour

Reply via email to