Paul,
Linking the spin wheel 'grey state' to that of the %rd box (or indeed %rs) seems to me to be logical, and I find it difficult to imagine a situation where one would grey-out the %rd (so that its contents could not be altered) while allowing the spin wheel to be active (so that the contents of the %rd box *could *be altered), so as far as I am concerned, this is progress, although I suspect that the views of others need to be solicited.
Is perhaps the 'middle ground' to have an optional linkage with something like: %dd[link_grey] ... ? I'm not sufficiently knowledgeable to be able to identify any other controls that could usefully be linked in this way.
I had a go with your suggestion about finding the handle of the %dd, viz:
WINAPP
integer i,winio@,ctrl,n,SET_GREY,iHWDC,jHWDC
common ctrl,iHWDC,jHWDC
external SET_GREY
include <windows.ins>
ctrl=0
n=50
i=winio@('%il%dd%~rd%lc&',0,100,1,n,ctrl,iHWDC)
jHWDC=GetWindow (iHWDC, GW_HWNDNEXT)
i=winio@('%ff%nl%cn%^bt[Toggle] %bt[Quit]',SET_GREY)
end
integer function SET_GREY()
logical grey, done
integer ctrl,iHWDC,jHWDC
common ctrl,iHWDC,jHWDC
include <windows.ins>
jHWDC=GetWindow (iHWDC, GW_HWNDNEXT)
CTRL = IABS(CTRL-1)
grey = CTRL .EQ. 1
done = EnableWindow (jHWDC,grey)
C write(*,*) ctrl,grey,done
SET_GREY=1
END
... and this caught the button 'Toggle' as the next control. I also tried GW_HWNDPREV to no effect.
My workaround was to have a variable containing a copy of the value, and in the callback (i.e. using %^rd) to check the grey state, and if greyed-out, restore the original value.
Regards
Eddie