简体   繁体   中英

Move window from dock icon to other

In Windows 7 I am moving windows from one group on the taskbar to another (groups are by process id) by changing the System.AppUserModel.ID as seen here: https://msdn.microsoft.com/en-us/library/windows/desktop/dd391569%28v=vs.85%29.aspx

I am now trying to do the same in Mac OS X.

This is a hook for another application so I don't have control over the code, but I am free to run any C code I need to in the hook.

I open a new application with LSUIElement set to 1 so no dock icon (however if I launch it without LSUIElement it does get its own dock icon). So now this has a different process id. I want to move this window into the dock icon of the original application. Is this possible?

My sincerest thanks, I have struggled with this a lot, I researched setCollectionBehavior to no avail. I also looked into the property of dockTile for NSApplication however I couldn't figure out how to setDockTile to that of another PID.

This is not possible. OS X doesn't work like Windows.

The central organizing principle is the application, not the window. Applications are inherently single processes (there can be helpers in separate processes, but that's not reflected in the Dock or Command-Tab application switcher; the helpers generally don't have UI). The Dock shows applications, not window groups or anything like that.

Ownership of windows can't be transferred between applications, either.

The technical post webpages of this site follow the CC BY-SA 4.0 protocol. If you need to reprint, please indicate the site URL or the original address.Any question please contact:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM