From daicaovu at yahoo.com Sun Jun 2 21:06:04 2019 From: daicaovu at yahoo.com (DAI VU) Date: Mon, 3 Jun 2019 01:06:04 +0000 (UTC) Subject: [python-win32] Retrieve Windows Notifications With pywin32 References: <1558605473.2207094.1559523964872.ref@mail.yahoo.com> Message-ID: <1558605473.2207094.1559523964872@mail.yahoo.com> Hi Professionals, I am new to python/pywin32. I have a task to check/retrieve/click on some notifications in the "Action Center" posted by a particular windows app. Can I use python/pywin32 for this? Are there sample codes that I can take a quick look? Also, where can I find the DOC for pywin32? Thank you in advance. David -------------- next part -------------- An HTML attachment was scrubbed... URL: From timr at probo.com Sun Jun 2 23:59:07 2019 From: timr at probo.com (Tim Roberts) Date: Sun, 2 Jun 2019 20:59:07 -0700 Subject: [python-win32] Retrieve Windows Notifications With pywin32 In-Reply-To: <1558605473.2207094.1559523964872@mail.yahoo.com> References: <1558605473.2207094.1559523964872.ref@mail.yahoo.com> <1558605473.2207094.1559523964872@mail.yahoo.com> Message-ID: <8B42587D-B591-49B8-813D-E32A42D4F67E@probo.com> On Jun 2, 2019, at 6:06 PM, DAI VU via python-win32 wrote: > > ]I am new to python/pywin32. I have a task to check/retrieve/click on some notifications in the "Action Center" posted by a particular windows app. Can I use python/pywin32 for this? Are there sample codes that I can take a quick look? Also, where can I find the DOC for pywin32? Well, here is the Microsoft repository of samples related to toast notifications and the action center. The examples are all C# and JavaScript, but they can be translated. https://github.com/Microsoft/Windows-universal-samples/tree/master/Samples/Notifications There are lots of APIs for creating notifications, but I'm not aware of APIs to manipulate and respond to those notifications. Those notifications are there for a reason, and they are expected to be handled by a human user. What kind of notifications are you trying to dismiss? ? Tim Roberts, timr at probo.com Providenza & Boekelheide, Inc. -------------- next part -------------- An HTML attachment was scrubbed... URL: From daicaovu at yahoo.com Wed Jun 5 17:25:46 2019 From: daicaovu at yahoo.com (DAI VU) Date: Wed, 5 Jun 2019 21:25:46 +0000 (UTC) Subject: [python-win32] Retrieve Windows Notifications With pywin32 In-Reply-To: <8B42587D-B591-49B8-813D-E32A42D4F67E@probo.com> References: <1558605473.2207094.1559523964872.ref@mail.yahoo.com> <1558605473.2207094.1559523964872@mail.yahoo.com> <8B42587D-B591-49B8-813D-E32A42D4F67E@probo.com> Message-ID: <407193245.562158.1559769946113@mail.yahoo.com> Hi Tim, Thank you for the response. I need to deal with toast notifications. I am not sure if that answer your question. Regards,David On Sunday, June 2, 2019, 9:05:32 PM PDT, Tim Roberts wrote: On Jun 2, 2019, at 6:06 PM, DAI VU via python-win32 wrote: ]I am new to python/pywin32. I have a task to check/retrieve/click on some notifications in the "Action Center" posted by a particular windows app. Can I use python/pywin32 for this? Are there sample codes that I can take a quick look? Also, where can I find the DOC for pywin32? Well, here is the Microsoft repository of samples related to toast notifications and the action center. ?The examples are all C# and JavaScript, but they can be translated. https://github.com/Microsoft/Windows-universal-samples/tree/master/Samples/Notifications There are lots of APIs for creating notifications, but I'm not aware of APIs to manipulate and respond to those notifications. ?Those notifications are there for a reason, and they are expected to be handled by a human user. ?What kind of notifications are you trying to dismiss??? Tim Roberts, timr at probo.com Providenza & Boekelheide, Inc. _______________________________________________ python-win32 mailing list python-win32 at python.org https://mail.python.org/mailman/listinfo/python-win32 -------------- next part -------------- An HTML attachment was scrubbed... URL: From timr at probo.com Thu Jun 6 02:15:34 2019 From: timr at probo.com (Tim Roberts) Date: Wed, 5 Jun 2019 23:15:34 -0700 Subject: [python-win32] Retrieve Windows Notifications With pywin32 In-Reply-To: <407193245.562158.1559769946113@mail.yahoo.com> References: <1558605473.2207094.1559523964872.ref@mail.yahoo.com> <1558605473.2207094.1559523964872@mail.yahoo.com> <8B42587D-B591-49B8-813D-E32A42D4F67E@probo.com> <407193245.562158.1559769946113@mail.yahoo.com> Message-ID: On Jun 5, 2019, at 2:25 PM, DAI VU wrote: > > Thank you for the response. I need to deal with toast notifications. I am not sure if that answer your question. Well, I was really going for a philosophical point. Most toast notifications are things that the user needs to deal with. There are many things that would be inappropriate for you to dismiss. ? Tim Roberts, timr at probo.com Providenza & Boekelheide, Inc. -------------- next part -------------- An HTML attachment was scrubbed... URL: From jayeshjain0706 at gmail.com Wed Jun 12 10:08:17 2019 From: jayeshjain0706 at gmail.com (Jayesh Jain) Date: Wed, 12 Jun 2019 19:38:17 +0530 Subject: [python-win32] To control commercial software CST through python Message-ID: Hey Max, How did u manage to run the VB scripts to control CST via python Can you help me out with that Thanks and Regards Jayesh Jain From dfh at forestfield.co.uk Tue Jun 18 07:22:59 2019 From: dfh at forestfield.co.uk (David Hughes) Date: Tue, 18 Jun 2019 12:22:59 +0100 Subject: [python-win32] Problem reading a shortcut (.lnk) with cPython 3.7 (32 bit) Message-ID: <288cae79-8ea5-5c20-9c44-bd07f4a769d5@forestfield.co.uk> I'm in the process of upgrading my software from Python 2.7 to 3.7 now that wxPython has been migrated to 3. As part of a procedure for upgrading an end user's own installation I check for it's location via the desktop shortcut that Innosetup created during the original installation. I have a procedure for doing this that worked/works fine with Python 2.7 that is very similar to the one published in /http://timgolden.me.uk/python/win32_how_do_i/read-a-shortcut.html/. Neither mine nor Tim's works under Python 3.7 (I haven't checked any other version of 3). With Tim's version, when the line name, _ = link.GetPath (shell.SLGP_UNCPRIORITY) is executed, after a delay it responds with /aborted (disconnected)/ and the program terminates, as does mine. My knowledge of Python - Win32 interaction is extremely limited so anything anyone can tell me about this would be valuable. -- Regards David Hughes Forestfield Software -------------- next part -------------- An HTML attachment was scrubbed... URL: From timr at probo.com Tue Jun 18 17:38:01 2019 From: timr at probo.com (Tim Roberts) Date: Tue, 18 Jun 2019 14:38:01 -0700 Subject: [python-win32] Problem reading a shortcut (.lnk) with cPython 3.7 (32 bit) In-Reply-To: <288cae79-8ea5-5c20-9c44-bd07f4a769d5@forestfield.co.uk> References: <288cae79-8ea5-5c20-9c44-bd07f4a769d5@forestfield.co.uk> Message-ID: <1e25e337-062d-a27e-4599-e50a7768ee45@probo.com> David Hughes wrote: > > I'm in the process of upgrading my software from Python 2.7 to 3.7 now > that wxPython has been migrated to 3. As part of a procedure for > upgrading an end user's own installation I check for it's location via > the desktop shortcut that Innosetup created during the original > installation. > That's not a particularly good method in the general case.? I don't find much use for the desktop icon, so I suppress it.? You might be better served to use the registry, in HKEY_LOCAL_MACHINE\Software\Python\PythonCore.? 32-bit installations will be in HKEY_LOCAL_MACHINE\Software\WOW6432Node\Python\PythonCore (if you're reading from a 64-bit app). > I have a procedure for doing this that worked/works fine with Python > 2.7 that is very similar to the one published in > /http://timgolden.me.uk/python/win32_how_do_i/read-a-shortcut.html/. > Neither mine nor Tim's works under Python 3.7 (I haven't checked any > other version of 3). With Tim's version, when the line > > ??? name, _ = link.GetPath (shell.SLGP_UNCPRIORITY) > > is executed, after a delay it responds with /aborted (disconnected)/ > and the program terminates, as does mine. > Is it possible you have installed a 32-bit Python on a 64-bit system?? Theoretically, you should be able to use CLSID_ShellLink from either one, but I'm trying to narrow things down.? Tim's code works fine for me with Python 3.7.2 (64 bit) on Windows 10. -- Tim Roberts, timr at probo.com Providenza & Boekelheide, Inc. -------------- next part -------------- A non-text attachment was scrubbed... Name: smime.p7s Type: application/pkcs7-signature Size: 3980 bytes Desc: S/MIME Cryptographic Signature URL: From dfh at forestfield.co.uk Wed Jun 19 10:26:01 2019 From: dfh at forestfield.co.uk (David Hughes) Date: Wed, 19 Jun 2019 15:26:01 +0100 Subject: [python-win32] Problem reading a shortcut (.lnk) with cPython 3.7 (32 bit) In-Reply-To: <1e25e337-062d-a27e-4599-e50a7768ee45@probo.com> References: <288cae79-8ea5-5c20-9c44-bd07f4a769d5@forestfield.co.uk> <1e25e337-062d-a27e-4599-e50a7768ee45@probo.com> Message-ID: <816d6494-bd7f-39b3-41a5-16a5c075819f@forestfield.co.uk> On 18/06/2019 22:38, Tim Roberts wrote: > David Hughes wrote: >> >> I'm in the process of upgrading my software from Python 2.7 to 3.7 >> now that wxPython has been migrated to 3. As part of a procedure for >> upgrading an end user's own installation I check for it's location >> via the desktop shortcut that Innosetup created during the original >> installation. >> > That's not a particularly good method in the general case.? I don't > find much use for the desktop icon, so I suppress it.? You might be > better served to use the registry, in > HKEY_LOCAL_MACHINE\Software\Python\PythonCore.? 32-bit installations > will be in HKEY_LOCAL_MACHINE\Software\WOW6432Node\Python\PythonCore > (if you're reading from a 64-bit app). My apologies, I should have made it clear the shortcut is to the stand-alone executable (py2exe/PyInstaller) version of my own software. >> I have a procedure for doing this that worked/works fine with Python >> 2.7 that is very similar to the one published in >> /http://timgolden.me.uk/python/win32_how_do_i/read-a-shortcut.html/. >> Neither mine nor Tim's works under Python 3.7 (I haven't checked any >> other version of 3). With Tim's version, when the line >> >> ??? name, _ = link.GetPath (shell.SLGP_UNCPRIORITY) >> >> is executed, after a delay it responds with /aborted (disconnected)/ >> and the program terminates, as does mine. >> > Is it possible you have installed a 32-bit Python on a 64-bit system?? > Theoretically, you should be able to use CLSID_ShellLink from either > one, but I'm trying to narrow things down.? Tim's code works fine for > me with Python 3.7.2 (64 bit) on Windows 10. The problem first arose in a 32 bit Python installed on a 64 bit Windows 10 but the same error also occurs with 64 bit Python. However, both of these are virtual environments installed using venv. When I tried Tim's program using the original system-installed Pythons both the 32 and 64 bit versions of 3.7 work fine. Aha! To make the system-installed Pythons work I had to pip install pywin32 and this installed version 224. Both the virtual environments contained pywin32 version 223. After upgrading to version 224 both now work! :)) -- Regards David Hughes Forestfield Software