Find centralized, trusted content and collaborate around the technologies you use most.
Teams
Q&A for work
Connect and share knowledge within a single location that is structured and easy to search.
TScreenDelphi 7 中的线程安全吗?
TScreen
TScreen源自TComponent,这就是我想知道的原因。
TComponent
与往常一样,某事是否是线程安全的取决于您想要做的具体事情。仅仅检查一个阶级的祖先是不足以做出判断的。
任何时候从任何线程读取对象的Height和Width属性都是安全的,因为这些属性访问器除了调用API 函数TScreen什么都不做。GetSystemMetrics他们不访问对象的任何数据成员。您可以在Forms.pas中亲自查看。
Height
Width
GetSystemMetrics