pythonpython-3.xpywin32viewparams

WNDPROC return value cannot be converted to LRESULT TypeError: WPARAM is simple, so must be an int object (got NoneType)


I was trying to make a simple notification reminder by using a list and a simple input and output error and for the purpose I used the following code expecting notifications following the respective time given but, instead of doing this the code printed the error in the title after the first notification.

myschedule = []

def func():
    import schedule
    import time
    import win10toast


    noti=win10toast.ToastNotifier()

    choice="yes"
    while choice=="yes":
        title=input("enter the title")
        message=input("enter the message")
        tim=input("enter the time")
        ms=[title,message,tim]
        myschedule.append(ms)

        choice = input("enter your choice:")
        if choice == "yes":
            title = input("enter the title")
            message = input("enter the message")
            tim = input("enter the time")
            ms = [title, message, tim]
            myschedule.append(ms)
            choice = input("enter your choice:")


        else:
            pass


    for i in myschedule:

        def functionmaker():
            noti.show_toast(i[0],i[1],duration=12)

        schedule.every().day.at(i[2]).do(functionmaker)

        while True:
            schedule.run_pending()

func()

Solution

  • I came across this error message as well. Looking through the issues on the github page if found this:

    https://github.com/jithurjacob/Windows-10-Toast-Notifications/issues/112

    While it is labeled with python 3.11 it also occurs for me with python 3.8. There is a simple solution, which was already requested to be merged into the project, but was only approved last week. See this link: https://github.com/jithurjacob/Windows-10-Toast-Notifications/pull/115/files/65d312f6015e9f01219fffdd376033eb5c4d5fce

    Since the error message does not block code execution (at least in my case) you could just leave it for the time being and wait until the change is implemented in the latest release.

    As a temporary fix you could change the package code yourself.

    Edit: I noticed that the git repo had no new commits since 2018 so it seems unlikely that the changes will be reflected in the release anytime soon.