Announcement

Collapse
No announcement yet.

Simple $%@! Dialog ?

Collapse
X
 
  • Filter
  • Time
  • Show
Clear All
new posts

  • Simple $%@! Dialog ?

    I'm getting Frustrated!

    Calmly----
    I want to send message to a dialog from inside the
    WndProc function.

    1)How ?
    2)How do you get the Dialog handle when you only know the ID?

    Thanks---- I love this forum B

    ------------------

  • #2
    Dialogs use handles, not ID's. Controls have both a handle and an ID.

    When you use DIALOG NEW... TO hDlg& then hDlg& is the dialog window handle. If you are doing this from the dialog's own callback, then use CBHNDL.

    To send a message, use CONTROL SEND, DIALOG SEND or the API functions SendMessage() and PostMessage().
    ie:
    Code:
    ' DDT callback pseudocode
    CALLBACK FUNCTION DlgCB
      SELECT CASE CBMSG
        CASE %WM_COMMAND
          IF CBCTL = %ID_BUTTON AND CBCTLMSG = %BN_CLICKED THEN
            DIALOG SEND CBHNDL, %WM_USER + 999&, wparam&, lparam&
          END IF
        CASE %WM_USER + 999&
          ...
      END SELECT
    END FUNCTION

    ------------------
    Lance
    PowerBASIC Support
    mailto:[email protected][email protected]</A>
    Lance
    mailto:[email protected]

    Comment


    • #3
      Thanks for response Lance

      I guess I shouldn't ask questions when I'm frustrated,
      I'll clairfy question in a minute-----B

      ------------------

      Comment


      • #4
        Ok--------
        I understand---The handle is defined upon creation of Dlg
        I was trying to give the handle an ID

        Thanks B.

        ------------------

        Comment


        • #5
          Slightly off-topic...

          I notice, Lance, that you addressed the question on the assumption Mr. Byrne was using 'DDT' to create the dialog.

          When I read it, I assumed it was 'SDK' style.

          It might help for anyone asking questions here about GUI concerns to specify (if not obvious) which technique is in use...

          MCM
          Michael Mattias
          Tal Systems (retired)
          Port Washington WI USA
          m[email protected]
          http://www.talsystems.com

          Comment


          • #6
            Your right Mike

            I was just going to add that--- But Lance replyed perfectly
            before I my post was written


            ------------------

            Comment

            Working...
            X