In looking at the sequencing of the REASON returns using a small test program, it would appear that the WINDOW_MOVEMENT starts first, then, WINDOW_STARTUP is processed before WINDOW_MOVEMENT is finished. I discovered this by adding a PRINT statement in the routine, and rather than the CALLBACK_REASON being on two separate lines, they appeared on one line.
Using /SAVE to make sure local variables are static, I added an increment/decrement following the I/O statement. This shows that the WINDOW_STARTUP is executed before the WINDOW_MOVEMENT can finish. I post the code below.
Does this imply that these handlers need to be re-entrant? Or, am I looking at something wrong?
winapp
integer i
integer,external:: start_window
print *,'Started'
i = winio@('%ww%sc%mvHello There%bt[done]',start_window,start_window)
end
integer function start_window()
use mswin
integer:: i=0
i = i+1
print *,trim(clearwin_string@('CALLBACK_REASON')),i
start_window = 1
i = i - 1
return
end