Dan
Your request posed an interesting challenge. The following program illustrates what will be possible with an updated ClearWin+. It presents a symbol. When you drag this symbol and drop it over a window then an image of that window is copied to the speciified file.
module mymod
use mswin
integer(7) hMain,hStatus
logical mouseDown
contains
integer function find()
integer(7) hOld,hCur
mouseDown = .true.
hCur = SetCursor(LoadResource@('find','Cursor'))
hOld = SetCapture(hMain)
find = 3
end function
integer function export()
integer(7) hThis,hfgrd,hCur
logical L
mouseDown = .false.
L = ReleaseCapture()
hCur = SetCursor(LoadResource@('Arrow','Cursor'))
hThis = WindowAtCursor@(0_3)
hfgrd = GetForegroundWindow()
L = BringWindowToTop(hThis)
iw = export_window_image@(hThis,'image.png',0_3)
L = BringWindowToTop(hfgrd)
call set_status_text@(hStatus, 0, ' Window image saved to image.png')
export = 3
end function
integer function move()
integer pos(2)
character(40) txt
logical L
if(mouseDown)then
L = GetCursorPos(pos)
write(txt, '('(',i4,',',i4,')')') pos
call set_status_text@(hStatus, 0, trim(txt))
else
call set_status_text@(hStatus, 0, 'Drag the symbol to capture a window image')
endif
move = 3
end function
end module mymod
winapp
use mymod
mouseDown = .false.
iw = winio@('%ca[Capture Window Image]&')
iw = winio@('%mg&', WM_LBUTTONDOWN, find)
iw = winio@('%mg&', WM_LBUTTONUP, export)
iw = winio@('%mg&', WM_MOUSEMOVE, move)
iw = winio@('%sb%lc&', hStatus)
iw = winio@('%hw&', hMain)
iw = winio@('%cn%`bm[static]&', LoadResource@('capture','Bitmap'))
iw = winio@('%ff%nl%cn%6bb[Close]')
end
resources
find CURSOR find.cur
capture BITMAP capture.bmp