I was looking for something discussed in following posts.
Gap above NSMenuItem custom view.
Reverse engineering an NSMenu for a Status Bar Item
I tried t
Just replace the InstallControlEventHandler function call to HIViewInstallEventHandler and code will work fine.
Thanks