Making a Checkbox Toggle The Dock Icon On and Off

前端 未结 5 882
不思量自难忘°
不思量自难忘° 2021-01-31 06:17

How would I make a checkbox hide the dock icon if it was checked? I have made a checkbox toggle a menubar item but how would you do it with the dock icon? Looking for some code

5条回答
  •  粉色の甜心
    2021-01-31 07:13

    You would want to set up your application as LSUIElement, and then use TransformProcessType to enable the Dock icon. The app will need to be relaunched for the change to take effect. See the Google Quick Search Box project for an example.

提交回复
热议问题