primo
17-02-2016, 08:38
i refer to the code here http://www.thinbasic.com/community/showthread.php?12390-Tree-Recursion&p=90956&viewfull=1#post90956
which have this code
Randomize
Do
depth = Rnd(8, 10)
Canvas_Clear &HFFFFFF
MainDraw(300, 460, -90, depth)
Canvas_Redraw
Loop While Asc(Canvas_WaitKey) <> 27
it exits okay when we press ESC, but not when we click close button 'X', the thinbasic.exe stay in memory. so if want to keep that Do...Loop how to maneuver to catch the 'X' and exit the program completely
i have tried:
Loop While Asc(Canvas_WaitKey) <> 27 Or IsWindow(hwnd)=TRUE
but still can't exit completely when we click 'X'
which have this code
Randomize
Do
depth = Rnd(8, 10)
Canvas_Clear &HFFFFFF
MainDraw(300, 460, -90, depth)
Canvas_Redraw
Loop While Asc(Canvas_WaitKey) <> 27
it exits okay when we press ESC, but not when we click close button 'X', the thinbasic.exe stay in memory. so if want to keep that Do...Loop how to maneuver to catch the 'X' and exit the program completely
i have tried:
Loop While Asc(Canvas_WaitKey) <> 27 Or IsWindow(hwnd)=TRUE
but still can't exit completely when we click 'X'