IFolderView COM client#2181
Merged
mhammond merged 2 commits intomhammond:mainfrom Feb 20, 2024
Merged
Conversation
Merged
ed402bd to
aed3d05
Compare
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
I was trying to correct [SO]: How to move desktop icons with python? (@CristiFati's answer), based on [SO]: How to move desktop icons using winapi on C? (@@IInspectable's answer) (which in turn is based on Raymond Chen's [MS.DevBlogs]: Manipulating the positions of desktop icons). All good till at one of the last steps:
which failed because IFolderView is not wrapped by win32comext/shell/shell.pyd. So I investigated what needs to be done in order to add it, and found out about MakeGW. Unfortunately that seems no longer maintained (worked on a side quest: #2180), and the generated files need lots of interventions, so I (temporarily) abandoned this track.
Looking for alternatives (based on [SO]: Implementing a COM interface in Python (@@SimonMourier's answer)), I defined the interface and implementation in Python (using COMTypes), and do all kinds of attempts to register it with PythonCom (call functions from PyCom_RegisterClientType family in pythoncom310.dll), but I wasn;t successful, so I returned to the original approach.
Coming back to the 1st option, after modifying the script generator, and the generated code, I was able to get it working.
Notes:
But functionally, it's complete as the 2 missing methods can be worked around others.