delphi 10前的好像都不行,最新的版本不知道,case 只能数字或字符,case 0:case1:case 'a':字符串不行,你这个是系统消息,应该有-1,1,0这类信息编号的吧
每个if换成一个case;就这么简单