delphi byte to of set

最佳方案

type
  // Controls.TCMMouseWheel relies on TShiftState not exceeding 2 bytes in size 
  TShiftState = set of (ssShift, ssAlt, ssCtrl,
                        ssLeft, ssRight, ssMiddle, 
                        ssDouble, ssTouch, ssPen, 
                        ssCommand, ssHorizontal); 

var 
  Shifts : TShiftState;
  Value :  Integer;
begin
  Shifts := TShiftState((Pointer(@Value))^):

  Value  := (PInteger(@Shifts))^;

  if ssShift in TShiftState((Pointer(@Value))^) then 
     Exit;
end;




https://stackoverflow.com/questions/9553510/how-to-save-load-set-of-types
https://stackoverflow.com/questions/4092796/enumerate-possible-set-values-in-delphi
来源
原文地址:https://www.cnblogs.com/marklove/p/8686621.html