Reputation: 3078
Based on this pywin32 based script how can I add a separator/divider to the tray menu menu_options
?
Can I also make the menu pop on left click and not just right click ?
Upvotes: 1
Views: 430
Reputation: 41147
Change the notify function (starting at line #135 in your URL) from:
def notify(self, hwnd, msg, wparam, lparam):
if lparam==win32con.WM_LBUTTONDBLCLK:
self.execute_menu_option(self.default_menu_index + self.FIRST_ID)
elif lparam==win32con.WM_RBUTTONUP:
self.show_menu()
elif lparam==win32con.WM_LBUTTONUP:
pass
return True
to:
def notify(self, hwnd, msg, wparam, lparam):
if lparam == win32con.WM_LBUTTONDBLCLK:
self.execute_menu_option(self.default_menu_index + self.FIRST_ID)
elif lparam in (win32con.WM_RBUTTONUP, win32con.WM_LBUTTONUP):
self.show_menu()
return True
Explanation:
Upvotes: 1