wndproc function

Do not post support requests, bug reports or feature requests. Discuss CEF here. Non-CEF related discussion goes in General Discussion!

wndproc function

Postby notepadexe » Tue Feb 20, 2018 6:54 pm

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 ?
notepadexe
Techie
 
Posts: 16
Joined: Mon Feb 19, 2018 3:13 pm

Re: wndproc function

Postby magreenblatt » Tue Feb 20, 2018 7:01 pm

You need to do it in the usual way: https://msdn.microsoft.com/en-us/librar ... 83(v=vs.85).aspx
magreenblatt
Site Admin
 
Posts: 12382
Joined: Fri May 29, 2009 6:57 pm

Re: wndproc function

Postby notepadexe » Wed Feb 21, 2018 10:32 am

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 ?
notepadexe
Techie
 
Posts: 16
Joined: Mon Feb 19, 2018 3:13 pm

Re: wndproc function

Postby magreenblatt » Wed Feb 21, 2018 12:00 pm

What are you trying to accomplish?
magreenblatt
Site Admin
 
Posts: 12382
Joined: Fri May 29, 2009 6:57 pm

Re: wndproc function

Postby notepadexe » Wed Feb 21, 2018 12:11 pm

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
notepadexe
Techie
 
Posts: 16
Joined: Mon Feb 19, 2018 3:13 pm

Re: wndproc function

Postby magreenblatt » Wed Feb 21, 2018 12:33 pm

You can see how cefclient handles the subclassing in RootWindowWin::OnSetDraggableRegions: https://bitbucket.org/chromiumembedded/ ... in.cc-1153
magreenblatt
Site Admin
 
Posts: 12382
Joined: Fri May 29, 2009 6:57 pm

Re: wndproc function

Postby notepadexe » Wed Feb 21, 2018 1:11 pm

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?
notepadexe
Techie
 
Posts: 16
Joined: Mon Feb 19, 2018 3:13 pm

Re: wndproc function

Postby magreenblatt » Wed Feb 21, 2018 1:16 pm

You should be able to pass any pointer as the lParam to EnumChildWindows.
magreenblatt
Site Admin
 
Posts: 12382
Joined: Fri May 29, 2009 6:57 pm

Re: wndproc function

Postby notepadexe » Wed Feb 21, 2018 9:04 pm

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 :?
notepadexe
Techie
 
Posts: 16
Joined: Mon Feb 19, 2018 3:13 pm

Re: wndproc function

Postby notepadexe » Wed Feb 28, 2018 11:06 am

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++ ?
notepadexe
Techie
 
Posts: 16
Joined: Mon Feb 19, 2018 3:13 pm


Return to CEF Discussion

Who is online

Users browsing this forum: No registered users and 22 guests

cron