Thread: Window Procedure Question

  1. #1
    Join Date
    Jan 2003
    Knoxville, Tn

    Question Window Procedure Question

    I have a window procdeure that I'm replacing for a RichEdit control.
    Everything seems to work accept for sending hot key messages to
    the parent window. Could someone take a look at my procedure
    to see if they spot the problem?

    Here's the window procedure:
    LRESULT WINAPI RichEditProc(HWND hwnd, UINT uMsg, WPARAM wParam, LPARAM lParam)
        case WM_RBUTTONUP:
          return 0;
        case WM_DESTROY:
          SetWindowLong(hwnd, GWL_WNDPROC, (DWORD) wpOrigProc);
          RemoveProp(hwnd, "oldproc");
      return CallWindowProc(wpOrigProc, hwnd, uMsg, wParam, lParam);
    This procedure is in a dll and it is not a normal Windows dll. It's
    written for Visual DialogScript. I'm thinking the LRESULT WINAPI
    could bw wrong, might need to be LRESULT PASCAL but I don't
    know for sure.

    I should mention what I mean about hot-keys. I mean, for example,
    the keys assigned to a menu item.
    Thanks in advance,

  2. #2
    Registered User
    Join Date
    Feb 2002
    Shouldn't it be "LRESULT CALLBACK"?

  3. #3
    mustang benny bennyandthejets's Avatar
    Join Date
    Jul 2002
    knutso's right, but that probably wont change anything. shino, could you clarify a few things?

    1. what is eventproc?
    2. How is removeprop important in this context?
    3. just a tip, you dont have to reset the window procedure when the windows about to be destroyed.
    4. Why dont you just use a normal windows dll?

    If you want to send accelerator messages to the parent window, thats easy. when you receive the message in WM_COMMAND, just SendMessage to GetParent with the same ID. but im not sure if thats what you're after.
    Microsoft Visual Studio .NET 2003 Enterprise Architect
    Windows XP Pro

    Code Tags
    Programming FAQ

  4. #4
    Join Date
    Jan 2003
    Knoxville, Tn
    Thanks for everyones input. lol, sorry I figured it out. Forgot to
    initialize the common controls dll. duh!

    But to go ahead and answer BennyandtheJets questions:
    1) eventproc() sends the specified event to an application
    written with Visual DialogScript. VDS only supports generic
    controls. This dll will add a RichEdit control to the VDS

    2)RemoveProp() was removed.
    3)Thanks for the tip.
    4)In order to use a regular windows dll I'd have to make a
    "gateway" or "wrapper" dll for it to be utilized by the VDS

    As far as LRESULT CALLBACK goes, again, this isn't a regular dll.
    I'm just replacing the window procedure for this control, not the
    window procedure for the application that's calling the dll.

    Anyway, thanks again.

Popular pages Recent additions subscribe to a feed

Similar Threads

  1. WM_CAPTION causing CreateWindowEx() to fail.
    By Necrofear in forum Windows Programming
    Replies: 8
    Last Post: 04-06-2007, 08:23 AM
  2. creating a child window
    By rakan in forum Windows Programming
    Replies: 2
    Last Post: 01-23-2007, 03:22 PM
  3. input/output
    By dogbert234 in forum Windows Programming
    Replies: 11
    Last Post: 01-26-2005, 06:57 AM
  4. question about a window
    By Alsij in forum Windows Programming
    Replies: 5
    Last Post: 08-12-2004, 11:30 PM
  5. my wndProc is out of scope
    By Raison in forum Windows Programming
    Replies: 35
    Last Post: 06-25-2004, 07:23 AM