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

(IMPORTANT) Fixed error- WNDPROC return value cannot be converted to LRESULT Type… #11

Open
wants to merge 1 commit into
base: master
Choose a base branch
from

Commits on Aug 2, 2023

  1. Fixed error- WNDPROC return value cannot be converted to LRESULT Type…

    …Error: WPARAM is simple, so must be an int object (got NoneType)
    
    The error "WNDPROC return value cannot be converted to LRESULT TypeError: WPARAM is simple, so must be an int object (got NoneType)" is occurring because the `on_destroy` method is not returning any value explicitly, and as a result, it returns `None` by default. However, in this case, `on_destroy` should return an integer value (`LRESULT`). To fix the issue, you can add `return 0` at the end of the `on_destroy` method to explicitly return 0.
    
    Here's the modified `on_destroy` method:
    
    ```python
    def on_destroy(self, hwnd, msg, wparam, lparam):
        """Clean after notification ended.
    
        :hwnd:
        :msg:
        :wparam:
        :lparam:
        """
        nid = (self.hwnd, 0)
        Shell_NotifyIcon(NIM_DELETE, nid)
        PostQuitMessage(0)
    
        return 0  # Explicitly return 0 to fix the error
    ```
    
    With this change, the `on_destroy` method will now return an integer value (`LRESULT`) as expected, and the error should be resolved.
    fspofficial authored Aug 2, 2023
    Configuration menu
    Copy the full SHA
    406a6d4 View commit details
    Browse the repository at this point in the history