Thread Rating:
  • 0 Vote(s) - 0 Average
  • 1
  • 2
  • 3
  • 4
  • 5
Ending all threads started by dialog on dialog close/end
#1
In a running QM dialog called "testdialog" I have a button that starts the functions: "StartTestFunction_1" and "StartTestFunction_2"
If I close the dialog "testdialog" I want to close ALL the separate threads started by it. (meaning close/end: "StartTestFunction_1" and "StartTestFunction_2")

I have 2 questions

1) How I do it. Is this correct?  (It works but I need to know if this is correct approach)
Code:
Copy      Help
    case WM_CLOSE
        shutdown -6 0 "StartTestFunction_1"
        shutdown -6 0 "StartTestFunction_2"
    case WM_DESTROY
        shutdown -6 0 "StartTestFunction_1"
        shutdown -6 0 "StartTestFunction_2"

2) Is there a more effective (shorter) way to end ALL threads started through a QM dialog? (must also work in .exe)
#2
Shortest

Macro Macro3196
Code:
Copy      Help
case WM_DESTROY
,EndThread "StartTestFunction_1"
,EndThread "StartTestFunction_2"

Or set a global variable and let threads exit when they see the variable is not 0.
#3
Thank you!


Forum Jump:


Users browsing this thread: 1 Guest(s)