Anyone know a way (preferably easy) to disable hotkeys when a window is hidden?
I had thought about the windows got focus and lost focus messages.
If that would work then I know how to add the hot keys but I don't know how to delete them (that table they are in).
Reading code in the sdk doesn't make a whole lot of sense to me.
Any help would be appreciated.
LarryMc
think I've got it working okay just by using set focus at the appropriate places.
still open to any other ideas though.
LarryMc
Larry, try to save the "_ACCEL_TABLE" propery in OnHide event, set it to NULL, and later restore the property in OnShow handler.
sub handler ...
case WM_SHOWWINDOW
if @WPARAM then OnShow(*<WINDOW>@HITWINDOW) else OnHide(*<WINDOW>@HITWINDOW)
...
endsub
sub OnHide(WINDOW w)
HANDLE acc = GetProp(w.hWnd, "_ACCEL_TABLE")
if (acc)
SetProp(w.hWnd, "_ACCEL_SAVE", acc)
SetProp(w.hWnd, "_ACCEL_TABLE", 0)
endif
endsub
sub OnShow(WINDOW win) ' call me from OnDestroy
HANDLE acc = GetProp(w.hWnd, "_ACCEL_SAVE")
if (acc)
RemoveProp(w.hWnd, "_ACCEL_SAVE")
SetProp(w.hWnd, "_ACCEL_TABLE", acc)
endif
endsub
thanks Sapero