#NEWLINE# def refresh_icon( self ) : #NEWLINE# #INDENT# hinst = win32gui . GetModuleHandle ( None ) #NEWLINE# if os . path . isfile ( hinst . icon ) : #NEWLINE# #INDENT# icon_flags = ( win32con . LR_LOADFROMFILE | win32con . LR_DEFAULTSIZE ) #NEWLINE# hicon = win32gui . LoadImage ( hinst , self . icon , win32con . IMAGE_ICON , 0 , 0 , icon_flags ) #NEWLINE# #UNINDENT# else : #NEWLINE# #INDENT# print ( "Can't find icon file - using default." ) #NEWLINE# hicon = win32gui . LoadIcon ( 0 , win32con . IDI_APPLICATION ) #NEWLINE# #UNINDENT# if self . notify_id : #NEWLINE# #INDENT# message = win32gui . NIM_MODIFY #NEWLINE# #UNINDENT# else : #NEWLINE# #INDENT# message = win32gui . NIM_ADD #NEWLINE# #UNINDENT# self . notify_id = ( self . hwnd , 0 , ( ( win32gui . NIF_ICON | win32gui . NIF_MESSAGE ) | win32gui . NIF_TIP ) , ( win32con . WM_USER + 20 ) , hicon , self . hover_text ) #NEWLINE# win32gui . Shell_NotifyIcon ( message , self . notify_id )