Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Size of icon in notification #46

Closed
not-sekiun opened this issue Oct 14, 2018 · 2 comments
Closed

Size of icon in notification #46

not-sekiun opened this issue Oct 14, 2018 · 2 comments

Comments

@not-sekiun
Copy link

When i am displaying an icon in the notification it appears to be quite small no matter what size/resolution icon file i have. Is there a way to make the icon appear bigger in the notification?

@domdfcoding
Copy link

I'd like to know the answer to this too. The example image in the readme shows a larger icon, so I assume it's possible

@robertgr991
Copy link

robertgr991 commented Jul 14, 2019

The size of the icon should be changed from here:

hicon = LoadImage(self.hinst, icon_path, IMAGE_ICON, 0, 0, icon_flags)

The first 0 is the width in pixles, the second 0 is the height in pixels. However, it didn't worked for me so it's not a guarantee that it will work for others, but that's the place where the size should be provided.

You can see more about the parameters of the LoadImage function here: https://docs.microsoft.com/en-us/windows/win32/api/winuser/nf-winuser-loadimagea

Edit:

After trying different things, I noticed that adding a certain flag makes the icon bigger, but I don't know if this is the intended behavior.
To achieve this import the flag:

from win32gui import NIIF_ICON_MASK

Then add it here:

Shell_NotifyIcon(NIM_MODIFY, (self.hwnd, 0, NIF_INFO, WM_USER + 20, hicon, "Balloon Tooltip", msg, 200, title, NIIF_ICON_MASK))

@domdfcoding @angus-y

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

3 participants