943,648 Members | Top Members by Rank

Ad:
  • C++ Discussion Thread
  • Unsolved
  • Views: 812
  • C++ RSS
Oct 11th, 2008
0

RichEdit subclassing problem, can't call Default Proc.

Expand Post »
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):
------------------------------------------------------------------------------------------------------------------
C++ Syntax (Toggle Plain Text)
  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 9:25 am. Reason: add code tags
Reputation Points: 18
Solved Threads: 2
Light Poster
killdude69 is offline Offline
45 posts
since Jul 2008
Oct 11th, 2008
0

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

First call GetWindowLongPtr to get a pointer to its defaultProc then call CallWindowProc() when appropriate. See the GWLP_WNDPROC option.
Sponsor
Team Colleague
Featured Poster
Reputation Points: 5608
Solved Threads: 2282
Retired and Enjoying Life
Ancient Dragon is offline Offline
21,947 posts
since Aug 2005

This thread is more than three months old

No one has posted to this discussion for at least three months. Please let old threads die and do not reply to them unless you feel you have something new and valuable to contribute that absolutely must be added to make the discussion complete. Otherwise, please start a new thread in this forum instead.
Message:
Previous Thread in C++ Forum Timeline: binary to decimal
Next Thread in C++ Forum Timeline: card game: just need to know why its not compiling...





About Us | Contact Us | Advertise | Acceptable Use Policy
Forum Index | Build Custom RSS Feed


Follow us on Twitter


© 2011 DaniWeb® LLC