Announcement

Collapse
No announcement yet.

System menu close box

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

  • Lance Edmonds
    replied
    When a dialog is instructed to close, the Callback Function gets a %WM_SYSCOMMAND | %SC_CLOSE message. This occurs whether the dialog is closed via the System Menu, the Close box, or a DIALOG END statement.

    Therefore, if you want to distinguish between your own close routine (that uses DIALOG END) and the System Menu/Close selection, return an appropriate value with the user-defined parameter of the DIALOG END statement. This value is then passed to the calling code.

    Since the system Close menu item will close the dialog without regard to a return value, the dialog will return zero to the calling code.

    Therefore, detecting how the dialog was closed from within the _calling_ code is simply a matter of setting the return value in the callback, and checking the dialog return value.

    Clear as mud?

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

    Leave a comment:


  • Bern Ertl
    started a topic System menu close box

    System menu close box

    Is there any easy way to distinguish when a user clicks the system menu close box (the X in top right of a dialog) versus a DIALOG END hDlg, 0?

    Thanks...


    ------------------
    Bernard Ertl
Working...
X