开发者

Bring NSRunAlertPanel Dialogue to Front in Background Process

开发者 https://www.devze.com 2022-12-29 13:21 出处:网络
If you call NSRunAlertPanel() from a background process in Cocoa, the dialogue does not come to the front and instead stays behind other windows.This post shows that you can bring the dialogue to t

If you call

NSRunAlertPanel()

from a background process in Cocoa, the dialogue does not come to the front and instead stays behind other windows. This post shows that you can bring the dialogue to the front if you convert the process to a f开发者_开发知识库oreground process. If you keep the process a background process, however, is there any way to achieve this behavior?


What are you trying to do? Background processes can still display UI and bring themselves to the front without using TransformProcessType; just make sure you are a LSUIElement, not LSBackgroundOnly (or the deprecated NS* equivalents). The only reason you typically need to use TransformProcessType is if you want a Dock icon or menu bar.

0

精彩评论

暂无评论...
验证码 换一张
取 消