from abc import ABC from typing import final from win32api import GetModuleHandle from win32con import CW_USEDEFAULT, IMAGE_ICON, LR_DEFAULTSIZE, LR_LOADFROMFILE, WM_USER, \ WS_OVERLAPPED, WS_SYSMENU from win32gui import CreateWindow, DestroyWindow, LoadImage, NIF_ICON, NIF_INFO, NIF_MESSAGE, NIF_TIP, NIM_ADD, \ NIM_MODIFY, NIM_DELETE, RegisterClass, Shell_NotifyIcon, UpdateWindow, WNDCLASS from i18n import I18N_RESOURCES _wnd_class = WNDCLASS() _wnd_class.hInstance = GetModuleHandle(None) _wnd_class.lpszClassName = 'Railway Station Simulator' _wnd_class.lpfnWndProc = {} _wnd_class_instance = RegisterClass(_wnd_class) class Notification(ABC): def __init__(self, logger, caption_key, message_key, current_locale, caption_args=(), message_args=()): self.logger = logger self.handler = CreateWindow(_wnd_class_instance, "Taskbar", WS_OVERLAPPED | WS_SYSMENU, 0, 0, CW_USEDEFAULT, CW_USEDEFAULT, 0, 0, _wnd_class.hInstance, None)