Thanks, Paul, for the prompt reply.
You'll see from the code that I've pasted below that I'm a very old-fashioned programmer (a statistician who still writes Fortran code) -- I even occasionally use 'go to's when I'm coding, if I think that it makes the logic easier to follow -- and I don't have any experience with accessing Windows API functions (not explicitly, anyway).
Is it asking too much to have you spend a couple of minutes to make the specific changes that are needed -- eg the appropriate 'include' statement; any 'external' statement; and the form of the call to FindWindow at statement 200 -- so that the code will run.
Many thanks
Norm
subroutine v3D_query_example ( )
use mod_1_control
include <windows.ins>
integer*2 n_TextW_szeX, n_TextW_szeY, n_TextW_posnX, n_TextW_posnY
n_TextW_szeX = 215
n_TextW_szeY = 150
n_TextW_posnX = m_wndw_1_width
n_TextW_posnY = m_wndw_1_height
c m_wndw_1_width, *.height, wndw_Caption set in mod_1_control
nTHandle = Create_Window@ ( wndw_Caption,
1 n_TextW_posnX, n_TextW_posnY,
2 n_TextW_szeX, n_TextW_szeY )
call Open_to_Window@ ( 8, nTHandle )
c motionpassive ( mouse_X, mouse_Y ) used to update mouse X,Y
nCmse_X = mouse_X
nCmse_Y = mouse_Y
100 call yield_program_control@ ( y_temporarily )
nmse_X = mouse_X
nmse_Y = mouse_Y
if ( nmse_X .ne. nCmse_X .or. nmse_Y .ne. nCmse_Y ) go to 200
nCmse_X = nmse_X
nCmse_Y = nmse_Y
go to 100
200 if ( nmse_X .ge. m_wndw_1_width - 15 .and. nmse_Y .le. 15 )
1 go to 300
c exit loop if mouse in top-right corner -- pseudo close button
c want to change code to monitor window status to 'go to 300' if nTHandle window is closed
nCmse_X = nmse_X
nCmse_Y = nmse_Y
X_val = nmse_X
Y_val = nmse_Y
call Clear_Window@ ( nTHandle )
write ( 8, '( a, '' : '', i8 )' ) 'X value', nmse_X
write ( 8, '( a, '' : '', i8 )' ) 'Y value', nmse_Y
go to 100
300 call Destroy_Window@ ( nTHandle )
nTHandle = 0
return
end