-
-
Notifications
You must be signed in to change notification settings - Fork 100
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
[client\_events.py] Use WinDLL/OleDLL instead of windll/oledll #758
Merged
Conversation
This file contains 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
I pulled this change to my local environment and tested triggering Excel events. It seems to be working properly. >>> from comtypes import client
>>> xl = client.CreateObject("Excel.Application")
>>> xl.Visible = True
>>> client.PumpEvents(30)
>>> conn = client.ShowEvents(xl)
# event found: AppEvents_NewWorkbook
# event found: AppEvents_SheetSelectionChange
# event found: AppEvents_SheetBeforeDoubleClick
# event found: AppEvents_SheetBeforeRightClick
# event found: AppEvents_SheetActivate
# event found: AppEvents_SheetDeactivate
# event found: AppEvents_SheetCalculate
# event found: AppEvents_SheetChange
# event found: AppEvents_WorkbookOpen
# event found: AppEvents_WorkbookActivate
# event found: AppEvents_WorkbookDeactivate
# event found: AppEvents_WorkbookBeforeClose
# event found: AppEvents_WorkbookBeforeSave
# event found: AppEvents_WorkbookBeforePrint
# event found: AppEvents_WorkbookNewSheet
# event found: AppEvents_WorkbookAddinInstall
# event found: AppEvents_WorkbookAddinUninstall
# event found: AppEvents_WindowResize
# event found: AppEvents_WindowActivate
# event found: AppEvents_WindowDeactivate
# event found: AppEvents_SheetFollowHyperlink
# event found: AppEvents_SheetPivotTableUpdate
# event found: AppEvents_WorkbookPivotTableCloseConnection
# event found: AppEvents_WorkbookPivotTableOpenConnection
# event found: AppEvents_WorkbookSync
# event found: AppEvents_WorkbookBeforeXmlImport
# event found: AppEvents_WorkbookAfterXmlImport
# event found: AppEvents_WorkbookBeforeXmlExport
# event found: AppEvents_WorkbookAfterXmlExport
# event found: AppEvents_WorkbookRowsetComplete
# event found: AppEvents_AfterCalculate
# event found: AppEvents_SheetPivotTableAfterValueChange
# event found: AppEvents_SheetPivotTableBeforeAllocateChanges
# event found: AppEvents_SheetPivotTableBeforeCommitChanges
# event found: AppEvents_SheetPivotTableBeforeDiscardChanges
# event found: AppEvents_ProtectedViewWindowOpen
# event found: AppEvents_ProtectedViewWindowBeforeEdit
# event found: AppEvents_ProtectedViewWindowBeforeClose
# event found: AppEvents_ProtectedViewWindowResize
# event found: AppEvents_ProtectedViewWindowActivate
# event found: AppEvents_ProtectedViewWindowDeactivate
# event found: AppEvents_WorkbookAfterSave
# event found: AppEvents_WorkbookNewChart
# event found: AppEvents_SheetLensGalleryRenderComplete
# event found: AppEvents_SheetTableUpdate
# event found: AppEvents_WorkbookModelChange
# event found: AppEvents_SheetBeforeDelete
# event found: AppEvents_WorkbookBeforeRemoteChange
# event found: AppEvents_WorkbookAfterRemoteChange
# event found: AppEvents_RemoteSheetChange
# event found: AppEvents_RemoteWorkbookNewSheet
# event found: AppEvents_RemoteWorkbookNewChart
# event found: AppEvents_RemoteSheetBeforeDelete
# event found: AppEvents_RemoteSheetPivotTableUpdate
>>> client.PumpEvents(10)
Event AppEvents_WindowResize(None, <POINTER(_Workbook) ptr=0x26e782cd528 at 26e791483d0>, <POINTER(Window) ptr=0x26e782cd838 at 26e791482d0>)
Event AppEvents_SheetSelectionChange(None, <POINTER(_Worksheet) ptr=0x26e77f831b8 at 26e791485d0>, <POINTER(Range) ptr=0x26e77f83bc8 at 26e791481d0>)
Event AppEvents_SheetSelectionChange(None, <POINTER(_Worksheet) ptr=0x26e764aa8c8 at 26e791484d0>, <POINTER(Range) ptr=0x26e764aa548 at 26e791482d0>)
Event AppEvents_NewWorkbook(None, <POINTER(_Workbook) ptr=0x26e78233bb8 at 26e79148450>)
Event AppEvents_WindowDeactivate(None, <POINTER(_Workbook) ptr=0x26e764aa938 at 26e791483d0>, <POINTER(Window) ptr=0x26e764aa4d8 at 26e791485d0>)
Event AppEvents_WorkbookDeactivate(None, <POINTER(_Workbook) ptr=0x26e782345c8 at 26e79148650>)
Event AppEvents_WorkbookActivate(None, <POINTER(_Workbook) ptr=0x26e764aa158 at 26e791484d0>)
Event AppEvents_WindowActivate(None, <POINTER(_Workbook) ptr=0x26e78233ec8 at 26e79148150>, <POINTER(Window) ptr=0x26e78234788 at 26e791483d0>) |
junkmd
reviewed
Jan 25, 2025
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Thanks!
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.
See #735