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.
我正在编写一个应用程序,它从本地计算机的默认打印机的纸张比率中获取其尺寸。除非默认打印机通过 VPN,否则这一切都很好。在这种情况下,调用 GetDefaultPrinter() 需要很长时间。我需要找到一种方法来对 GetDefaultPrinter() 施加时间约束,如果它超过了该约束,则退出该函数。
任何可能的解决方案都会很棒。
谢谢,
伊恩
将这种功能放入单独的线程中是否可以接受?