Page 1 of 1

wndproc function

PostPosted: Tue Feb 20, 2018 6:54 pm
by notepadexe
I want to quickly ask if there is a quick and simple way to use a custom wndproc func with C API ?

like... Is there a structure I can just give a field the address of my wndproc and it will be done auto or are there manual steps to take to gain control of wndproc with CEF C API ?

Re: wndproc function

PostPosted: Tue Feb 20, 2018 7:01 pm
by magreenblatt
You need to do it in the usual way: https://msdn.microsoft.com/en-us/librar ... 83(v=vs.85).aspx

Re: wndproc function

PostPosted: Wed Feb 21, 2018 10:32 am
by notepadexe
magreenblatt wrote:You need to do it in the usual way: https://msdn.microsoft.com/en-us/librar ... 83(v=vs.85).aspx

Ty

I did try this but it did not work :/ Is there a way to control the wndclass or wndclassex in C API ?

Re: wndproc function

PostPosted: Wed Feb 21, 2018 12:00 pm
by magreenblatt
What are you trying to accomplish?

Re: wndproc function

PostPosted: Wed Feb 21, 2018 12:11 pm
by notepadexe
magreenblatt wrote:What are you trying to accomplish?

movable window using ws_popup style

so I have to use the window procedure to handle WM_NCLBUTTONDOWN

Re: wndproc function

PostPosted: Wed Feb 21, 2018 12:33 pm
by magreenblatt
You can see how cefclient handles the subclassing in RootWindowWin::OnSetDraggableRegions: https://bitbucket.org/chromiumembedded/ ... in.cc-1153

Re: wndproc function

PostPosted: Wed Feb 21, 2018 1:11 pm
by notepadexe
Code: Select all
struct _cef_draggable_region_t dragreg = { 0 };
      dragreg.bounds.width = 200;
      dragreg.bounds.height = 300;
      dragreg.bounds.x = 10;
      dragreg.bounds.y = 10;
      dragreg.draggable = 1;


what cef c api func can be called to pass a pointer of this structure to it for changes to be made for the draggable region info?

Re: wndproc function

PostPosted: Wed Feb 21, 2018 1:16 pm
by magreenblatt
You should be able to pass any pointer as the lParam to EnumChildWindows.

Re: wndproc function

PostPosted: Wed Feb 21, 2018 9:04 pm
by notepadexe
i looked into the link you gave and converted it to a C version. i can verify that it causes my wndproc to be invoked but it does not work properly. the wndproc is only invoked after registration once only and it wont be invoked again... not for the WM_NCHITTEST even once :?

Re: wndproc function

PostPosted: Wed Feb 28, 2018 11:06 am
by notepadexe
magreenblatt wrote:You can see how cefclient handles the subclassing in RootWindowWin::OnSetDraggableRegions: https://bitbucket.org/chromiumembedded/ ... in.cc-1153

How do you actually implement this with the cefsimple with C++ ?