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.
精彩评论