Skip to content
  • Categories
  • Recent
  • Tags
  • Popular
  • World
  • Users
  • Groups
Skins
  • Light
  • Cerulean
  • Cosmo
  • Flatly
  • Journal
  • Litera
  • Lumen
  • Lux
  • Materia
  • Minty
  • Morph
  • Pulse
  • Sandstone
  • Simplex
  • Sketchy
  • Spacelab
  • United
  • Yeti
  • Zephyr
  • Dark
  • Cyborg
  • Darkly
  • Quartz
  • Slate
  • Solar
  • Superhero
  • Vapor

  • Default (No Skin)
  • No Skin
Collapse
Code Project
  1. Home
  2. General Programming
  3. C / C++ / MFC
  4. SetDlgMsgResult

SetDlgMsgResult

Scheduled Pinned Locked Moved C / C++ / MFC
tutorialquestionperformancehelp
6 Posts 2 Posters 0 Views 1 Watching
  • Oldest to Newest
  • Newest to Oldest
  • Most Votes
Reply
  • Reply as topic
Log in to reply
This topic has been deleted. Only users with topic management privileges can see it.
  • N Offline
    N Offline
    NicholasCougar
    wrote on last edited by
    #1

    Hi, How to use the function SetDlgMsgResult ? The follows are an example, but I can't understand their meaning,

    #define adgHANDLE\_DLGMSG(hwnd, message, fn)
    case (message): return (SetDlgMsgResult(hwnd, uMsg,
    HANDLE\_##message((hwnd), (wParam), (lParam), (fn))))
    

    Jeffrey Richter said: The normal HANDLE_MSG macro in WINDOWSX.H does not work properly for dialog boxes because DlgProc's return a BOOL instead of an LRESULT (like WndProcs). This adgHANDLE_DLGMSG macro corrects the problem. My Question is, the parameter list in SetDlgMsgResult(HWND hwnd, int msg, LONG result) puzzles me. Which parameter replaces which parameter, and where does this action take place, in memory of window? Thank you. Best regard. One concrete prolem is worth a thousand unapplied abstractions.

    N 1 Reply Last reply
    0
    • N NicholasCougar

      Hi, How to use the function SetDlgMsgResult ? The follows are an example, but I can't understand their meaning,

      #define adgHANDLE\_DLGMSG(hwnd, message, fn)
      case (message): return (SetDlgMsgResult(hwnd, uMsg,
      HANDLE\_##message((hwnd), (wParam), (lParam), (fn))))
      

      Jeffrey Richter said: The normal HANDLE_MSG macro in WINDOWSX.H does not work properly for dialog boxes because DlgProc's return a BOOL instead of an LRESULT (like WndProcs). This adgHANDLE_DLGMSG macro corrects the problem. My Question is, the parameter list in SetDlgMsgResult(HWND hwnd, int msg, LONG result) puzzles me. Which parameter replaces which parameter, and where does this action take place, in memory of window? Thank you. Best regard. One concrete prolem is worth a thousand unapplied abstractions.

      N Offline
      N Offline
      Nish Nishant
      wrote on last edited by
      #2

      There is no API or MFC call named SetDlgMsgResult. SetDlgMsgResult seems to be one of Richter's custom functions too :-) Nish


      Regards, Nish Native CPian. Born and brought up on CP. With the CP blood in him.

      N 1 Reply Last reply
      0
      • N Nish Nishant

        There is no API or MFC call named SetDlgMsgResult. SetDlgMsgResult seems to be one of Richter's custom functions too :-) Nish


        Regards, Nish Native CPian. Born and brought up on CP. With the CP blood in him.

        N Offline
        N Offline
        NicholasCougar
        wrote on last edited by
        #3

        Hi, Nish [BusterBoy] wrote: There is no API or MFC call named SetDlgMsgResult. SetDlgMsgResult seems to be one of Richter's custom functions too Following words are copied from MSDN. I have to declare that I've installed SDK in my system. SetDlgMsgResult This macro maps to the SetWindowLong function.

        SetDlgMsgResult (
        HWND hwnd,
        int msg,
        LONG result );

        Parameters hwnd: Handle to the dialog box. msg:Specifies the zero-based offset to the value to be set. Valid values are in the range zero through the number of bytes of extra window memory, minus four. result:Specifies the replacement value. In my point of view, the value of parameter result is used to set the parameter msg. But set value in this way(set to an zero-based offset) is strange to me. I want thorough understanding of this function. Thank you, Best regard. One concrete prolem is worth a thousand unapplied abstractions.

        N 1 Reply Last reply
        0
        • N NicholasCougar

          Hi, Nish [BusterBoy] wrote: There is no API or MFC call named SetDlgMsgResult. SetDlgMsgResult seems to be one of Richter's custom functions too Following words are copied from MSDN. I have to declare that I've installed SDK in my system. SetDlgMsgResult This macro maps to the SetWindowLong function.

          SetDlgMsgResult (
          HWND hwnd,
          int msg,
          LONG result );

          Parameters hwnd: Handle to the dialog box. msg:Specifies the zero-based offset to the value to be set. Valid values are in the range zero through the number of bytes of extra window memory, minus four. result:Specifies the replacement value. In my point of view, the value of parameter result is used to set the parameter msg. But set value in this way(set to an zero-based offset) is strange to me. I want thorough understanding of this function. Thank you, Best regard. One concrete prolem is worth a thousand unapplied abstractions.

          N Offline
          N Offline
          Nish Nishant
          wrote on last edited by
          #4

          Oh sorry! :-) My MSDN must be really old :-) Nish


          Regards, Nish Native CPian. Born and brought up on CP. With the CP blood in him.

          N 1 Reply Last reply
          0
          • N Nish Nishant

            Oh sorry! :-) My MSDN must be really old :-) Nish


            Regards, Nish Native CPian. Born and brought up on CP. With the CP blood in him.

            N Offline
            N Offline
            NicholasCougar
            wrote on last edited by
            #5

            Hi, I have checked the preface of this book. It's named Window95, a developer's guide written by Jeffrey before 1997. It's a Win32 SDK programming guide which includes several key techniques such as subclassing and superclassing, hooking etc. Best regard. One concrete prolem is worth a thousand unapplied abstractions.

            N 1 Reply Last reply
            0
            • N NicholasCougar

              Hi, I have checked the preface of this book. It's named Window95, a developer's guide written by Jeffrey before 1997. It's a Win32 SDK programming guide which includes several key techniques such as subclassing and superclassing, hooking etc. Best regard. One concrete prolem is worth a thousand unapplied abstractions.

              N Offline
              N Offline
              Nish Nishant
              wrote on last edited by
              #6

              Thanks for the info Nicholas :-) Nish


              Regards, Nish Native CPian. Born and brought up on CP. With the CP blood in him.

              1 Reply Last reply
              0
              Reply
              • Reply as topic
              Log in to reply
              • Oldest to Newest
              • Newest to Oldest
              • Most Votes


              • Login

              • Don't have an account? Register

              • Login or register to search.
              • First post
                Last post
              0
              • Categories
              • Recent
              • Tags
              • Popular
              • World
              • Users
              • Groups