RSS Forums RSS

RichEdit subclassing problem, can't call Default Proc.

Please support our C++ advertiser: Programming Forums
Reply
Posts: 38
Reputation: killdude69 is an unknown quantity at this point 
Solved Threads: 1
killdude69 killdude69 is offline Offline
Light Poster

RichEdit subclassing problem, can't call Default Proc.

  #1  
Oct 11th, 2008
Hi,

I know how to subclass a RichEdit, and the messages I handle in my procedure work, but I want to know how to call the default procedure that would proccess a non-subclassed RichEdit Control. My problem is that when I subclass it, I want the default Procedure to take care of what my procedure doesn't.

I only handle a context menu and the commands from it, but, I can't use the defaut procedure because I don't know it's name. The RichEdit (RichEdit 3.0) is not doing anything because I can't call the procedure that handles the functionality because I haven't a clue to it's name. The RichEdit doesn't scroll, accept characters, paste, undo, or anything that the default RichEdit procedure should do. How can I go about calling the default procedure?

This is what I have (Not the exact code, just what needs to be seen):
------------------------------------------------------------------------------------------------------------------
  1. // Main Window Procedure
  2. switch(message)
  3. {
  4. case WM_CREATE:
  5. {
  6. // Declare RichEdit: hRichEdit
  7. SetWindowLongPtr(hRichEdit, GWLP_WNDPROC, (LONG_PTR)MyRichEditProc); // This works fine
  8. }
  9. break;
  10. default:
  11. return DefWindowProc(hwnd, message, wParam, lParam);
  12. // End Message Loop
  13.  
  14. // MyRichEditProc
  15. switch(message)
  16. {
  17. case WM_RBUTTONDOWN:
  18. // Show ContextMenu, This works fine
  19. break;
  20. default:
  21. // Here is where I want to call the default RichEdit Procedure, This is where I'm Stuck.
  22. }
  23. // End Proc
;

Can anybody help me out?
Last edited by Ancient Dragon : Oct 11th, 2008 at 8:25 am. Reason: add code tags
AddThis Social Bookmark Button
Reply With Quote  
Posts: 13,885
Reputation: Ancient Dragon has a reputation beyond repute Ancient Dragon has a reputation beyond repute Ancient Dragon has a reputation beyond repute Ancient Dragon has a reputation beyond repute Ancient Dragon has a reputation beyond repute Ancient Dragon has a reputation beyond repute Ancient Dragon has a reputation beyond repute Ancient Dragon has a reputation beyond repute Ancient Dragon has a reputation beyond repute Ancient Dragon has a reputation beyond repute Ancient Dragon has a reputation beyond repute 
Solved Threads: 1231
Moderator
Featured Poster
Ancient Dragon's Avatar
Ancient Dragon Ancient Dragon is online now Online
Most Valuable Poster

Re: RichEdit subclassing problem, can't call Default Proc.

  #2  
Oct 11th, 2008
First call GetWindowLongPtr to get a pointer to its defaultProc then call CallWindowProc() when appropriate. See the GWLP_WNDPROC option.
Reply With Quote  
Reply

Only community members can participate in forum threads. You must register or log in to contribute.



Other Threads in the C++ Forum
Views: 380 | Replies: 1 | Currently Viewing: 1 (0 members and 1 guests)

 

Thread Tools Display Modes
Forums | Blogs | Tutorials | Code Snippets | Whitepapers | RSS Feeds | Advertising
All times are GMT -4. The time now is 3:42 pm.
Newsletter Archive - Sitemap - Privacy Statement - Acceptable Use Policy - Contact Us
Forum system based on vBulletin Copyright ©2000 - 2009, Jelsoft Enterprises Ltd.
©2003 - 2008 DaniWeb® LLC