├── .clang-format ├── .editorconfig ├── .git-blame-ignore-revs ├── .gitattributes ├── .github ├── ISSUE_TEMPLATE │ ├── config.yml │ └── issue_template.md └── workflows │ ├── docs.yml │ ├── download-arm64-libs.py │ ├── install-vs-components.py │ └── main.yml ├── .gitignore ├── .hgeol ├── .pre-commit-config.yaml ├── AutoDuck ├── BuildHHP.py ├── Dump2HHC.py ├── InsertExternalOverviews.py ├── README.md ├── TOCToHHK.py ├── bin │ ├── autoduck.exe │ └── autoduck.fmt ├── common.mak ├── common_top.mak ├── document_object.py ├── fixHelpCompression.py ├── make.py ├── makedfromi.py ├── py2d.py ├── pyhtml.fmt ├── pythonwin.fmt ├── pywin32-document.xml └── pywin32.mak ├── CHANGES.txt ├── Pythonwin ├── License.txt ├── Scintilla │ ├── License.txt │ ├── README │ ├── README_pythonwin │ ├── include │ │ ├── ILexer.h │ │ ├── ILoader.h │ │ ├── Platform.h │ │ ├── SciLexer.h │ │ ├── Sci_Position.h │ │ ├── Scintilla.h │ │ ├── Scintilla.iface │ │ └── ScintillaWidget.h │ ├── lexers │ │ ├── LexA68k.cxx │ │ ├── LexAPDL.cxx │ │ ├── LexASY.cxx │ │ ├── LexAU3.cxx │ │ ├── LexAVE.cxx │ │ ├── LexAVS.cxx │ │ ├── LexAbaqus.cxx │ │ ├── LexAda.cxx │ │ ├── LexAsm.cxx │ │ ├── LexAsn1.cxx │ │ ├── LexBaan.cxx │ │ ├── LexBash.cxx │ │ ├── LexBasic.cxx │ │ ├── LexBatch.cxx │ │ ├── LexBibTeX.cxx │ │ ├── LexBullant.cxx │ │ ├── LexCIL.cxx │ │ ├── LexCLW.cxx │ │ ├── LexCOBOL.cxx │ │ ├── LexCPP.cxx │ │ ├── LexCSS.cxx │ │ ├── LexCaml.cxx │ │ ├── LexCmake.cxx │ │ ├── LexCoffeeScript.cxx │ │ ├── LexConf.cxx │ │ ├── LexCrontab.cxx │ │ ├── LexCsound.cxx │ │ ├── LexD.cxx │ │ ├── LexDMAP.cxx │ │ ├── LexDMIS.cxx │ │ ├── LexDataflex.cxx │ │ ├── LexDiff.cxx │ │ ├── LexECL.cxx │ │ ├── LexEDIFACT.cxx │ │ ├── LexEScript.cxx │ │ ├── LexEiffel.cxx │ │ ├── LexErlang.cxx │ │ ├── LexErrorList.cxx │ │ ├── LexFlagship.cxx │ │ ├── LexForth.cxx │ │ ├── LexFortran.cxx │ │ ├── LexGAP.cxx │ │ ├── LexGui4Cli.cxx │ │ ├── LexHTML.cxx │ │ ├── LexHaskell.cxx │ │ ├── LexHex.cxx │ │ ├── LexHollywood.cxx │ │ ├── LexIndent.cxx │ │ ├── LexInno.cxx │ │ ├── LexJSON.cxx │ │ ├── LexKVIrc.cxx │ │ ├── LexKix.cxx │ │ ├── LexLaTeX.cxx │ │ ├── LexLisp.cxx │ │ ├── LexLout.cxx │ │ ├── LexLua.cxx │ │ ├── LexMMIXAL.cxx │ │ ├── LexMPT.cxx │ │ ├── LexMSSQL.cxx │ │ ├── LexMagik.cxx │ │ ├── LexMake.cxx │ │ ├── LexMarkdown.cxx │ │ ├── LexMatlab.cxx │ │ ├── LexMaxima.cxx │ │ ├── LexMetapost.cxx │ │ ├── LexModula.cxx │ │ ├── LexMySQL.cxx │ │ ├── LexNim.cxx │ │ ├── LexNimrod.cxx │ │ ├── LexNsis.cxx │ │ ├── LexNull.cxx │ │ ├── LexOScript.cxx │ │ ├── LexOpal.cxx │ │ ├── LexPB.cxx │ │ ├── LexPLM.cxx │ │ ├── LexPO.cxx │ │ ├── LexPOV.cxx │ │ ├── LexPS.cxx │ │ ├── LexPascal.cxx │ │ ├── LexPerl.cxx │ │ ├── LexPowerPro.cxx │ │ ├── LexPowerShell.cxx │ │ ├── LexProgress.cxx │ │ ├── LexProps.cxx │ │ ├── LexPython.cxx │ │ ├── LexR.cxx │ │ ├── LexRaku.cxx │ │ ├── LexRebol.cxx │ │ ├── LexRegistry.cxx │ │ ├── LexRuby.cxx │ │ ├── LexRust.cxx │ │ ├── LexSAS.cxx │ │ ├── LexSML.cxx │ │ ├── LexSQL.cxx │ │ ├── LexSTTXT.cxx │ │ ├── LexScriptol.cxx │ │ ├── LexSmalltalk.cxx │ │ ├── LexSorcus.cxx │ │ ├── LexSpecman.cxx │ │ ├── LexSpice.cxx │ │ ├── LexStata.cxx │ │ ├── LexTACL.cxx │ │ ├── LexTADS3.cxx │ │ ├── LexTAL.cxx │ │ ├── LexTCL.cxx │ │ ├── LexTCMD.cxx │ │ ├── LexTeX.cxx │ │ ├── LexTxt2tags.cxx │ │ ├── LexVB.cxx │ │ ├── LexVHDL.cxx │ │ ├── LexVerilog.cxx │ │ ├── LexVisualProlog.cxx │ │ ├── LexX12.cxx │ │ └── LexYAML.cxx │ ├── lexlib │ │ ├── Accessor.cxx │ │ ├── Accessor.h │ │ ├── CatalogueModules.h │ │ ├── CharacterCategory.cxx │ │ ├── CharacterCategory.h │ │ ├── CharacterSet.cxx │ │ ├── CharacterSet.h │ │ ├── DefaultLexer.cxx │ │ ├── DefaultLexer.h │ │ ├── LexAccessor.h │ │ ├── LexerBase.cxx │ │ ├── LexerBase.h │ │ ├── LexerModule.cxx │ │ ├── LexerModule.h │ │ ├── LexerNoExceptions.cxx │ │ ├── LexerNoExceptions.h │ │ ├── LexerSimple.cxx │ │ ├── LexerSimple.h │ │ ├── OptionSet.h │ │ ├── PropSetSimple.cxx │ │ ├── PropSetSimple.h │ │ ├── SparseState.h │ │ ├── StringCopy.h │ │ ├── StyleContext.cxx │ │ ├── StyleContext.h │ │ ├── SubStyles.h │ │ ├── WordList.cxx │ │ └── WordList.h │ ├── makefile_pythonwin │ ├── src │ │ ├── AutoComplete.cxx │ │ ├── AutoComplete.h │ │ ├── CallTip.cxx │ │ ├── CallTip.h │ │ ├── CaseConvert.cxx │ │ ├── CaseConvert.h │ │ ├── CaseFolder.cxx │ │ ├── CaseFolder.h │ │ ├── Catalogue.cxx │ │ ├── Catalogue.h │ │ ├── CellBuffer.cxx │ │ ├── CellBuffer.h │ │ ├── CharClassify.cxx │ │ ├── CharClassify.h │ │ ├── ContractionState.cxx │ │ ├── ContractionState.h │ │ ├── DBCS.cxx │ │ ├── DBCS.h │ │ ├── Decoration.cxx │ │ ├── Decoration.h │ │ ├── Document.cxx │ │ ├── Document.h │ │ ├── EditModel.cxx │ │ ├── EditModel.h │ │ ├── EditView.cxx │ │ ├── EditView.h │ │ ├── Editor.cxx │ │ ├── Editor.h │ │ ├── ElapsedPeriod.h │ │ ├── ExternalLexer.cxx │ │ ├── ExternalLexer.h │ │ ├── FontQuality.h │ │ ├── Indicator.cxx │ │ ├── Indicator.h │ │ ├── IntegerRectangle.h │ │ ├── KeyMap.cxx │ │ ├── KeyMap.h │ │ ├── LineMarker.cxx │ │ ├── LineMarker.h │ │ ├── MarginView.cxx │ │ ├── MarginView.h │ │ ├── Partitioning.h │ │ ├── PerLine.cxx │ │ ├── PerLine.h │ │ ├── Position.h │ │ ├── PositionCache.cxx │ │ ├── PositionCache.h │ │ ├── RESearch.cxx │ │ ├── RESearch.h │ │ ├── RunStyles.cxx │ │ ├── RunStyles.h │ │ ├── SciTE.properties │ │ ├── ScintillaBase.cxx │ │ ├── ScintillaBase.h │ │ ├── Selection.cxx │ │ ├── Selection.h │ │ ├── SparseVector.h │ │ ├── SplitVector.h │ │ ├── Style.cxx │ │ ├── Style.h │ │ ├── UniConversion.cxx │ │ ├── UniConversion.h │ │ ├── UniqueString.cxx │ │ ├── UniqueString.h │ │ ├── ViewStyle.cxx │ │ ├── ViewStyle.h │ │ ├── XPM.cxx │ │ └── XPM.h │ └── win32 │ │ ├── DepGen.py │ │ ├── HanjaDic.cxx │ │ ├── HanjaDic.h │ │ ├── PlatWin.cxx │ │ ├── PlatWin.h │ │ ├── SciLexer.vcxproj │ │ ├── SciTE.properties │ │ ├── ScintRes.rc │ │ ├── Scintilla.def │ │ ├── Scintilla.vcxproj │ │ ├── ScintillaDLL.cxx │ │ ├── ScintillaWin.cxx │ │ ├── ScintillaWin.h │ │ ├── deps.mak │ │ ├── makefile │ │ ├── nmdeps.mak │ │ └── scintilla.mak ├── Win32app.h ├── Win32uiHostGlue.h ├── contents.d ├── dbgthread.cpp ├── ddeconv.cpp ├── ddeitem.cpp ├── ddemodule.cpp ├── ddemodule.h ├── ddeserver.cpp ├── ddetopic.cpp ├── dibapi.cpp ├── dibapi.h ├── dllmain.cpp ├── doc │ ├── EmbeddingWin32ui.html │ ├── architecture.html │ ├── debugger │ │ ├── general.html │ │ ├── index.html │ │ ├── postmortem.gif │ │ ├── probs.html │ │ ├── pythonwin.gif │ │ ├── tut1.gif │ │ ├── tutbp1.gif │ │ └── tutorial.html │ ├── docview.html │ ├── guienvironment.html │ └── pythonwin.gif ├── pythonRichEdit.cpp ├── pythonRichEdit.h ├── pythonRichEditCntr.cpp ├── pythonRichEditCntr.h ├── pythonRichEditDoc.cpp ├── pythonRichEditDoc.h ├── pythoncbar.h ├── pythondoc.cpp ├── pythondoc.h ├── pythonframe.h ├── pythonppage.cpp ├── pythonppage.h ├── pythonpsheet.cpp ├── pythonpsheet.h ├── pythonview.cpp ├── pythonview.h ├── pythonwin.cpp ├── pythonwin.h ├── pythonwin.rc ├── pywin │ ├── Demos │ │ ├── app │ │ │ ├── basictimerapp.py │ │ │ ├── customprint.py │ │ │ ├── demoutils.py │ │ │ ├── dlgappdemo.py │ │ │ ├── dojobapp.py │ │ │ ├── helloapp.py │ │ │ └── readme.txt │ │ ├── cmdserver.py │ │ ├── createwin.py │ │ ├── demoutils.py │ │ ├── dibdemo.py │ │ ├── dlgtest.py │ │ ├── dyndlg.py │ │ ├── fontdemo.py │ │ ├── guidemo.py │ │ ├── hiertest.py │ │ ├── menutest.py │ │ ├── objdoc.py │ │ ├── ocx │ │ │ ├── demoutils.py │ │ │ ├── flash.py │ │ │ ├── msoffice.py │ │ │ ├── ocxserialtest.py │ │ │ ├── ocxtest.py │ │ │ └── webbrowser.py │ │ ├── openGLDemo.py │ │ ├── progressbar.py │ │ ├── readme.txt │ │ ├── sliderdemo.py │ │ ├── splittst.py │ │ ├── threadedgui.py │ │ └── toolbar.py │ ├── IDLE.cfg │ ├── __init__.py │ ├── debugger │ │ ├── __init__.py │ │ ├── configui.py │ │ ├── dbgcon.py │ │ ├── dbgpyapp.py │ │ ├── debugger.py │ │ └── fail.py │ ├── default.cfg │ ├── dialogs │ │ ├── __init__.py │ │ ├── ideoptions.py │ │ ├── list.py │ │ ├── login.py │ │ └── status.py │ ├── docking │ │ ├── DockingBar.py │ │ └── __init__.py │ ├── framework │ │ ├── __init__.py │ │ ├── app.py │ │ ├── bitmap.py │ │ ├── cmdline.py │ │ ├── dbgcommands.py │ │ ├── dlgappcore.py │ │ ├── editor │ │ │ ├── ModuleBrowser.py │ │ │ ├── __init__.py │ │ │ ├── color │ │ │ │ ├── __init__.py │ │ │ │ └── coloreditor.py │ │ │ ├── configui.py │ │ │ ├── document.py │ │ │ ├── editor.py │ │ │ ├── frame.py │ │ │ ├── template.py │ │ │ └── vss.py │ │ ├── help.py │ │ ├── interact.py │ │ ├── intpyapp.py │ │ ├── intpydde.py │ │ ├── scriptutils.py │ │ ├── sgrepmdi.py │ │ ├── startup.py │ │ ├── stdin.py │ │ ├── toolmenu.py │ │ ├── window.py │ │ └── winout.py │ ├── idle │ │ ├── AutoExpand.py │ │ ├── AutoIndent.py │ │ ├── CallTips.py │ │ ├── FormatParagraph.py │ │ ├── IdleHistory.py │ │ ├── PyParse.py │ │ ├── __init__.py │ │ └── readme.txt │ ├── mfc │ │ ├── __init__.py │ │ ├── activex.py │ │ ├── afxres.py │ │ ├── dialog.py │ │ ├── docview.py │ │ ├── object.py │ │ ├── thread.py │ │ └── window.py │ ├── scintilla │ │ ├── IDLEenvironment.py │ │ ├── __init__.py │ │ ├── bindings.py │ │ ├── config.py │ │ ├── configui.py │ │ ├── control.py │ │ ├── document.py │ │ ├── find.py │ │ ├── formatter.py │ │ ├── keycodes.py │ │ ├── scintillacon.py │ │ └── view.py │ ├── test │ │ ├── _dbgscript.py │ │ ├── _exetestscript.py │ │ ├── all.py │ │ ├── test_exe.py │ │ └── test_pywin.py │ └── tools │ │ ├── TraceCollector.py │ │ ├── __init__.py │ │ ├── browseProjects.py │ │ ├── browser.py │ │ ├── hierlist.py │ │ ├── regedit.py │ │ └── regpy.py ├── readme.html ├── res │ ├── BROWSER.BMP │ ├── HIERFOLD.BMP │ ├── ICO00002.ICO │ ├── IDR_MAIN.ICO │ ├── IDR_PYTH.ICO │ ├── PADDOC.ICO │ ├── debugger.ico │ ├── debugger_stack.bmp │ ├── pyc.ico │ ├── pycon.ico │ ├── temp.BMP │ ├── toolbar.bmp │ └── toolbar_debugger.bmp ├── respw.h ├── reswin32ui.h ├── start_pythonwin.pyw ├── stdafx.cpp ├── stdafx.h ├── stdafxdde.h ├── stdafxole.cpp ├── stdafxole.h ├── stdafxpw.cpp ├── stdafxpw.h ├── stddde.cpp ├── win32ImageList.cpp ├── win32ImageList.h ├── win32RichEdit.cpp ├── win32RichEdit.h ├── win32RichEditDocTemplate.cpp ├── win32RichEditDocTemplate.h ├── win32app.cpp ├── win32assoc.cpp ├── win32assoc.h ├── win32bitmap.cpp ├── win32bitmap.h ├── win32brush.cpp ├── win32brush.h ├── win32cmd.cpp ├── win32cmd.h ├── win32cmdui.cpp ├── win32cmdui.h ├── win32context.cpp ├── win32control.cpp ├── win32control.h ├── win32ctledit.cpp ├── win32ctrlList.cpp ├── win32ctrlList.h ├── win32ctrlRichEdit.cpp ├── win32ctrlTree.cpp ├── win32ctrlTree.h ├── win32dc.cpp ├── win32dc.h ├── win32dlg.cpp ├── win32dlg.h ├── win32dlgbar.cpp ├── win32dlgbar.h ├── win32dll.cpp ├── win32dll.h ├── win32doc.cpp ├── win32doc.h ├── win32font.cpp ├── win32font.h ├── win32gdi.cpp ├── win32gdi.h ├── win32hl.h ├── win32menu.cpp ├── win32menu.h ├── win32notify.cpp ├── win32oleDlgInsert.cpp ├── win32oleDlgs.cpp ├── win32oleDlgs.h ├── win32pen.cpp ├── win32pen.h ├── win32prinfo.cpp ├── win32prinfo.h ├── win32prop.cpp ├── win32prop.h ├── win32rgn.cpp ├── win32rgn.h ├── win32splitter.cpp ├── win32splitter.h ├── win32template.cpp ├── win32template.h ├── win32thread.cpp ├── win32toolbar.cpp ├── win32toolbar.h ├── win32tooltip.cpp ├── win32ui.h ├── win32ui.rc ├── win32uiExt.h ├── win32uimodule.cpp ├── win32uiole.cpp ├── win32uioleClientItem.cpp ├── win32uioledoc.cpp ├── win32uioledoc.h ├── win32util.cpp ├── win32view.cpp ├── win32virt.cpp ├── win32win.cpp └── win32win.h ├── README.md ├── SWIG ├── pywin32_swig.patch ├── readme.txt ├── swig.exe └── swig_lib │ ├── array.i │ ├── autodoc.i │ ├── carray.i │ ├── constraints.i │ ├── ctype.i │ ├── exception.i │ ├── malloc.i │ ├── math.i │ ├── memory.i │ ├── objc.i │ ├── pointer.i │ ├── python │ ├── defarg.swg │ ├── embed.i │ ├── embed13.i │ ├── embed14.i │ ├── ptrlang.i │ ├── pyexp.swg │ ├── python.swg │ ├── pythoncom.i │ ├── pywin32.i │ ├── pywintypes.i │ └── typemaps.i │ ├── stdlib.i │ ├── swigptr.swg │ └── timers.i ├── adodbapi ├── __init__.py ├── ado_consts.py ├── adodbapi.py ├── apibase.py ├── examples │ ├── db_print.py │ ├── db_table_names.py │ ├── test.mdb │ ├── xls_read.py │ └── xls_write.py ├── is64bit.py ├── license.txt ├── process_connect_string.py ├── quick_reference.md ├── readme.txt ├── schema_table.py ├── setup.py └── test │ ├── RunTests.bat │ ├── adodbapitest.py │ ├── adodbapitestconfig.py │ ├── dbapi20.py │ ├── is64bit.py │ ├── setuptestframework.py │ ├── test_adodbapi_dbapi20.py │ └── tryconnection.py ├── build_env.md ├── com ├── License.txt ├── TestSources │ ├── PyCOMTest │ │ ├── ArrayTest.rgs │ │ ├── Connect.cpp │ │ ├── Connect.def │ │ ├── Connect.rc │ │ ├── DSCArrayTest.cpp │ │ ├── DSCArrayTest.h │ │ ├── PyCOMImpl.cpp │ │ ├── PyCOMImpl.h │ │ ├── PyCOMTest.dsp │ │ ├── PyCOMTest.dsw │ │ ├── PyCOMTest.idl │ │ ├── PyCOMTest.rgs │ │ ├── PyCOMTest.sln │ │ ├── PyCOMTest.vcxproj │ │ ├── SimpleCounter.cpp │ │ ├── SimpleCounter.h │ │ ├── buildAndRegister.bat │ │ ├── connres.h │ │ ├── preconn.cpp │ │ └── preconn.h │ └── PyCOMVBTest │ │ ├── EnumerableCollection.cls │ │ ├── IPyComTestInterface.cls │ │ ├── PyCOMVBTest.vbp │ │ ├── PyComTestImplementation.cls │ │ ├── TestModule.bas │ │ ├── Tester.cls │ │ └── VBTest.vbp ├── changes.txt ├── help │ ├── active_directory.html │ ├── adsi.html │ ├── asp.d │ ├── cpp.d │ ├── mts.d │ └── shell.d ├── pythoncom.py ├── win32com │ ├── HTML │ │ ├── COM_Records.html │ │ ├── GeneratedSupport.html │ │ ├── PythonCOM.html │ │ ├── QuickStartClientCom.html │ │ ├── QuickStartServerCom.html │ │ ├── docindex.html │ │ ├── image │ │ │ ├── BTN_HomePage.gif │ │ │ ├── BTN_ManualTop.gif │ │ │ ├── BTN_NextPage.gif │ │ │ ├── BTN_PrevPage.gif │ │ │ ├── blank.gif │ │ │ ├── pycom_blowing.gif │ │ │ ├── pythoncom.gif │ │ │ └── www_icon.gif │ │ ├── index.html │ │ ├── misc.html │ │ ├── package.html │ │ └── variant.html │ ├── __init__.py │ ├── changes.txt │ ├── client │ │ ├── CLSIDToClass.py │ │ ├── __init__.py │ │ ├── build.py │ │ ├── combrowse.py │ │ ├── connect.py │ │ ├── dynamic.py │ │ ├── gencache.py │ │ ├── genpy.py │ │ ├── makepy.py │ │ ├── selecttlb.py │ │ ├── tlbrowse.py │ │ └── util.py │ ├── demos │ │ ├── __init__.py │ │ ├── connect.py │ │ ├── dump_clipboard.py │ │ ├── eventsApartmentThreaded.py │ │ ├── eventsFreeThreaded.py │ │ ├── excelAddin.py │ │ ├── excelRTDServer.py │ │ ├── iebutton.py │ │ ├── ietoolbar.py │ │ ├── outlookAddin.py │ │ └── trybag.py │ ├── makegw │ │ ├── __init__.py │ │ ├── makegw.py │ │ ├── makegwenum.py │ │ └── makegwparse.py │ ├── olectl.py │ ├── readme.html │ ├── server │ │ ├── __init__.py │ │ ├── connect.py │ │ ├── dispatcher.py │ │ ├── exception.py │ │ ├── factory.py │ │ ├── localserver.py │ │ ├── policy.py │ │ ├── register.py │ │ └── util.py │ ├── servers │ │ ├── PythonTools.py │ │ ├── __init__.py │ │ ├── dictionary.py │ │ ├── interp.py │ │ ├── perfmon.py │ │ └── test_pycomtest.py │ ├── src │ │ ├── ErrorUtils.cpp │ │ ├── MiscTypes.cpp │ │ ├── PyComHelpers.cpp │ │ ├── PyFactory.cpp │ │ ├── PyGatewayBase.cpp │ │ ├── PyIBase.cpp │ │ ├── PyIClassFactory.cpp │ │ ├── PyIDispatch.cpp │ │ ├── PyIUnknown.cpp │ │ ├── PyRecord.cpp │ │ ├── PyStorage.cpp │ │ ├── PythonCOM.cpp │ │ ├── PythonCOM.def │ │ ├── PythonCOMLoader.cpp │ │ ├── PythonCOMLoader.def │ │ ├── Register.cpp │ │ ├── dllmain.cpp │ │ ├── extensions │ │ │ ├── PyFUNCDESC.cpp │ │ │ ├── PyGConnectionPoint.cpp │ │ │ ├── PyGConnectionPointContainer.cpp │ │ │ ├── PyGEnumVariant.cpp │ │ │ ├── PyGErrorLog.cpp │ │ │ ├── PyGPersist.cpp │ │ │ ├── PyGPersistPropertyBag.cpp │ │ │ ├── PyGPersistStorage.cpp │ │ │ ├── PyGPersistStream.cpp │ │ │ ├── PyGPersistStreamInit.cpp │ │ │ ├── PyGPropertyBag.cpp │ │ │ ├── PyGStream.cpp │ │ │ ├── PyIBindCtx.cpp │ │ │ ├── PyICancelMethodCalls.cpp │ │ │ ├── PyICatInformation.cpp │ │ │ ├── PyICatRegister.cpp │ │ │ ├── PyIClientSecurity.cpp │ │ │ ├── PyIConnectionPoint.cpp │ │ │ ├── PyIConnectionPointContainer.cpp │ │ │ ├── PyIContext.cpp │ │ │ ├── PyICreateTypeInfo.cpp │ │ │ ├── PyICreateTypeLib.cpp │ │ │ ├── PyICreateTypeLib2.cpp │ │ │ ├── PyIDataObject.cpp │ │ │ ├── PyIDropSource.cpp │ │ │ ├── PyIDropTarget.cpp │ │ │ ├── PyIEnumCATEGORYINFO.cpp │ │ │ ├── PyIEnumConnectionPoints.cpp │ │ │ ├── PyIEnumConnections.cpp │ │ │ ├── PyIEnumContextProps.cpp │ │ │ ├── PyIEnumFORMATETC.cpp │ │ │ ├── PyIEnumGUID.cpp │ │ │ ├── PyIEnumSTATPROPSETSTG.cpp │ │ │ ├── PyIEnumSTATPROPSTG.cpp │ │ │ ├── PyIEnumSTATSTG.cpp │ │ │ ├── PyIEnumString.cpp │ │ │ ├── PyIEnumVARIANT.cpp │ │ │ ├── PyIErrorLog.cpp │ │ │ ├── PyIExternalConnection.cpp │ │ │ ├── PyIGlobalInterfaceTable.cpp │ │ │ ├── PyILockBytes.cpp │ │ │ ├── PyIMoniker.cpp │ │ │ ├── PyIOleWindow.cpp │ │ │ ├── PyIPersist.cpp │ │ │ ├── PyIPersistFile.cpp │ │ │ ├── PyIPersistPropertyBag.cpp │ │ │ ├── PyIPersistStorage.cpp │ │ │ ├── PyIPersistStream.cpp │ │ │ ├── PyIPersistStreamInit.cpp │ │ │ ├── PyIPropertyBag.cpp │ │ │ ├── PyIPropertySetStorage.cpp │ │ │ ├── PyIPropertyStorage.cpp │ │ │ ├── PyIProvideClassInfo.cpp │ │ │ ├── PyIRunningObjectTable.cpp │ │ │ ├── PyIServerSecurity.cpp │ │ │ ├── PyIServiceProvider.cpp │ │ │ ├── PyIStorage.cpp │ │ │ ├── PyIStream.cpp │ │ │ ├── PyIType.cpp │ │ │ ├── PyITypeObjects.cpp │ │ │ ├── PySTGMEDIUM.cpp │ │ │ ├── PyTYPEATTR.cpp │ │ │ └── PyVARDESC.cpp │ │ ├── include │ │ │ ├── PyComTypeObjects.h │ │ │ ├── PyFactory.h │ │ │ ├── PyGConnectionPoint.h │ │ │ ├── PyGConnectionPointContainer.h │ │ │ ├── PyGPersistStorage.h │ │ │ ├── PyIBindCtx.h │ │ │ ├── PyICancelMethodCalls.h │ │ │ ├── PyICatInformation.h │ │ │ ├── PyICatRegister.h │ │ │ ├── PyIClientSecurity.h │ │ │ ├── PyIConnectionPoint.h │ │ │ ├── PyIConnectionPointContainer.h │ │ │ ├── PyIContext.h │ │ │ ├── PyICreateTypeInfo.h │ │ │ ├── PyICreateTypeLib.h │ │ │ ├── PyIDataObject.h │ │ │ ├── PyIDropSource.h │ │ │ ├── PyIDropTarget.h │ │ │ ├── PyIEnumConnectionPoints.h │ │ │ ├── PyIEnumConnections.h │ │ │ ├── PyIEnumContextProps.h │ │ │ ├── PyIEnumFORMATETC.h │ │ │ ├── PyIEnumGUID.h │ │ │ ├── PyIEnumSTATPROPSETSTG.h │ │ │ ├── PyIEnumSTATPROPSTG.h │ │ │ ├── PyIEnumSTATSTG.h │ │ │ ├── PyIEnumString.h │ │ │ ├── PyIEnumVARIANT.h │ │ │ ├── PyIExternalConnection.h │ │ │ ├── PyIGlobalInterfaceTable.h │ │ │ ├── PyILockBytes.h │ │ │ ├── PyIMoniker.h │ │ │ ├── PyIOleWindow.h │ │ │ ├── PyIPersist.h │ │ │ ├── PyIPersistFile.h │ │ │ ├── PyIPersistStorage.h │ │ │ ├── PyIPersistStream.h │ │ │ ├── PyIPersistStreamInit.h │ │ │ ├── PyIPropertySetStorage.h │ │ │ ├── PyIPropertyStorage.h │ │ │ ├── PyIRunningObjectTable.h │ │ │ ├── PyIServerSecurity.h │ │ │ ├── PyIServiceProvider.h │ │ │ ├── PyIStorage.h │ │ │ ├── PyIStream.h │ │ │ ├── PyRecord.h │ │ │ ├── PythonCOM.h │ │ │ ├── PythonCOMRegister.h │ │ │ ├── PythonCOMServer.h │ │ │ ├── propbag.h │ │ │ ├── stdafx.h │ │ │ └── univgw_dataconv.h │ │ ├── oleargs.cpp │ │ ├── stdafx.cpp │ │ ├── univgw.cpp │ │ └── univgw_dataconv.cpp │ ├── storagecon.py │ ├── test │ │ ├── GenTestScripts.py │ │ ├── Testpys.sct │ │ ├── __init__.py │ │ ├── daodump.py │ │ ├── errorSemantics.py │ │ ├── pippo.idl │ │ ├── pippo_server.py │ │ ├── policySemantics.py │ │ ├── readme.txt │ │ ├── testADOEvents.py │ │ ├── testAXScript.py │ │ ├── testAccess.py │ │ ├── testArrays.py │ │ ├── testClipboard.py │ │ ├── testCollections.py │ │ ├── testConversionErrors.py │ │ ├── testDCOM.py │ │ ├── testDates.py │ │ ├── testDictionary.py │ │ ├── testDictionary.vbs │ │ ├── testDynamic.py │ │ ├── testExchange.py │ │ ├── testExplorer.py │ │ ├── testGIT.py │ │ ├── testGatewayAddresses.py │ │ ├── testInterp.vbs │ │ ├── testIterators.py │ │ ├── testMSOffice.py │ │ ├── testMSOfficeEvents.py │ │ ├── testMarshal.py │ │ ├── testPersist.py │ │ ├── testPippo.py │ │ ├── testPyComTest.py │ │ ├── testPyScriptlet.js │ │ ├── testROT.py │ │ ├── testServers.py │ │ ├── testShell.py │ │ ├── testStorage.py │ │ ├── testStreams.py │ │ ├── testWMI.py │ │ ├── testall.py │ │ ├── testmakepy.py │ │ ├── testvb.py │ │ ├── testvbscript_regexp.py │ │ ├── testxslt.js │ │ ├── testxslt.py │ │ ├── testxslt.xsl │ │ └── util.py │ ├── universal.py │ └── util.py └── win32comext │ ├── adsi │ ├── __init__.py │ ├── adsicon.py │ ├── demos │ │ ├── objectPicker.py │ │ ├── scp.py │ │ ├── search.py │ │ └── test.py │ └── src │ │ ├── PyADSIUtil.cpp │ │ ├── PyADSIUtil.h │ │ ├── PyDSOPObjects.cpp │ │ ├── PyIADs.cpp │ │ ├── PyIADs.h │ │ ├── PyIADsContainer.i │ │ ├── PyIADsDeleteOps.i │ │ ├── PyIADsUser.i │ │ ├── PyIDirectoryObject.i │ │ ├── PyIDirectorySearch.i │ │ ├── PyIDsObjectPicker.i │ │ ├── adsi.i │ │ └── adsilib.i │ ├── authorization │ ├── __init__.py │ ├── demos │ │ ├── EditSecurity.py │ │ └── EditServiceSecurity.py │ └── src │ │ ├── PyGSecurityInformation.cpp │ │ ├── PyGSecurityInformation.h │ │ └── authorization.cpp │ ├── axcontrol │ ├── __init__.py │ ├── demos │ │ └── container_ie.py │ └── src │ │ ├── AXControl.cpp │ │ ├── PyIObjectWithSite.cpp │ │ ├── PyIObjectWithSite.h │ │ ├── PyIOleClientSite.cpp │ │ ├── PyIOleClientSite.h │ │ ├── PyIOleCommandTarget.cpp │ │ ├── PyIOleCommandTarget.h │ │ ├── PyIOleControl.cpp │ │ ├── PyIOleControl.h │ │ ├── PyIOleControlSite.cpp │ │ ├── PyIOleControlSite.h │ │ ├── PyIOleInPlaceActiveObject.cpp │ │ ├── PyIOleInPlaceActiveObject.h │ │ ├── PyIOleInPlaceFrame.cpp │ │ ├── PyIOleInPlaceFrame.h │ │ ├── PyIOleInPlaceObject.cpp │ │ ├── PyIOleInPlaceObject.h │ │ ├── PyIOleInPlaceSite.cpp │ │ ├── PyIOleInPlaceSite.h │ │ ├── PyIOleInPlaceSiteEx.cpp │ │ ├── PyIOleInPlaceSiteEx.h │ │ ├── PyIOleInPlaceSiteWindowless.cpp │ │ ├── PyIOleInPlaceSiteWindowless.h │ │ ├── PyIOleInPlaceUIWindow.cpp │ │ ├── PyIOleInPlaceUIWindow.h │ │ ├── PyIOleObject.cpp │ │ ├── PyIOleObject.h │ │ ├── PyISpecifyPropertyPages.cpp │ │ ├── PyISpecifyPropertyPages.h │ │ ├── PyIViewObject.cpp │ │ ├── PyIViewObject.h │ │ ├── PyIViewObject2.cpp │ │ ├── PyIViewObject2.h │ │ └── axcontrol_pch.h │ ├── axdebug │ ├── Test │ │ ├── host.py │ │ └── ttest.py │ ├── __init__.py │ ├── adb.py │ ├── codecontainer.py │ ├── contexts.py │ ├── debugger.py │ ├── documents.py │ ├── dump.py │ ├── expressions.py │ ├── gateways.py │ ├── src │ │ ├── AXDebug.cpp │ │ ├── PyIActiveScriptDebug.cpp │ │ ├── PyIActiveScriptDebug.h │ │ ├── PyIActiveScriptErrorDebug.cpp │ │ ├── PyIActiveScriptErrorDebug.h │ │ ├── PyIActiveScriptSiteDebug.cpp │ │ ├── PyIActiveScriptSiteDebug.h │ │ ├── PyIApplicationDebugger.cpp │ │ ├── PyIApplicationDebugger.h │ │ ├── PyIDebugApplication.cpp │ │ ├── PyIDebugApplication.h │ │ ├── PyIDebugApplicationNode.cpp │ │ ├── PyIDebugApplicationNode.h │ │ ├── PyIDebugApplicationNodeEvents.cpp │ │ ├── PyIDebugApplicationNodeEvents.h │ │ ├── PyIDebugApplicationThread.cpp │ │ ├── PyIDebugApplicationThread.h │ │ ├── PyIDebugCodeContext.cpp │ │ ├── PyIDebugCodeContext.h │ │ ├── PyIDebugDocument.cpp │ │ ├── PyIDebugDocument.h │ │ ├── PyIDebugDocumentContext.cpp │ │ ├── PyIDebugDocumentContext.h │ │ ├── PyIDebugDocumentHelper.cpp │ │ ├── PyIDebugDocumentHelper.h │ │ ├── PyIDebugDocumentHost.cpp │ │ ├── PyIDebugDocumentHost.h │ │ ├── PyIDebugDocumentInfo.cpp │ │ ├── PyIDebugDocumentInfo.h │ │ ├── PyIDebugDocumentProvider.cpp │ │ ├── PyIDebugDocumentProvider.h │ │ ├── PyIDebugDocumentText.cpp │ │ ├── PyIDebugDocumentText.h │ │ ├── PyIDebugDocumentTextAuthor.cpp │ │ ├── PyIDebugDocumentTextAuthor.h │ │ ├── PyIDebugDocumentTextEvents.cpp │ │ ├── PyIDebugDocumentTextEvents.h │ │ ├── PyIDebugDocumentTextExternalAuthor.cpp │ │ ├── PyIDebugDocumentTextExternalAuthor.h │ │ ├── PyIDebugExpression.cpp │ │ ├── PyIDebugExpression.h │ │ ├── PyIDebugExpressionCallBack.cpp │ │ ├── PyIDebugExpressionCallBack.h │ │ ├── PyIDebugExpressionContext.cpp │ │ ├── PyIDebugExpressionContext.h │ │ ├── PyIDebugProperties.cpp │ │ ├── PyIDebugProperties.h │ │ ├── PyIDebugSessionProvider.cpp │ │ ├── PyIDebugSessionProvider.h │ │ ├── PyIDebugStackFrame.cpp │ │ ├── PyIDebugStackFrame.h │ │ ├── PyIDebugStackFrameSniffer.cpp │ │ ├── PyIDebugStackFrameSniffer.h │ │ ├── PyIDebugStackFrameSnifferEx.cpp │ │ ├── PyIDebugStackFrameSnifferEx.h │ │ ├── PyIDebugSyncOperation.cpp │ │ ├── PyIDebugSyncOperation.h │ │ ├── PyIEnumDebugApplicationNodes.cpp │ │ ├── PyIEnumDebugApplicationNodes.h │ │ ├── PyIEnumDebugCodeContexts.cpp │ │ ├── PyIEnumDebugCodeContexts.h │ │ ├── PyIEnumDebugExpressionContexts.cpp │ │ ├── PyIEnumDebugExpressionContexts.h │ │ ├── PyIEnumDebugPropertyInfo.cpp │ │ ├── PyIEnumDebugPropertyInfo.h │ │ ├── PyIEnumDebugStackFrames.cpp │ │ ├── PyIEnumDebugStackFrames.h │ │ ├── PyIEnumRemoteDebugApplicationThreads.cpp │ │ ├── PyIEnumRemoteDebugApplicationThreads.h │ │ ├── PyIEnumRemoteDebugApplications.cpp │ │ ├── PyIEnumRemoteDebugApplications.h │ │ ├── PyIMachineDebugManager.cpp │ │ ├── PyIMachineDebugManager.h │ │ ├── PyIMachineDebugManagerEvents.cpp │ │ ├── PyIMachineDebugManagerEvents.h │ │ ├── PyIProcessDebugManager.cpp │ │ ├── PyIProcessDebugManager.h │ │ ├── PyIProvideExpressionContexts.cpp │ │ ├── PyIProvideExpressionContexts.h │ │ ├── PyIRemoteDebugApplication.cpp │ │ ├── PyIRemoteDebugApplication.h │ │ ├── PyIRemoteDebugApplicationEvents.cpp │ │ ├── PyIRemoteDebugApplicationEvents.h │ │ ├── PyIRemoteDebugApplicationThread.cpp │ │ ├── PyIRemoteDebugApplicationThread.h │ │ ├── stdafx.cpp │ │ └── stdafx.h │ ├── stackframe.py │ └── util.py │ ├── axscript │ ├── __init__.py │ ├── asputil.py │ ├── client │ │ ├── __init__.py │ │ ├── debug.py │ │ ├── error.py │ │ ├── framework.py │ │ ├── pydumper.py │ │ ├── pyscript.py │ │ ├── pyscript_rexec.py │ │ └── scriptdispatch.py │ ├── demos │ │ └── client │ │ │ ├── asp │ │ │ ├── CreateObject.asp │ │ │ ├── caps.asp │ │ │ ├── interrupt │ │ │ │ ├── test.asp │ │ │ │ ├── test.html │ │ │ │ ├── test1.asp │ │ │ │ └── test1.html │ │ │ └── tut1.asp │ │ │ ├── ie │ │ │ ├── CHARTPY.HTM │ │ │ ├── FOO.HTM │ │ │ ├── MarqueeText1.htm │ │ │ ├── calc.htm │ │ │ ├── dbgtest.htm │ │ │ ├── demo.htm │ │ │ ├── demo_check.htm │ │ │ ├── demo_intro.htm │ │ │ ├── demo_menu.htm │ │ │ ├── docwrite.htm │ │ │ ├── foo2.htm │ │ │ ├── form.htm │ │ │ ├── marqueeDemo.htm │ │ │ ├── mousetrack.htm │ │ │ └── pycom_blowing.gif │ │ │ └── wsh │ │ │ ├── blank.pys │ │ │ ├── excel.pys │ │ │ ├── registry.pys │ │ │ └── test.pys │ ├── server │ │ ├── __init__.py │ │ └── axsite.py │ ├── src │ │ ├── AXScript.cpp │ │ ├── AXScript.h │ │ ├── GUIDs.cpp │ │ ├── GUIDs.h │ │ ├── PyGActiveScript.cpp │ │ ├── PyGActiveScriptError.cpp │ │ ├── PyGActiveScriptError.h │ │ ├── PyGActiveScriptParse.cpp │ │ ├── PyGActiveScriptSite.cpp │ │ ├── PyGObjectSafety.cpp │ │ ├── PyIActiveScript.cpp │ │ ├── PyIActiveScriptError.cpp │ │ ├── PyIActiveScriptError.h │ │ ├── PyIActiveScriptParse.cpp │ │ ├── PyIActiveScriptParseProcedure.cpp │ │ ├── PyIActiveScriptParseProcedure.h │ │ ├── PyIActiveScriptSite.cpp │ │ ├── PyIMultiInfos.cpp │ │ ├── PyIObjectSafety.cpp │ │ ├── PyIObjectSafety.h │ │ ├── PyIProvideMultipleClassInfo.h │ │ ├── multinfo.h │ │ ├── stdafx.cpp │ │ └── stdafx.h │ └── test │ │ ├── debugTest.pys │ │ ├── debugTest.vbs │ │ ├── leakTest.py │ │ ├── testHost.py │ │ └── testHost4Dbg.py │ ├── bits │ ├── __init__.py │ ├── src │ │ ├── PyIBackgroundCopyCallback.cpp │ │ ├── PyIBackgroundCopyCallback.h │ │ ├── PyIBackgroundCopyError.cpp │ │ ├── PyIBackgroundCopyError.h │ │ ├── PyIBackgroundCopyFile.cpp │ │ ├── PyIBackgroundCopyFile.h │ │ ├── PyIBackgroundCopyFile2.cpp │ │ ├── PyIBackgroundCopyFile2.h │ │ ├── PyIBackgroundCopyJob.cpp │ │ ├── PyIBackgroundCopyJob.h │ │ ├── PyIBackgroundCopyJob2.cpp │ │ ├── PyIBackgroundCopyJob2.h │ │ ├── PyIBackgroundCopyJob3.cpp │ │ ├── PyIBackgroundCopyJob3.h │ │ ├── PyIBackgroundCopyManager.cpp │ │ ├── PyIBackgroundCopyManager.h │ │ ├── PyIEnumBackgroundCopyFiles.cpp │ │ ├── PyIEnumBackgroundCopyFiles.h │ │ ├── PyIEnumBackgroundCopyJobs.cpp │ │ ├── PyIEnumBackgroundCopyJobs.h │ │ ├── bits.cpp │ │ └── bits_pch.h │ └── test │ │ ├── show_all_jobs.py │ │ └── test_bits.py │ ├── directsound │ ├── __init__.py │ ├── src │ │ ├── PyDSBCAPS.cpp │ │ ├── PyDSBUFFERDESC.cpp │ │ ├── PyDSCAPS.cpp │ │ ├── PyDSCBCAPS.cpp │ │ ├── PyDSCBUFFERDESC.cpp │ │ ├── PyDSCCAPS.cpp │ │ ├── PyIDirectSound.cpp │ │ ├── PyIDirectSound.h │ │ ├── PyIDirectSoundBuffer.cpp │ │ ├── PyIDirectSoundBuffer.h │ │ ├── PyIDirectSoundCapture.cpp │ │ ├── PyIDirectSoundCapture.h │ │ ├── PyIDirectSoundCaptureBuffer.cpp │ │ ├── PyIDirectSoundCaptureBuffer.h │ │ ├── PyIDirectSoundNotify.cpp │ │ ├── PyIDirectSoundNotify.h │ │ ├── directsound.cpp │ │ └── directsound_pch.h │ └── test │ │ ├── 01-Intro.wav │ │ ├── __init__.py │ │ ├── ds_record.py │ │ └── ds_test.py │ ├── ifilter │ ├── __init__.py │ ├── demo │ │ └── filterDemo.py │ ├── ifiltercon.py │ └── src │ │ ├── PyIFilter.cpp │ │ ├── PyIFilter.h │ │ └── stdafx.h │ ├── internet │ ├── __init__.py │ ├── inetcon.py │ └── src │ │ ├── PyIDocHostUIHandler.cpp │ │ ├── PyIDocHostUIHandler.h │ │ ├── PyIHTMLOMWindowServices.cpp │ │ ├── PyIHTMLOMWindowServices.h │ │ ├── PyIInternetBindInfo.cpp │ │ ├── PyIInternetBindInfo.h │ │ ├── PyIInternetPriority.cpp │ │ ├── PyIInternetPriority.h │ │ ├── PyIInternetProtocol.cpp │ │ ├── PyIInternetProtocol.h │ │ ├── PyIInternetProtocolInfo.cpp │ │ ├── PyIInternetProtocolInfo.h │ │ ├── PyIInternetProtocolRoot.cpp │ │ ├── PyIInternetProtocolRoot.h │ │ ├── PyIInternetProtocolSink.cpp │ │ ├── PyIInternetProtocolSink.h │ │ ├── PyIInternetSecurityManager.cpp │ │ ├── PyIInternetSecurityManager.h │ │ ├── internet.cpp │ │ └── internet_pch.h │ ├── mapi │ ├── __init__.py │ ├── demos │ │ └── mapisend.py │ ├── emsabtags.py │ ├── mapitags.py │ ├── mapiutil.py │ └── src │ │ ├── IConverterSession.h │ │ ├── IExchangeManageStoreEx.h │ │ ├── MAPIStubLibrary │ │ ├── LICENSE │ │ ├── README.md │ │ ├── include │ │ │ ├── EMSABTAG.H │ │ │ ├── EdkGuid.h │ │ │ ├── EdkMdb.h │ │ │ ├── ExchForm.h │ │ │ ├── IMSCapabilities.h │ │ │ ├── IMessage.h │ │ │ ├── MAPI.h │ │ │ ├── MAPIAux.h │ │ │ ├── MAPICode.h │ │ │ ├── MAPIDbg.h │ │ │ ├── MAPIDefS.h │ │ │ ├── MAPIForm.h │ │ │ ├── MAPIGuid.h │ │ │ ├── MAPIHook.h │ │ │ ├── MAPINls.h │ │ │ ├── MAPIOID.h │ │ │ ├── MAPISPI.h │ │ │ ├── MAPITags.h │ │ │ ├── MAPIUtil.h │ │ │ ├── MAPIVal.h │ │ │ ├── MAPIWin.h │ │ │ ├── MAPIWz.h │ │ │ ├── MAPIX.h │ │ │ ├── MSPST.h │ │ │ ├── abhelp.h │ │ │ ├── actMgmt.h │ │ │ └── mimeole.h │ │ └── library │ │ │ ├── mapiStubLibrary.cpp │ │ │ ├── stubutils.cpp │ │ │ └── stubutils.h │ │ ├── PyIABContainer.i │ │ ├── PyIAddrBook.i │ │ ├── PyIAttach.i │ │ ├── PyIConverterSession.i │ │ ├── PyIDistList.i │ │ ├── PyIExchangeManageStore.i │ │ ├── PyIExchangeManageStoreEx.i │ │ ├── PyIMAPIAdviseSink.cpp │ │ ├── PyIMAPIAdviseSink.h │ │ ├── PyIMAPIContainer.i │ │ ├── PyIMAPIFolder.i │ │ ├── PyIMAPIProp.i │ │ ├── PyIMAPISession.i │ │ ├── PyIMAPIStatus.i │ │ ├── PyIMAPITable.i │ │ ├── PyIMailUser.i │ │ ├── PyIMessage.i │ │ ├── PyIMsgServiceAdmin.i │ │ ├── PyIMsgServiceAdmin2.i │ │ ├── PyIMsgStore.i │ │ ├── PyIProfAdmin.i │ │ ├── PyIProfSect.i │ │ ├── PyIProviderAdmin.i │ │ ├── PyMAPIUtil.h │ │ ├── exchange.i │ │ ├── exchangeguids.cpp │ │ ├── extraMAPIDefs.h │ │ ├── extraMAPIGuids.h │ │ ├── mapi.i │ │ ├── mapiguids.cpp │ │ ├── mapilib.i │ │ └── mapiutil.cpp │ ├── propsys │ ├── __init__.py │ ├── pscon.py │ ├── src │ │ ├── PyIInitializeWithFile.cpp │ │ ├── PyIInitializeWithFile.h │ │ ├── PyIInitializeWithStream.cpp │ │ ├── PyIInitializeWithStream.h │ │ ├── PyINamedPropertyStore.cpp │ │ ├── PyINamedPropertyStore.h │ │ ├── PyIObjectWithPropertyKey.cpp │ │ ├── PyIObjectWithPropertyKey.h │ │ ├── PyIPersistSerializedPropStorage.cpp │ │ ├── PyIPersistSerializedPropStorage.h │ │ ├── PyIPropertyChange.cpp │ │ ├── PyIPropertyChange.h │ │ ├── PyIPropertyChangeArray.cpp │ │ ├── PyIPropertyChangeArray.h │ │ ├── PyIPropertyDescription.cpp │ │ ├── PyIPropertyDescription.h │ │ ├── PyIPropertyDescriptionAliasInfo.cpp │ │ ├── PyIPropertyDescriptionAliasInfo.h │ │ ├── PyIPropertyDescriptionList.cpp │ │ ├── PyIPropertyDescriptionList.h │ │ ├── PyIPropertyDescriptionSearchInfo.cpp │ │ ├── PyIPropertyDescriptionSearchInfo.h │ │ ├── PyIPropertyEnumType.cpp │ │ ├── PyIPropertyEnumType.h │ │ ├── PyIPropertyEnumTypeList.cpp │ │ ├── PyIPropertyEnumTypeList.h │ │ ├── PyIPropertyStore.cpp │ │ ├── PyIPropertyStore.h │ │ ├── PyIPropertyStoreCache.cpp │ │ ├── PyIPropertyStoreCache.h │ │ ├── PyIPropertyStoreCapabilities.cpp │ │ ├── PyIPropertyStoreCapabilities.h │ │ ├── PyIPropertySystem.cpp │ │ ├── PyIPropertySystem.h │ │ ├── PyPROPVARIANT.cpp │ │ ├── PyPROPVARIANT.h │ │ └── propsys.cpp │ └── test │ │ └── testpropsys.py │ ├── shell │ ├── __init__.py │ ├── demos │ │ ├── IActiveDesktop.py │ │ ├── IFileOperationProgressSink.py │ │ ├── IShellLinkDataList.py │ │ ├── ITransferAdviseSink.py │ │ ├── IUniformResourceLocator.py │ │ ├── browse_for_folder.py │ │ ├── create_link.py │ │ ├── dump_link.py │ │ ├── explorer_browser.py │ │ ├── servers │ │ │ ├── column_provider.py │ │ │ ├── context_menu.py │ │ │ ├── copy_hook.py │ │ │ ├── empty_volume_cache.py │ │ │ ├── folder_view.propdesc │ │ │ ├── folder_view.py │ │ │ ├── icon_handler.py │ │ │ └── shell_view.py │ │ ├── shellexecuteex.py │ │ ├── viewstate.py │ │ └── walk_shell_folders.py │ ├── shellcon.py │ ├── src │ │ ├── PyIActiveDesktop.cpp │ │ ├── PyIActiveDesktop.h │ │ ├── PyIApplicationDestinations.cpp │ │ ├── PyIApplicationDestinations.h │ │ ├── PyIApplicationDocumentLists.cpp │ │ ├── PyIApplicationDocumentLists.h │ │ ├── PyIAsyncOperation.cpp │ │ ├── PyIAsyncOperation.h │ │ ├── PyIBrowserFrameOptions.cpp │ │ ├── PyIBrowserFrameOptions.h │ │ ├── PyICategorizer.cpp │ │ ├── PyICategorizer.h │ │ ├── PyICategoryProvider.cpp │ │ ├── PyICategoryProvider.h │ │ ├── PyIColumnProvider.cpp │ │ ├── PyIColumnProvider.h │ │ ├── PyIContextMenu.cpp │ │ ├── PyIContextMenu.h │ │ ├── PyIContextMenu2.cpp │ │ ├── PyIContextMenu2.h │ │ ├── PyIContextMenu3.cpp │ │ ├── PyIContextMenu3.h │ │ ├── PyICopyHook.cpp │ │ ├── PyICopyHook.h │ │ ├── PyICurrentItem.cpp │ │ ├── PyICurrentItem.h │ │ ├── PyICustomDestinationList.cpp │ │ ├── PyICustomDestinationList.h │ │ ├── PyIDefaultExtractIconInit.cpp │ │ ├── PyIDefaultExtractIconInit.h │ │ ├── PyIDeskBand.cpp │ │ ├── PyIDeskBand.h │ │ ├── PyIDisplayItem.cpp │ │ ├── PyIDisplayItem.h │ │ ├── PyIDockingWindow.cpp │ │ ├── PyIDockingWindow.h │ │ ├── PyIDropTargetHelper.cpp │ │ ├── PyIDropTargetHelper.h │ │ ├── PyIEmptyVolumeCache.cpp │ │ ├── PyIEmptyVolumeCache.h │ │ ├── PyIEmptyVolumeCacheCallBack.cpp │ │ ├── PyIEmptyVolumeCacheCallBack.h │ │ ├── PyIEnumExplorerCommand.cpp │ │ ├── PyIEnumExplorerCommand.h │ │ ├── PyIEnumIDList.cpp │ │ ├── PyIEnumIDList.h │ │ ├── PyIEnumObjects.cpp │ │ ├── PyIEnumObjects.h │ │ ├── PyIEnumResources.cpp │ │ ├── PyIEnumResources.h │ │ ├── PyIEnumShellItems.cpp │ │ ├── PyIEnumShellItems.h │ │ ├── PyIExplorerBrowser.cpp │ │ ├── PyIExplorerBrowser.h │ │ ├── PyIExplorerBrowserEvents.cpp │ │ ├── PyIExplorerBrowserEvents.h │ │ ├── PyIExplorerCommand.cpp │ │ ├── PyIExplorerCommand.h │ │ ├── PyIExplorerCommandProvider.cpp │ │ ├── PyIExplorerCommandProvider.h │ │ ├── PyIExplorerPaneVisibility.cpp │ │ ├── PyIExplorerPaneVisibility.h │ │ ├── PyIExtractIcon.cpp │ │ ├── PyIExtractIcon.h │ │ ├── PyIExtractIconW.cpp │ │ ├── PyIExtractIconW.h │ │ ├── PyIExtractImage.cpp │ │ ├── PyIExtractImage.h │ │ ├── PyIFileOperation.cpp │ │ ├── PyIFileOperation.h │ │ ├── PyIFileOperationProgressSink.cpp │ │ ├── PyIFileOperationProgressSink.h │ │ ├── PyIFolderView.cpp │ │ ├── PyIFolderView.h │ │ ├── PyIIdentityName.cpp │ │ ├── PyIIdentityName.h │ │ ├── PyIInputObject.cpp │ │ ├── PyIInputObject.h │ │ ├── PyIKnownFolder.cpp │ │ ├── PyIKnownFolder.h │ │ ├── PyIKnownFolderManager.cpp │ │ ├── PyIKnownFolderManager.h │ │ ├── PyINameSpaceTreeControl.cpp │ │ ├── PyINameSpaceTreeControl.h │ │ ├── PyIObjectArray.cpp │ │ ├── PyIObjectArray.h │ │ ├── PyIObjectCollection.cpp │ │ ├── PyIObjectCollection.h │ │ ├── PyIPersistFolder.cpp │ │ ├── PyIPersistFolder.h │ │ ├── PyIPersistFolder2.cpp │ │ ├── PyIQueryAssociations.cpp │ │ ├── PyIQueryAssociations.h │ │ ├── PyIRelatedItem.cpp │ │ ├── PyIRelatedItem.h │ │ ├── PyIShellBrowser.cpp │ │ ├── PyIShellBrowser.h │ │ ├── PyIShellExtInit.cpp │ │ ├── PyIShellExtInit.h │ │ ├── PyIShellFolder.cpp │ │ ├── PyIShellFolder.h │ │ ├── PyIShellFolder2.cpp │ │ ├── PyIShellFolder2.h │ │ ├── PyIShellIcon.cpp │ │ ├── PyIShellIcon.h │ │ ├── PyIShellIconOverlay.cpp │ │ ├── PyIShellIconOverlay.h │ │ ├── PyIShellIconOverlayIdentifier.cpp │ │ ├── PyIShellIconOverlayIdentifier.h │ │ ├── PyIShellIconOverlayManager.cpp │ │ ├── PyIShellIconOverlayManager.h │ │ ├── PyIShellItem.cpp │ │ ├── PyIShellItem.h │ │ ├── PyIShellItem2.cpp │ │ ├── PyIShellItem2.h │ │ ├── PyIShellItemArray.cpp │ │ ├── PyIShellItemArray.h │ │ ├── PyIShellItemResources.cpp │ │ ├── PyIShellItemResources.h │ │ ├── PyIShellLibrary.cpp │ │ ├── PyIShellLibrary.h │ │ ├── PyIShellLink.cpp │ │ ├── PyIShellLink.h │ │ ├── PyIShellLinkDataList.cpp │ │ ├── PyIShellLinkDataList.h │ │ ├── PyIShellView.cpp │ │ ├── PyIShellView.h │ │ ├── PyITaskbarList.cpp │ │ ├── PyITaskbarList.h │ │ ├── PyITransferAdviseSink.cpp │ │ ├── PyITransferAdviseSink.h │ │ ├── PyITransferDestination.cpp │ │ ├── PyITransferDestination.h │ │ ├── PyITransferMediumItem.cpp │ │ ├── PyITransferMediumItem.h │ │ ├── PyITransferSource.cpp │ │ ├── PyITransferSource.h │ │ ├── PyIUniformResourceLocator.cpp │ │ ├── PyIUniformResourceLocator.h │ │ ├── shell.cpp │ │ └── shell_pch.h │ └── test │ │ ├── testSHFileOperation.py │ │ ├── testShellFolder.py │ │ └── testShellItem.py │ └── taskscheduler │ ├── __init__.py │ ├── src │ ├── PyIProvideTaskPage.cpp │ ├── PyIProvideTaskPage.h │ ├── PyIScheduledWorkItem.cpp │ ├── PyIScheduledWorkItem.h │ ├── PyITask.cpp │ ├── PyITask.h │ ├── PyITaskScheduler.cpp │ ├── PyITaskScheduler.h │ ├── PyITaskTrigger.cpp │ ├── PyITaskTrigger.h │ └── taskscheduler.cpp │ └── test │ ├── test_addtask.py │ ├── test_addtask_1.py │ ├── test_addtask_2.py │ └── test_localsystem.py ├── isapi ├── README.txt ├── __init__.py ├── doc │ └── isapi.html ├── install.py ├── isapicon.py ├── samples │ ├── README.txt │ ├── advanced.py │ ├── redirector.py │ ├── redirector_asynch.py │ ├── redirector_with_filter.py │ └── test.py ├── simple.py ├── src │ ├── ControlBlock.h │ ├── FilterContext.h │ ├── PyExtensionObjects.cpp │ ├── PyExtensionObjects.h │ ├── PyFilterObjects.cpp │ ├── PyFilterObjects.h │ ├── PythonEng.cpp │ ├── PythonEng.h │ ├── StdAfx.cpp │ ├── StdAfx.h │ ├── Utils.cpp │ ├── Utils.h │ ├── pyISAPI.cpp │ ├── pyISAPI.h │ └── pyISAPI_messages.mc ├── test │ ├── README.txt │ └── extension_simple.py └── threaded_extension.py ├── make_all.bat ├── mypy.ini ├── pycln.toml ├── pyproject.toml ├── pyrightconfig.json ├── pywin32.pth ├── ruff.toml ├── setup.py └── win32 ├── Demos ├── BackupRead_BackupWrite.py ├── BackupSeek_streamheaders.py ├── CopyFileEx.py ├── CreateFileTransacted_MiniVersion.py ├── EvtFormatMessage.py ├── EvtSubscribe_pull.py ├── EvtSubscribe_push.py ├── FileSecurityTest.py ├── GetSaveFileName.py ├── NetValidatePasswordPolicy.py ├── OpenEncryptedFileRaw.py ├── RegCreateKeyTransacted.py ├── RegRestoreKey.py ├── SystemParametersInfo.py ├── c_extension │ ├── README.txt │ ├── setup.py │ └── win32_extension.cpp ├── dde │ ├── ddeclient.py │ └── ddeserver.py ├── desktopmanager.py ├── eventLogDemo.py ├── getfilever.py ├── images │ ├── frowny.bmp │ └── smiley.bmp ├── mmapfile_demo.py ├── pipes │ ├── cat.py │ └── runproc.py ├── print_desktop.py ├── rastest.py ├── security │ ├── GetTokenInformation.py │ ├── account_rights.py │ ├── explicit_entries.py │ ├── get_policy_info.py │ ├── list_rights.py │ ├── localized_names.py │ ├── lsaregevent.py │ ├── lsastore.py │ ├── query_information.py │ ├── regsave_sa.py │ ├── regsecurity.py │ ├── sa_inherit.py │ ├── security_enums.py │ ├── set_file_audit.py │ ├── set_file_owner.py │ ├── set_policy_info.py │ ├── setkernelobjectsecurity.py │ ├── setnamedsecurityinfo.py │ ├── setsecurityinfo.py │ ├── setuserobjectsecurity.py │ └── sspi │ │ ├── fetch_url.py │ │ ├── simple_auth.py │ │ ├── socket_server.py │ │ └── validate_password.py ├── service │ ├── install │ │ ├── perf_install.h │ │ ├── perf_install.ini │ │ └── readme.txt │ ├── nativePipeTestService.py │ ├── pipeTestService.py │ ├── pipeTestServiceClient.py │ └── serviceEvents.py ├── timer_demo.py ├── win32clipboardDemo.py ├── win32clipboard_bitmapdemo.py ├── win32comport_demo.py ├── win32console_demo.py ├── win32cred_demo.py ├── win32fileDemo.py ├── win32gui_demo.py ├── win32gui_devicenotify.py ├── win32gui_dialog.py ├── win32gui_menu.py ├── win32gui_taskbar.py ├── win32netdemo.py ├── win32rcparser_demo.py ├── win32servicedemo.py ├── win32ts_logoff_disconnected.py ├── win32wnet │ ├── netresource.htm │ ├── testwnet.py │ └── winnetwk.py └── winprocess.py ├── Lib ├── _win32verstamp_pywin32ctypes.py ├── afxres.py ├── commctrl.py ├── mmsystem.py ├── netbios.py ├── ntsecuritycon.py ├── pywin32_bootstrap.py ├── pywin32_testutil.py ├── pywintypes.py ├── rasutil.py ├── regcheck.py ├── regutil.py ├── sspi.py ├── sspicon.py ├── win2kras.py ├── win32con.py ├── win32cryptcon.py ├── win32evtlogutil.py ├── win32gui_struct.py ├── win32inetcon.py ├── win32netcon.py ├── win32pdhquery.py ├── win32pdhutil.py ├── win32rcparser.py ├── win32serviceutil.py ├── win32timezone.py ├── win32traceutil.py ├── win32verstamp.py ├── winerror.py ├── winioctlcon.py ├── winnt.py ├── winperf.py └── winxptheme.py ├── License.txt ├── help ├── event.d ├── file.d ├── process_info.html ├── security.d ├── security_directories.html └── win32net.html ├── scripts ├── ControlService.py ├── VersionStamp │ ├── BrandProject.py │ ├── bulkstamp.py │ └── vssutil.py ├── backupEventLog.py ├── h2py.py ├── killProcName.py ├── pywin32_postinstall.py ├── pywin32_testall.py ├── rasutil.py ├── regsetup.py └── setup_d.py ├── src ├── PerfMon │ ├── MappingManager.cpp │ ├── PerfCounterDefn.cpp │ ├── PerfObjectType.cpp │ ├── PyPerfMon.cpp │ ├── PyPerfMonControl.h │ ├── PyPerfMsgs.mc │ ├── perfmondata.cpp │ ├── perfmondata.def │ ├── perfutil.h │ └── pyperfmon.h ├── PyACL.cpp ├── PyDEVMODE.cpp ├── PyHANDLE.cpp ├── PyIID.cpp ├── PyLARGE_INTEGER.cpp ├── PyOVERLAPPED.cpp ├── PySECURITY_ATTRIBUTES.cpp ├── PySECURITY_DESCRIPTOR.cpp ├── PySID.cpp ├── PySecurityObjects.h ├── PySoundObjects.h ├── PyTime.cpp ├── PyUnicode.cpp ├── PyWAVEFORMATEX.cpp ├── PyWinObjects.h ├── PyWinTypes.h ├── PyWinTypesmodule.cpp ├── PythonService.cpp ├── PythonService.rc ├── PythonServiceMessages.mc ├── _win32sysloader.cpp ├── _winxptheme.i ├── mmapfilemodule.cpp ├── odbc.cpp ├── stddde.h ├── timermodule.cpp ├── win32api_display.cpp ├── win32api_display.h ├── win32apimodule.cpp ├── win32clipboardmodule.cpp ├── win32consolemodule.cpp ├── win32credmodule.cpp ├── win32crypt │ ├── PyCERTSTORE.cpp │ ├── PyCERT_CONTEXT.cpp │ ├── PyCRYPTHASH.cpp │ ├── PyCRYPTKEY.cpp │ ├── PyCRYPTMSG.cpp │ ├── PyCRYPTPROV.cpp │ ├── PyCTL_CONTEXT.cpp │ ├── win32crypt.h │ ├── win32crypt_structs.cpp │ └── win32cryptmodule.cpp ├── win32dynamicdialog.cpp ├── win32dynamicdialog.h ├── win32event.i ├── win32evtlog.i ├── win32evtlog_messages.mc ├── win32file.i ├── win32file_comm.cpp ├── win32file_comm.h ├── win32gui.i ├── win32helpmodule.cpp ├── win32inet.i ├── win32inet_winhttp.cpp ├── win32job.i ├── win32lzmodule.cpp ├── win32net │ ├── win32net.h │ ├── win32netfile.cpp │ ├── win32netgroup.cpp │ ├── win32netmisc.cpp │ ├── win32netmodule.cpp │ ├── win32netsession.cpp │ ├── win32netuse.cpp │ └── win32netuser.cpp ├── win32pdhmodule.cpp ├── win32pipe.i ├── win32print │ └── win32print.cpp ├── win32process.i ├── win32profilemodule.cpp ├── win32rasmodule.cpp ├── win32security.i ├── win32security_ds.cpp ├── win32security_sspi.cpp ├── win32security_sspi.h ├── win32service.i ├── win32service_messages.mc ├── win32trace.cpp ├── win32transactionmodule.cpp ├── win32tsmodule.cpp └── win32wnet │ ├── Netres.h │ ├── PyNCB.cpp │ ├── PyNCB.h │ ├── PyNetresource.cpp │ └── win32wnet.cpp ├── test ├── handles.py ├── test_clipboard.py ├── test_exceptions.py ├── test_odbc.py ├── test_pywintypes.py ├── test_security.py ├── test_sspi.py ├── test_win32api.py ├── test_win32clipboard.py ├── test_win32cred.py ├── test_win32crypt.py ├── test_win32event.py ├── test_win32file.py ├── test_win32gui.py ├── test_win32guistruct.py ├── test_win32inet.py ├── test_win32net.py ├── test_win32pipe.py ├── test_win32print.py ├── test_win32profile.py ├── test_win32rcparser.py ├── test_win32timezone.py ├── test_win32trace.py ├── test_win32ts.py ├── test_win32wnet.py ├── testall.py ├── win32crypt_testcert_base64.cer ├── win32crypt_testcert_bin.cer └── win32rcparser │ ├── python.bmp │ ├── python.ico │ ├── test.h │ └── test.rc └── winxpgui.py /.clang-format: -------------------------------------------------------------------------------- 1 | # A clang-format style that approximates Python's PEP 7 2 | # Useful for IDE integration 3 | # https://clang.llvm.org/docs/ClangFormatStyleOptions.html#configurable-format-style-options 4 | Language: Cpp 5 | BasedOnStyle: Google 6 | 7 | AlignAfterOpenBracket: Align 8 | AllowShortIfStatementsOnASingleLine: false 9 | AlwaysBreakAfterReturnType: None # Don't break after return type 10 | BreakBeforeBraces: Stroustrup 11 | ColumnLimit: 120 12 | DerivePointerAlignment: false 13 | IndentWidth: 4 14 | PointerAlignment: Right 15 | ReflowComments: true 16 | SortIncludes: false # Sorting includes breaks build 17 | SpaceBeforeParens: ControlStatements 18 | SpacesInParentheses: false 19 | TabWidth: 4 20 | UseTab: Never 21 | -------------------------------------------------------------------------------- /.editorconfig: -------------------------------------------------------------------------------- 1 | root = true 2 | 3 | [*] 4 | trim_trailing_whitespace = true 5 | insert_final_newline = true 6 | end_of_line = crlf 7 | indent_style = space 8 | indent_size = 4 9 | max_line_length = 120 # Same as .clang-format 10 | 11 | [*.py] 12 | max_line_length = 88 # Same as Ruff's default 13 | 14 | [*.md] 15 | trim_trailing_whitespace = false 16 | 17 | [*.{yaml,yml,json,toml,clang-format,vcxproj}] 18 | indent_size = 2 19 | -------------------------------------------------------------------------------- /.git-blame-ignore-revs: -------------------------------------------------------------------------------- 1 | # This file contains hashes of commits git blame should ignore. 2 | # Run `git config blame.ignoreRevsFile .git-blame-ignore-revs` to enable. 3 | # Requires git 2.23+. 4 | 5 | # 2019-09-07 formatted c++ source with clang-format 6 | 059b7beb928225e389621802db758c75a7b8c58f 7 | 8 | # 2021-09-11 formatted Python source with black. 9 | 858e19a76e08fc175a667ffc97409f2ef15bfc19 10 | 11 | # 2024-05-28 formatted trailing-whitespaces and end-of-file with pre-commit 12 | 452e3dafc126faa978d67a946385bf2514477411 13 | 14 | # 2024-05-28 formatted c++ source with clang-format 15 | 637448f8252ab142eedd539ddf9b08259b73eecc 16 | 17 | # 2024-10-14 formatted Python source with Ruff format 18 | 2b5191d8fc6f1d1fbde01481b49278c1957ef8f1 19 | -------------------------------------------------------------------------------- /.gitattributes: -------------------------------------------------------------------------------- 1 | # Files that must be \r\n in the working tree. 2 | AutoDuck/*.fmt text eol=crlf 3 | *.dsp text eol=crlf 4 | *.dsw text eol=crlf 5 | -------------------------------------------------------------------------------- /.github/ISSUE_TEMPLATE/config.yml: -------------------------------------------------------------------------------- 1 | blank_issues_enabled: false 2 | contact_links: 3 | - name: Typeshed type stubs and annotations 4 | url: https://github.com/python/typeshed/issues?q=state%3Aopen+pywin32 5 | about: For static type-checking and IntelliSense 6 | - name: Discussions Q&A category 7 | url: https://github.com/mhammond/pywin32/discussions/new?category=q-a 8 | about: For support requests, problems or questions 9 | -------------------------------------------------------------------------------- /.hgeol: -------------------------------------------------------------------------------- 1 | [patterns] 2 | **.dsp = CRLF 3 | **.dsw = CRLF 4 | **.vbp = CRLF 5 | # adodbapi appears to have been checked in with windows line endings 6 | # and without the 'eol' extension enabled, so we say it's binary to stop 7 | # hg continually thinking it has changed. 8 | path:adodbapi = bin 9 | ** = native 10 | -------------------------------------------------------------------------------- /AutoDuck/bin/autoduck.exe: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/mhammond/pywin32/50777ab2e67c8b8d4ca429a598cc97ce33719963/AutoDuck/bin/autoduck.exe -------------------------------------------------------------------------------- /AutoDuck/common_top.mak: -------------------------------------------------------------------------------- 1 | # Common AutoDuck make file 2 | 3 | AD = bin\autoduck.exe /Spythonwin.fmt 4 | ADHTMLFMT = bin\autoduck.exe /Spyhtml.fmt 5 | ADHTMLLOG = /R html "/L$(GENDIR)\$(TARGET).HHLOG" /N 6 | ADLOG = /R help "/L$(GENDIR)\$(TARGET).HLOG" /N 7 | ADHTML = /R html "/G$(GENDIR)\$(TARGET).DUMP" "/C$(GENDIR)\$(TARGET).HHLOG" "/I$(GENDIR)\$(TARGET).IDX" "/O$(GENDIR)\$(TARGET).HTML" /D "title=$(TITLE)" 8 | ADHLP = /R help "/C$(GENDIR)\$(TARGET).HLOG" "/O$(GENDIR)\$(TARGET).RTF" /D "title=$(TITLE)" 9 | ADDOC = /RD "/O$(GENDIR)\$(TARGET).DOC" /D "doc_header=$(DOCHDR)" 10 | ADTAB = 8 11 | HC = hcw /a /c /e 12 | HHC = hhc 13 | # PYTHON is set in make.py, defaulting to the one found on PATH 14 | PYTHON = python 15 | -------------------------------------------------------------------------------- /AutoDuck/fixHelpCompression.py: -------------------------------------------------------------------------------- 1 | # fixHelpCompression.py 2 | # Add a compression option to the generated help project file. 3 | import os 4 | import sys 5 | 6 | import win32api 7 | 8 | fname = sys.argv[1] 9 | 10 | try: 11 | os.stat(fname) 12 | except OSError: 13 | sys.stderr.write("The project file '%s' was not found\n" % (fname)) 14 | sys.exit(1) 15 | 16 | win32api.WriteProfileVal("options", "COMPRESS", "12 Hall Zeck", fname) 17 | -------------------------------------------------------------------------------- /AutoDuck/make.py: -------------------------------------------------------------------------------- 1 | # Ported from a horrible, old .bat file, but this uses vswhere ... 2 | import os 3 | import subprocess 4 | import sys 5 | 6 | if __name__ == "__main__": 7 | # *sob* - we should kill .chm file support! 8 | # "hhc" is the "html help compiler" - part of some obscure SDK. 9 | if not os.environ.get("HHC"): 10 | os.environ["HHC"] = os.path.expandvars( 11 | r'"%ProgramFiles(x86)%\HTML Help Workshop\hhc.exe"' 12 | ) 13 | 14 | # find nmake 15 | nmake = subprocess.check_output( 16 | [ 17 | os.path.expandvars( 18 | r"%ProgramFiles(x86)%\Microsoft Visual Studio\Installer\vswhere.exe" 19 | ), 20 | "-utf8", 21 | "-prerelease", 22 | "-find", 23 | r"VC\Tools\MSVC\**\nmake.exe", 24 | ], 25 | encoding="utf-8", 26 | ).splitlines()[-1] 27 | 28 | subprocess.run( 29 | [nmake, f'PYTHON="{sys.executable}"', "-E", "-f", "pywin32.mak"], 30 | cwd=os.path.dirname(sys.argv[0]), 31 | check=True, 32 | ) 33 | -------------------------------------------------------------------------------- /Pythonwin/Scintilla/License.txt: -------------------------------------------------------------------------------- 1 | License for Scintilla and SciTE 2 | 3 | Copyright 1998-2003 by Neil Hodgson 4 | 5 | All Rights Reserved 6 | 7 | Permission to use, copy, modify, and distribute this software and its 8 | documentation for any purpose and without fee is hereby granted, 9 | provided that the above copyright notice appear in all copies and that 10 | both that copyright notice and this permission notice appear in 11 | supporting documentation. 12 | 13 | NEIL HODGSON DISCLAIMS ALL WARRANTIES WITH REGARD TO THIS 14 | SOFTWARE, INCLUDING ALL IMPLIED WARRANTIES OF MERCHANTABILITY 15 | AND FITNESS, IN NO EVENT SHALL NEIL HODGSON BE LIABLE FOR ANY 16 | SPECIAL, INDIRECT OR CONSEQUENTIAL DAMAGES OR ANY DAMAGES 17 | WHATSOEVER RESULTING FROM LOSS OF USE, DATA OR PROFITS, 18 | WHETHER IN AN ACTION OF CONTRACT, NEGLIGENCE OR OTHER 19 | TORTIOUS ACTION, ARISING OUT OF OR IN CONNECTION WITH THE USE 20 | OR PERFORMANCE OF THIS SOFTWARE. -------------------------------------------------------------------------------- /Pythonwin/Scintilla/README_pythonwin: -------------------------------------------------------------------------------- 1 | This is a copy of Scintilla 4.4.6 used for Pythonwin. 2 | 3 | Scintilla's home is https://www.scintilla.org/ 4 | 5 | Only the sources relevant to Scintilla under Pythonwin are 6 | included (plus the Scintilla Licence.txt and README). 7 | For the full set of Scintilla sources, including its documentation 8 | and companion editor SciTE, see https://www.scintilla.org/ . 9 | 10 | When updating the Scintilla source, also update the copyright year 11 | in Pythonwin/pywin/framework/app.py and regenerate 12 | Pythonwin/pywin/scintilla/scintillacon.py by running 13 | `nmake /f makefile_pythonwin scintillacon.py`. 14 | (nmake will be found in your VS Build Tools, for instance: 15 | `C:\Program Files (x86)\Microsoft Visual Studio\2022\BuildTools\VC\Tools\MSVC\14.41.34120\bin\Hostx86\x86\nmake.exe`) 16 | -------------------------------------------------------------------------------- /Pythonwin/Scintilla/include/ILoader.h: -------------------------------------------------------------------------------- 1 | // Scintilla source code edit control 2 | /** @file ILoader.h 3 | ** Interface for loading into a Scintilla document from a background thread. 4 | **/ 5 | // Copyright 1998-2017 by Neil Hodgson 6 | // The License.txt file describes the conditions under which this software may be distributed. 7 | 8 | #ifndef ILOADER_H 9 | #define ILOADER_H 10 | 11 | #include "Sci_Position.h" 12 | 13 | class ILoader { 14 | public: 15 | virtual int SCI_METHOD Release() = 0; 16 | // Returns a status code from SC_STATUS_* 17 | virtual int SCI_METHOD AddData(const char *data, Sci_Position length) = 0; 18 | virtual void * SCI_METHOD ConvertToDocument() = 0; 19 | }; 20 | 21 | #endif 22 | -------------------------------------------------------------------------------- /Pythonwin/Scintilla/include/Sci_Position.h: -------------------------------------------------------------------------------- 1 | // Scintilla source code edit control 2 | /** @file Sci_Position.h 3 | ** Define the Sci_Position type used in Scintilla's external interfaces. 4 | ** These need to be available to clients written in C so are not in a C++ namespace. 5 | **/ 6 | // Copyright 2015 by Neil Hodgson 7 | // The License.txt file describes the conditions under which this software may be distributed. 8 | 9 | #ifndef SCI_POSITION_H 10 | #define SCI_POSITION_H 11 | 12 | #include 13 | 14 | // Basic signed type used throughout interface 15 | typedef ptrdiff_t Sci_Position; 16 | 17 | // Unsigned variant used for ILexer::Lex and ILexer::Fold 18 | typedef size_t Sci_PositionU; 19 | 20 | // For Sci_CharacterRange which is defined as long to be compatible with Win32 CHARRANGE 21 | typedef long Sci_PositionCR; 22 | 23 | #ifdef _WIN32 24 | #define SCI_METHOD __stdcall 25 | #else 26 | #define SCI_METHOD 27 | #endif 28 | 29 | #endif 30 | -------------------------------------------------------------------------------- /Pythonwin/Scintilla/lexlib/Accessor.h: -------------------------------------------------------------------------------- 1 | // Scintilla source code edit control 2 | /** @file Accessor.h 3 | ** Interfaces between Scintilla and lexers. 4 | **/ 5 | // Copyright 1998-2010 by Neil Hodgson 6 | // The License.txt file describes the conditions under which this software may be distributed. 7 | 8 | #ifndef ACCESSOR_H 9 | #define ACCESSOR_H 10 | 11 | namespace Scintilla { 12 | 13 | enum { wsSpace=1, wsTab=2, wsSpaceTab=4, wsInconsistent=8 }; 14 | 15 | class Accessor; 16 | class WordList; 17 | class PropSetSimple; 18 | 19 | typedef bool (*PFNIsCommentLeader)(Accessor &styler, Sci_Position pos, Sci_Position len); 20 | 21 | class Accessor : public LexAccessor { 22 | public: 23 | PropSetSimple *pprops; 24 | Accessor(IDocument *pAccess_, PropSetSimple *pprops_); 25 | int GetPropertyInt(const char *, int defaultValue=0) const; 26 | int IndentAmount(Sci_Position line, int *flags, PFNIsCommentLeader pfnIsCommentLeader = 0); 27 | }; 28 | 29 | } 30 | 31 | #endif 32 | -------------------------------------------------------------------------------- /Pythonwin/Scintilla/lexlib/LexerSimple.h: -------------------------------------------------------------------------------- 1 | // Scintilla source code edit control 2 | /** @file LexerSimple.h 3 | ** A simple lexer with no state. 4 | **/ 5 | // Copyright 1998-2010 by Neil Hodgson 6 | // The License.txt file describes the conditions under which this software may be distributed. 7 | 8 | #ifndef LEXERSIMPLE_H 9 | #define LEXERSIMPLE_H 10 | 11 | namespace Scintilla { 12 | 13 | // A simple lexer with no state 14 | class LexerSimple : public LexerBase { 15 | const LexerModule *module; 16 | std::string wordLists; 17 | public: 18 | explicit LexerSimple(const LexerModule *module_); 19 | const char * SCI_METHOD DescribeWordListSets() override; 20 | void SCI_METHOD Lex(Sci_PositionU startPos, Sci_Position lengthDoc, int initStyle, IDocument *pAccess) override; 21 | void SCI_METHOD Fold(Sci_PositionU startPos, Sci_Position lengthDoc, int initStyle, IDocument *pAccess) override; 22 | // ILexer5 methods 23 | const char * SCI_METHOD GetName() override; 24 | int SCI_METHOD GetIdentifier() override; 25 | }; 26 | 27 | } 28 | 29 | #endif 30 | -------------------------------------------------------------------------------- /Pythonwin/Scintilla/lexlib/PropSetSimple.h: -------------------------------------------------------------------------------- 1 | // Scintilla source code edit control 2 | /** @file PropSetSimple.h 3 | ** A basic string to string map. 4 | **/ 5 | // Copyright 1998-2009 by Neil Hodgson 6 | // The License.txt file describes the conditions under which this software may be distributed. 7 | 8 | #ifndef PROPSETSIMPLE_H 9 | #define PROPSETSIMPLE_H 10 | 11 | namespace Scintilla { 12 | 13 | class PropSetSimple { 14 | void *impl; 15 | void Set(const char *keyVal); 16 | public: 17 | PropSetSimple(); 18 | virtual ~PropSetSimple(); 19 | void Set(const char *key, const char *val, size_t lenKey, size_t lenVal); 20 | void SetMultiple(const char *); 21 | const char *Get(const char *key) const; 22 | size_t GetExpanded(const char *key, char *result) const; 23 | int GetInt(const char *key, int defaultValue=0) const; 24 | }; 25 | 26 | } 27 | 28 | #endif 29 | -------------------------------------------------------------------------------- /Pythonwin/Scintilla/lexlib/StringCopy.h: -------------------------------------------------------------------------------- 1 | // Scintilla source code edit control 2 | /** @file StringCopy.h 3 | ** Safe string copy function which always NUL terminates. 4 | ** ELEMENTS macro for determining array sizes. 5 | **/ 6 | // Copyright 2013 by Neil Hodgson 7 | // The License.txt file describes the conditions under which this software may be distributed. 8 | 9 | #ifndef STRINGCOPY_H 10 | #define STRINGCOPY_H 11 | 12 | namespace Scintilla { 13 | 14 | // Safer version of string copy functions like strcpy, wcsncpy, etc. 15 | // Instantiate over fixed length strings of both char and wchar_t. 16 | // May truncate if source doesn't fit into dest with room for NUL. 17 | 18 | template 19 | void StringCopy(T (&dest)[count], const T* source) { 20 | for (size_t i=0; i 8 | // The License.txt file describes the conditions under which this software may be distributed. 9 | 10 | #ifndef CATALOGUE_H 11 | #define CATALOGUE_H 12 | 13 | namespace Scintilla { 14 | 15 | class Catalogue { 16 | public: 17 | static const LexerModule *Find(int language); 18 | static const LexerModule *Find(const char *languageName) noexcept; 19 | static void AddLexerModule(LexerModule *plm); 20 | }; 21 | 22 | } 23 | 24 | #endif 25 | -------------------------------------------------------------------------------- /Pythonwin/Scintilla/src/CharClassify.h: -------------------------------------------------------------------------------- 1 | // Scintilla source code edit control 2 | /** @file CharClassify.h 3 | ** Character classifications used by Document and RESearch. 4 | **/ 5 | // Copyright 2006-2009 by Neil Hodgson 6 | // The License.txt file describes the conditions under which this software may be distributed. 7 | 8 | #ifndef CHARCLASSIFY_H 9 | #define CHARCLASSIFY_H 10 | 11 | namespace Scintilla { 12 | 13 | class CharClassify { 14 | public: 15 | CharClassify(); 16 | 17 | enum cc { ccSpace, ccNewLine, ccWord, ccPunctuation }; 18 | void SetDefaultCharClasses(bool includeWordClass); 19 | void SetCharClasses(const unsigned char *chars, cc newCharClass); 20 | int GetCharsOfClass(cc characterClass, unsigned char *buffer) const noexcept; 21 | cc GetClass(unsigned char ch) const noexcept { return static_cast(charClass[ch]);} 22 | bool IsWord(unsigned char ch) const noexcept { return static_cast(charClass[ch]) == ccWord;} 23 | 24 | private: 25 | enum { maxChar=256 }; 26 | unsigned char charClass[maxChar]; // not type cc to save space 27 | }; 28 | 29 | } 30 | 31 | #endif 32 | -------------------------------------------------------------------------------- /Pythonwin/Scintilla/src/DBCS.h: -------------------------------------------------------------------------------- 1 | // Scintilla source code edit control 2 | /** @file DBCS.h 3 | ** Functions to handle DBCS double byte encodings like Shift-JIS. 4 | **/ 5 | // Copyright 2017 by Neil Hodgson 6 | // The License.txt file describes the conditions under which this software may be distributed. 7 | 8 | #ifndef DBCS_H 9 | #define DBCS_H 10 | 11 | namespace Scintilla { 12 | 13 | constexpr bool IsDBCSCodePage(int codePage) noexcept { 14 | return codePage == 932 15 | || codePage == 936 16 | || codePage == 949 17 | || codePage == 950 18 | || codePage == 1361; 19 | } 20 | 21 | bool DBCSIsLeadByte(int codePage, char ch) noexcept; 22 | 23 | } 24 | 25 | #endif 26 | -------------------------------------------------------------------------------- /Pythonwin/Scintilla/src/ElapsedPeriod.h: -------------------------------------------------------------------------------- 1 | // Scintilla source code edit control 2 | /** @file ElapsedPeriod.h 3 | ** Encapsulate C++ to simplify use. 4 | **/ 5 | // Copyright 2018 by Neil Hodgson 6 | // The License.txt file describes the conditions under which this software may be distributed. 7 | 8 | #ifndef ELAPSEDPERIOD_H 9 | #define ELAPSEDPERIOD_H 10 | 11 | namespace Scintilla { 12 | 13 | // Simplified access to high precision timing. 14 | class ElapsedPeriod { 15 | std::chrono::high_resolution_clock::time_point tp; 16 | public: 17 | /// Capture the moment 18 | ElapsedPeriod() noexcept : tp(std::chrono::high_resolution_clock::now()) { 19 | } 20 | /// Return duration as floating point seconds 21 | double Duration(bool reset=false) noexcept { 22 | const std::chrono::high_resolution_clock::time_point tpNow = 23 | std::chrono::high_resolution_clock::now(); 24 | const std::chrono::duration stylingDuration = 25 | std::chrono::duration_cast>(tpNow - tp); 26 | if (reset) { 27 | tp = tpNow; 28 | } 29 | return stylingDuration.count(); 30 | } 31 | }; 32 | 33 | } 34 | 35 | #endif 36 | -------------------------------------------------------------------------------- /Pythonwin/Scintilla/src/ExternalLexer.h: -------------------------------------------------------------------------------- 1 | // Scintilla source code edit control 2 | /** @file ExternalLexer.h 3 | ** Support external lexers in DLLs or shared libraries. 4 | **/ 5 | // Copyright 2001 Simon Steele , portions copyright Neil Hodgson. 6 | // The License.txt file describes the conditions under which this software may be distributed. 7 | 8 | #ifndef EXTERNALLEXER_H 9 | #define EXTERNALLEXER_H 10 | 11 | namespace Scintilla { 12 | 13 | void ExternalLexerLoad(const char *path); 14 | 15 | } 16 | 17 | #endif 18 | -------------------------------------------------------------------------------- /Pythonwin/Scintilla/src/FontQuality.h: -------------------------------------------------------------------------------- 1 | // Scintilla source code edit control 2 | /** @file FontQuality.h 3 | ** Definitions to control font anti-aliasing. 4 | ** Redefine constants from Scintilla.h to avoid including Scintilla.h in PlatWin.cxx. 5 | **/ 6 | // Copyright 1998-2009 by Neil Hodgson 7 | // The License.txt file describes the conditions under which this software may be distributed. 8 | 9 | #ifndef FONTQUALITY_H 10 | #define FONTQUALITY_H 11 | 12 | namespace Scintilla { 13 | 14 | // These definitions match Scintilla.h 15 | #define SC_EFF_QUALITY_MASK 0xF 16 | #define SC_EFF_QUALITY_DEFAULT 0 17 | #define SC_EFF_QUALITY_NON_ANTIALIASED 1 18 | #define SC_EFF_QUALITY_ANTIALIASED 2 19 | #define SC_EFF_QUALITY_LCD_OPTIMIZED 3 20 | 21 | // These definitions must match SC_TECHNOLOGY_* in Scintilla.h 22 | #define SCWIN_TECH_GDI 0 23 | #define SCWIN_TECH_DIRECTWRITE 1 24 | 25 | } 26 | 27 | #endif 28 | -------------------------------------------------------------------------------- /Pythonwin/Scintilla/src/IntegerRectangle.h: -------------------------------------------------------------------------------- 1 | // Scintilla source code edit control 2 | /** @file IntegerRectangle.h 3 | ** A rectangle with integer coordinates. 4 | **/ 5 | // Copyright 2018 by Neil Hodgson 6 | // The License.txt file describes the conditions under which this software may be distributed. 7 | 8 | #ifndef INTEGERRECTANGLE_H 9 | #define INTEGERRECTANGLE_H 10 | 11 | namespace Scintilla { 12 | 13 | struct IntegerRectangle { 14 | int left; 15 | int top; 16 | int right; 17 | int bottom; 18 | 19 | explicit IntegerRectangle(PRectangle rc) noexcept : 20 | left(static_cast(rc.left)), top(static_cast(rc.top)), 21 | right(static_cast(rc.right)), bottom(static_cast(rc.bottom)) { 22 | } 23 | int Width() const noexcept { return right - left; } 24 | int Height() const noexcept { return bottom - top; } 25 | }; 26 | 27 | } 28 | 29 | #endif 30 | -------------------------------------------------------------------------------- /Pythonwin/Scintilla/src/Position.h: -------------------------------------------------------------------------------- 1 | // Scintilla source code edit control 2 | /** @file Position.h 3 | ** Defines global type name Position in the Sci internal namespace. 4 | **/ 5 | // Copyright 2015 by Neil Hodgson 6 | // The License.txt file describes the conditions under which this software may be distributed. 7 | 8 | #ifndef POSITION_H 9 | #define POSITION_H 10 | 11 | /** 12 | * A Position is a position within a document between two characters or at the beginning or end. 13 | * Sometimes used as a character index where it identifies the character after the position. 14 | * A Line is a document or screen line. 15 | */ 16 | 17 | namespace Sci { 18 | 19 | typedef ptrdiff_t Position; 20 | typedef ptrdiff_t Line; 21 | 22 | const Position invalidPosition = -1; 23 | 24 | } 25 | 26 | #endif 27 | -------------------------------------------------------------------------------- /Pythonwin/Scintilla/src/SciTE.properties: -------------------------------------------------------------------------------- 1 | # SciTE.properties is the per directory local options file and can be used to override 2 | # settings made in SciTEGlobal.properties 3 | command.build.directory.*.cxx=..\win32 4 | command.build.directory.*.h=..\win32 5 | command.build.*.cxx=nmake -f scintilla.mak QUIET=1 6 | command.build.*.h=nmake -f scintilla.mak QUIET=1 7 | -------------------------------------------------------------------------------- /Pythonwin/Scintilla/win32/HanjaDic.h: -------------------------------------------------------------------------------- 1 | // Scintilla source code edit control 2 | /** @file HanjaDic.h 3 | ** Korean Hanja Dictionary 4 | ** Convert between Korean Hanja and Hangul by COM interface. 5 | **/ 6 | // Copyright 2015 by Neil Hodgson 7 | // The License.txt file describes the conditions under which this software may be distributed. 8 | 9 | #ifndef HANJADIC_H 10 | #define HANJADIC_H 11 | 12 | namespace Scintilla { 13 | 14 | namespace HanjaDict { 15 | 16 | int GetHangulOfHanja(wchar_t *inout); 17 | 18 | } 19 | 20 | } 21 | 22 | #endif 23 | -------------------------------------------------------------------------------- /Pythonwin/Scintilla/win32/SciTE.properties: -------------------------------------------------------------------------------- 1 | command.build.SConstruct=scons.bat . 2 | command.name.1.SConstruct=scons clean 3 | command.1.SConstruct=scons.bat --clean . 4 | 5 | command.build.*.mak=nmake -f $(FileNameExt) DEBUG=1 QUIET=1 6 | command.name.1.*.mak=nmake clean 7 | command.1.*.mak=nmake -f $(FileNameExt) clean 8 | command.name.2.*.mak=Borland Make 9 | command.2.*.mak=make -f $(FileNameExt) 10 | command.subsystem.2.*.mak=0 11 | command.name.3.*.mak=make clean 12 | command.3.*.mak=make -f $(FileNameExt) clean 13 | command.name.4.*.mak=make debug 14 | command.4.*.mak=make DEBUG=1 -f $(FileNameExt) 15 | command.name.5.*.mak=nmake debug 16 | command.5.*.mak=nmake DEBUG=1 -f $(FileNameExt) 17 | # SciTE.properties is the per directory local options file and can be used to override 18 | # settings made in SciTEGlobal.properties 19 | command.build.*.cxx=nmake -f scintilla.mak DEBUG=1 QUIET=1 20 | command.build.*.h=nmake -f scintilla.mak DEBUG=1 QUIET=1 21 | command.build.*.rc=nmake -f scintilla.mak DEBUG=1 QUIET=1 22 | -------------------------------------------------------------------------------- /Pythonwin/Scintilla/win32/Scintilla.def: -------------------------------------------------------------------------------- 1 | EXPORTS 2 | Scintilla_DirectFunction -------------------------------------------------------------------------------- /Pythonwin/Scintilla/win32/ScintillaWin.h: -------------------------------------------------------------------------------- 1 | // Scintilla source code edit control 2 | /** @file ScintillaWin.h 3 | ** Define functions from ScintillaWin.cxx that can be called from ScintillaDLL.cxx. 4 | **/ 5 | // Copyright 1998-2018 by Neil Hodgson 6 | // The License.txt file describes the conditions under which this software may be distributed. 7 | 8 | #ifndef SCINTILLAWIN_H 9 | #define SCINTILLAWIN_H 10 | 11 | class ScintillaWin; 12 | 13 | namespace Scintilla { 14 | 15 | int ResourcesRelease(bool fromDllMain) noexcept; 16 | sptr_t DirectFunction(ScintillaWin *sci, UINT iMessage, uptr_t wParam, sptr_t lParam); 17 | 18 | } 19 | 20 | #endif 21 | -------------------------------------------------------------------------------- /Pythonwin/doc/debugger/postmortem.gif: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/mhammond/pywin32/50777ab2e67c8b8d4ca429a598cc97ce33719963/Pythonwin/doc/debugger/postmortem.gif -------------------------------------------------------------------------------- /Pythonwin/doc/debugger/pythonwin.gif: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/mhammond/pywin32/50777ab2e67c8b8d4ca429a598cc97ce33719963/Pythonwin/doc/debugger/pythonwin.gif -------------------------------------------------------------------------------- /Pythonwin/doc/debugger/tut1.gif: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/mhammond/pywin32/50777ab2e67c8b8d4ca429a598cc97ce33719963/Pythonwin/doc/debugger/tut1.gif -------------------------------------------------------------------------------- /Pythonwin/doc/debugger/tutbp1.gif: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/mhammond/pywin32/50777ab2e67c8b8d4ca429a598cc97ce33719963/Pythonwin/doc/debugger/tutbp1.gif -------------------------------------------------------------------------------- /Pythonwin/doc/guienvironment.html: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/mhammond/pywin32/50777ab2e67c8b8d4ca429a598cc97ce33719963/Pythonwin/doc/guienvironment.html -------------------------------------------------------------------------------- /Pythonwin/doc/pythonwin.gif: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/mhammond/pywin32/50777ab2e67c8b8d4ca429a598cc97ce33719963/Pythonwin/doc/pythonwin.gif -------------------------------------------------------------------------------- /Pythonwin/pythonRichEditCntr.h: -------------------------------------------------------------------------------- 1 | // PythonRichEditCntr - Python container object. 2 | 3 | // PyCRichEditCntrItem 4 | class CPythonCntrItem : public CRichEditCntrItem { 5 | DECLARE_SERIAL(CPythonCntrItem) 6 | 7 | // Constructors 8 | public: 9 | CPythonCntrItem(REOBJECT *preo = NULL, CRichEditDoc *pContainer = NULL); 10 | // Note: pContainer is allowed to be NULL to enable IMPLEMENT_SERIALIZE. 11 | // IMPLEMENT_SERIALIZE requires the class have a constructor with 12 | // zero arguments. Normally, OLE items are constructed with a 13 | // non-NULL document pointer. 14 | 15 | // Attributes 16 | public: 17 | CRichEditDoc *GetDocument() { return (CRichEditDoc *)COleClientItem::GetDocument(); } 18 | CRichEditView *GetActiveView() { return (CRichEditView *)COleClientItem::GetActiveView(); } 19 | 20 | // ClassWizard generated virtual function overrides 21 | //{{AFX_VIRTUAL(CWordPadCntrItem) 22 | public: 23 | protected: 24 | //}}AFX_VIRTUAL 25 | 26 | // Implementation 27 | public: 28 | #ifdef _DEBUG 29 | virtual void AssertValid() const; 30 | virtual void Dump(CDumpContext &dc) const; 31 | #endif 32 | }; 33 | -------------------------------------------------------------------------------- /Pythonwin/pythonRichEditDoc.cpp: -------------------------------------------------------------------------------- 1 | // PythonRichEditDoc.cpp 2 | #include "stdafx.h" 3 | #include "pythondoc.h" 4 | #include "pythonRichEditCntr.h" 5 | #include "pythonRichEditDoc.h" 6 | // @doc 7 | 8 | IMPLEMENT_DYNCREATE(CPythonRichEditDoc, CRichEditDoc); 9 | 10 | BEGIN_MESSAGE_MAP(CPythonRichEditDoc, CRichEditDoc) 11 | //{{AFX_MSG_MAP(CPythonDoc) 12 | ON_UPDATE_COMMAND_UI(ID_FILE_SAVE, OnUpdateFileSave) 13 | //}}AFX_MSG_MAP 14 | END_MESSAGE_MAP() 15 | 16 | void CPythonRichEditDoc::OnUpdateFileSave(CCmdUI *pCmdUI) { pCmdUI->Enable(IsModified()); } 17 | 18 | CRichEditCntrItem *CPythonRichEditDoc::CreateClientItem(REOBJECT *preo) const 19 | { 20 | return new CPythonCntrItem(preo, (CPythonRichEditDoc *)this); 21 | } 22 | -------------------------------------------------------------------------------- /Pythonwin/pythonRichEditDoc.h: -------------------------------------------------------------------------------- 1 | 2 | class CPythonRichEditDoc : public CPythonDocTemp { 3 | DECLARE_DYNCREATE(CPythonRichEditDoc); 4 | virtual CRichEditCntrItem *CreateClientItem(REOBJECT *preo = NULL) const; 5 | 6 | protected: 7 | //{{AFX_MSG(CPythonRichEditDoc) 8 | afx_msg void OnUpdateFileSave(CCmdUI *pCmdUI); 9 | //}}AFX_MSG 10 | DECLARE_MESSAGE_MAP() 11 | }; 12 | -------------------------------------------------------------------------------- /Pythonwin/pythondoc.cpp: -------------------------------------------------------------------------------- 1 | // pythondoc.cpp : implementation of the CPythonDoc class 2 | // 3 | // Note that this source file contains embedded documentation. 4 | // This documentation consists of marked up text inside the 5 | // C comments, and is prefixed with an '@' symbol. The source 6 | // files are processed by a tool called "autoduck" which 7 | // generates Windows .hlp files. 8 | // @doc 9 | 10 | #include "stdafx.h" 11 | 12 | #include "pythonwin.h" 13 | #include "pythondoc.h" 14 | #include "win32ui.h" 15 | 16 | #ifdef _DEBUG 17 | #undef THIS_FILE 18 | static char BASED_CODE THIS_FILE[] = __FILE__; 19 | #endif 20 | 21 | IMPLEMENT_DYNCREATE(CPythonDoc, CDocument); 22 | 23 | BEGIN_MESSAGE_MAP(CPythonDoc, CDocument) 24 | //{{AFX_MSG_MAP(CPythonDoc) 25 | ON_UPDATE_COMMAND_UI(ID_FILE_SAVE, OnUpdateFileSave) 26 | //}}AFX_MSG_MAP 27 | END_MESSAGE_MAP() 28 | 29 | void CPythonDoc::OnUpdateFileSave(CCmdUI *pCmdUI) { pCmdUI->Enable(IsModified()); } 30 | -------------------------------------------------------------------------------- /Pythonwin/pythonframe.h: -------------------------------------------------------------------------------- 1 | // pythonframe.h : header file 2 | // 3 | #ifndef __PYTHONFRAME_H__ 4 | #define __PYTHONFRAME_H__ 5 | 6 | // With the new template mechanism, the Python frame classes 7 | // become (nearly) 1 liners :-) 8 | 9 | class CPythonFrameWnd : public CPythonWndFramework { 10 | DECLARE_DYNAMIC(CPythonFrameWnd); 11 | 12 | public: 13 | // m_pFloatingFrameClass is protected so we can't access 14 | // it from the outside 15 | void SetFloatingFrameClass(CRuntimeClass *frameClass) { m_pFloatingFrameClass = frameClass; } 16 | }; 17 | 18 | class CPythonMDIChildWnd : public CPythonFrameFramework { 19 | DECLARE_DYNAMIC(CPythonMDIChildWnd); 20 | }; 21 | 22 | class CPythonMDIFrameWnd : public CPythonFrameFramework { 23 | DECLARE_DYNAMIC(CPythonMDIFrameWnd); 24 | }; 25 | 26 | ///////////////////////////////////////////////////////////////////////////// 27 | #endif // __filename_h__ 28 | -------------------------------------------------------------------------------- /Pythonwin/pythonppage.h: -------------------------------------------------------------------------------- 1 | // pythonppage.h : header file 2 | // 3 | #ifndef __PYTHONPPAGE_H__ 4 | #define __PYTHONPPAGE_H__ 5 | 6 | // bit of a hack 7 | #ifdef _DEBUG 8 | BOOL AFXAPI _AfxCheckDialogTemplate(LPCTSTR lpszResource, BOOL bInvisibleChild); 9 | #endif 10 | 11 | ///////////////////////////////////////////////////////////////////////////// 12 | // CPythonPropertyPage dialog 13 | 14 | class CPythonPropertyPage : public CPythonPropertyPageFramework { 15 | DECLARE_DYNAMIC(CPythonPropertyPage) 16 | 17 | protected: 18 | // Support for indirect creation 19 | HGLOBAL hSaved; 20 | 21 | // Construction 22 | public: 23 | CPythonPropertyPage(UINT id, UINT caption = 0); 24 | CPythonPropertyPage(LPCTSTR id, UINT caption = 0); 25 | ~CPythonPropertyPage(); 26 | virtual void PostNcDestroy(); 27 | 28 | BOOL SetTemplate(HGLOBAL tpl); 29 | 30 | private: 31 | void CommonConstruct(); 32 | #ifdef _DEBUG 33 | virtual void Dump(CDumpContext &dc) const; 34 | #endif 35 | }; 36 | #endif // __filename_h__ 37 | -------------------------------------------------------------------------------- /Pythonwin/pywin/Demos/app/readme.txt: -------------------------------------------------------------------------------- 1 | These files are all demos of a Pythonwin "Application". 2 | 3 | To run these demos, you should use the command line: 4 | 5 | pythonwin /app filename.py 6 | 7 | where filename.py is one of the demos in this directory. 8 | -------------------------------------------------------------------------------- /Pythonwin/pywin/Demos/menutest.py: -------------------------------------------------------------------------------- 1 | # Run this as a python script, to gray "close" off the edit window system menu. 2 | import win32con 3 | from pywin.framework import interact 4 | 5 | if __name__ == "__main__": 6 | import demoutils 7 | 8 | if demoutils.NeedGoodGUI(): 9 | win = interact.edit.currentView.GetParent() 10 | menu = win.GetSystemMenu() 11 | id = menu.GetMenuItemID(6) 12 | menu.EnableMenuItem(id, win32con.MF_BYCOMMAND | win32con.MF_GRAYED) 13 | print("The interactive window's 'Close' menu item is now disabled.") 14 | -------------------------------------------------------------------------------- /Pythonwin/pywin/Demos/readme.txt: -------------------------------------------------------------------------------- 1 | For a good example of all the demos, start Pythonwin, and run the 2 | script guidemo.py 3 | -------------------------------------------------------------------------------- /Pythonwin/pywin/IDLE.cfg: -------------------------------------------------------------------------------- 1 | [General] 2 | # We base this configuration on the default config. 3 | # You can list "Based On" as many times as you like 4 | Based On = default 5 | 6 | [Keys] 7 | # Only list keys different to default. 8 | # Note you may wish to rebind some of the default 9 | # Pythonwin keys to "Beep" or "DoNothing" 10 | 11 | Alt+L = LocateSelectedFile 12 | Ctrl+Q = AppExit 13 | 14 | # Other non-default Pythonwin keys 15 | Alt+A = EditSelectAll 16 | Alt+M = LocateModule 17 | 18 | # Movement 19 | Ctrl+D = GotoEndOfFile 20 | 21 | # Tabs and other indent features 22 | Alt+T = <> 23 | Ctrl+[ = <> 24 | Ctrl+] = <> 25 | 26 | [Keys:Interactive] 27 | Alt+P = <> 28 | Alt+N = <> 29 | -------------------------------------------------------------------------------- /Pythonwin/pywin/__init__.py: -------------------------------------------------------------------------------- 1 | # Referenced and used variable - but in practice can't be changed. 2 | # Scintilla _only_ supports "utf-8" ATM 3 | default_scintilla_encoding = "utf-8" 4 | -------------------------------------------------------------------------------- /Pythonwin/pywin/debugger/dbgcon.py: -------------------------------------------------------------------------------- 1 | # General constants for the debugger 2 | 3 | DBGSTATE_NOT_DEBUGGING = 0 4 | DBGSTATE_RUNNING = 1 5 | DBGSTATE_BREAK = 2 6 | DBGSTATE_QUITTING = 3 # Attempting to back out of the debug session. 7 | 8 | LINESTATE_CURRENT = 0x1 # This line is where we are stopped 9 | LINESTATE_BREAKPOINT = 0x2 # This line is a breakpoint 10 | LINESTATE_CALLSTACK = 0x4 # This line is in the callstack. 11 | 12 | OPT_HIDE = "hide" 13 | OPT_STOP_EXCEPTIONS = "stopatexceptions" 14 | 15 | import win32ui 16 | 17 | 18 | def DoGetOption(optsDict, optName, default): 19 | optsDict[optName] = win32ui.GetProfileVal("Debugger Options", optName, default) 20 | 21 | 22 | def LoadDebuggerOptions(): 23 | opts = {} 24 | DoGetOption(opts, OPT_HIDE, 0) 25 | DoGetOption(opts, OPT_STOP_EXCEPTIONS, 1) 26 | return opts 27 | 28 | 29 | def SaveDebuggerOptions(opts): 30 | for key, val in opts.items(): 31 | win32ui.WriteProfileVal("Debugger Options", key, val) 32 | -------------------------------------------------------------------------------- /Pythonwin/pywin/dialogs/__init__.py: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/mhammond/pywin32/50777ab2e67c8b8d4ca429a598cc97ce33719963/Pythonwin/pywin/dialogs/__init__.py -------------------------------------------------------------------------------- /Pythonwin/pywin/docking/__init__.py: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/mhammond/pywin32/50777ab2e67c8b8d4ca429a598cc97ce33719963/Pythonwin/pywin/docking/__init__.py -------------------------------------------------------------------------------- /Pythonwin/pywin/framework/__init__.py: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/mhammond/pywin32/50777ab2e67c8b8d4ca429a598cc97ce33719963/Pythonwin/pywin/framework/__init__.py -------------------------------------------------------------------------------- /Pythonwin/pywin/framework/editor/color/__init__.py: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/mhammond/pywin32/50777ab2e67c8b8d4ca429a598cc97ce33719963/Pythonwin/pywin/framework/editor/color/__init__.py -------------------------------------------------------------------------------- /Pythonwin/pywin/framework/window.py: -------------------------------------------------------------------------------- 1 | # Framework Window classes. 2 | 3 | # Most Pythonwin windows should use these classes rather than 4 | # the raw MFC ones if they want Pythonwin specific functionality. 5 | import pywin.mfc.window 6 | import win32con 7 | 8 | 9 | class MDIChildWnd(pywin.mfc.window.MDIChildWnd): 10 | def AutoRestore(self): 11 | "If the window is minimised or maximised, restore it." 12 | p = self.GetWindowPlacement() 13 | if p[1] == win32con.SW_MINIMIZE or p[1] == win32con.SW_SHOWMINIMIZED: 14 | self.SetWindowPlacement(p[0], win32con.SW_RESTORE, p[2], p[3], p[4]) 15 | -------------------------------------------------------------------------------- /Pythonwin/pywin/idle/__init__.py: -------------------------------------------------------------------------------- 1 | # This file denotes the directory as a Python package. 2 | -------------------------------------------------------------------------------- /Pythonwin/pywin/idle/readme.txt: -------------------------------------------------------------------------------- 1 | Pythonwin IDLE directory 2 | ------------------------ 3 | 4 | This directory contains IDLE extensions used by 5 | Pythonwin. The files in this directory that also appear in the main IDLE 6 | directory are intended be indentical to the latest available for IDLE. 7 | 8 | If you use IDLE from the CVS sources, then the files should be 9 | identical. If you have a Python version installed that is more recent 10 | than when this release was made, then you may notice differences. 11 | 12 | Pythonwin will look for IDLE extensions first in this directory, then on 13 | the global sys.path. Thus, if you have IDLE installed and run it from 14 | the CVS sources, you may remove most of the extensions from this 15 | directory, and the latest CVS version will then be used. 16 | -------------------------------------------------------------------------------- /Pythonwin/pywin/mfc/__init__.py: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/mhammond/pywin32/50777ab2e67c8b8d4ca429a598cc97ce33719963/Pythonwin/pywin/mfc/__init__.py -------------------------------------------------------------------------------- /Pythonwin/pywin/mfc/thread.py: -------------------------------------------------------------------------------- 1 | # Thread and application objects 2 | 3 | import win32ui 4 | 5 | from . import object 6 | 7 | 8 | class WinThread(object.CmdTarget): 9 | def __init__(self, initObj=None): 10 | if initObj is None: 11 | initObj = win32ui.CreateThread() 12 | object.CmdTarget.__init__(self, initObj) 13 | 14 | def InitInstance(self): 15 | pass # Default None/0 return indicates success for InitInstance() 16 | 17 | def ExitInstance(self): 18 | pass 19 | 20 | 21 | class WinApp(WinThread): 22 | def __init__(self, initApp=None): 23 | if initApp is None: 24 | initApp = win32ui.GetApp() 25 | WinThread.__init__(self, initApp) 26 | -------------------------------------------------------------------------------- /Pythonwin/pywin/scintilla/__init__.py: -------------------------------------------------------------------------------- 1 | # package init. 2 | -------------------------------------------------------------------------------- /Pythonwin/pywin/test/_dbgscript.py: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/mhammond/pywin32/50777ab2e67c8b8d4ca429a598cc97ce33719963/Pythonwin/pywin/test/_dbgscript.py -------------------------------------------------------------------------------- /Pythonwin/pywin/test/all.py: -------------------------------------------------------------------------------- 1 | # 2 | # Tests Pythonwin / win32ui 3 | # 4 | 5 | import argparse 6 | import os 7 | import sys 8 | import unittest 9 | 10 | user_interaction = False 11 | 12 | _indebugger = "pywin.debugger" in sys.modules 13 | file_abs = os.path.abspath(__file__) 14 | src_dir = os.path.dirname(file_abs) 15 | 16 | 17 | if __name__ == "__main__": 18 | if _indebugger: 19 | pass 20 | 21 | p = argparse.ArgumentParser( 22 | description="Test runner for pywin32/Pythonwin", add_help=False 23 | ) 24 | p.add_argument( 25 | "-user-interaction", 26 | "-i", 27 | action="store_true", 28 | help="Include tests which require user interaction", 29 | ) 30 | args, remains = p.parse_known_args() 31 | user_interaction = args.user_interaction 32 | if user_interaction: 33 | print("-- running with user_interaction", file=sys.stderr) 34 | if "-h" in sys.argv or "--help" in sys.argv: 35 | p.print_help() 36 | 37 | argv = sys.argv[:1] + ["discover", "--start-directory", src_dir] + remains 38 | unittest.main(None, argv=argv) # discover when no tests here 39 | -------------------------------------------------------------------------------- /Pythonwin/pywin/tools/__init__.py: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/mhammond/pywin32/50777ab2e67c8b8d4ca429a598cc97ce33719963/Pythonwin/pywin/tools/__init__.py -------------------------------------------------------------------------------- /Pythonwin/res/BROWSER.BMP: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/mhammond/pywin32/50777ab2e67c8b8d4ca429a598cc97ce33719963/Pythonwin/res/BROWSER.BMP -------------------------------------------------------------------------------- /Pythonwin/res/HIERFOLD.BMP: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/mhammond/pywin32/50777ab2e67c8b8d4ca429a598cc97ce33719963/Pythonwin/res/HIERFOLD.BMP -------------------------------------------------------------------------------- /Pythonwin/res/ICO00002.ICO: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/mhammond/pywin32/50777ab2e67c8b8d4ca429a598cc97ce33719963/Pythonwin/res/ICO00002.ICO -------------------------------------------------------------------------------- /Pythonwin/res/IDR_MAIN.ICO: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/mhammond/pywin32/50777ab2e67c8b8d4ca429a598cc97ce33719963/Pythonwin/res/IDR_MAIN.ICO -------------------------------------------------------------------------------- /Pythonwin/res/IDR_PYTH.ICO: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/mhammond/pywin32/50777ab2e67c8b8d4ca429a598cc97ce33719963/Pythonwin/res/IDR_PYTH.ICO -------------------------------------------------------------------------------- /Pythonwin/res/PADDOC.ICO: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/mhammond/pywin32/50777ab2e67c8b8d4ca429a598cc97ce33719963/Pythonwin/res/PADDOC.ICO -------------------------------------------------------------------------------- /Pythonwin/res/debugger.ico: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/mhammond/pywin32/50777ab2e67c8b8d4ca429a598cc97ce33719963/Pythonwin/res/debugger.ico -------------------------------------------------------------------------------- /Pythonwin/res/debugger_stack.bmp: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/mhammond/pywin32/50777ab2e67c8b8d4ca429a598cc97ce33719963/Pythonwin/res/debugger_stack.bmp -------------------------------------------------------------------------------- /Pythonwin/res/pyc.ico: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/mhammond/pywin32/50777ab2e67c8b8d4ca429a598cc97ce33719963/Pythonwin/res/pyc.ico -------------------------------------------------------------------------------- /Pythonwin/res/pycon.ico: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/mhammond/pywin32/50777ab2e67c8b8d4ca429a598cc97ce33719963/Pythonwin/res/pycon.ico -------------------------------------------------------------------------------- /Pythonwin/res/temp.BMP: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/mhammond/pywin32/50777ab2e67c8b8d4ca429a598cc97ce33719963/Pythonwin/res/temp.BMP -------------------------------------------------------------------------------- /Pythonwin/res/toolbar.bmp: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/mhammond/pywin32/50777ab2e67c8b8d4ca429a598cc97ce33719963/Pythonwin/res/toolbar.bmp -------------------------------------------------------------------------------- /Pythonwin/res/toolbar_debugger.bmp: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/mhammond/pywin32/50777ab2e67c8b8d4ca429a598cc97ce33719963/Pythonwin/res/toolbar_debugger.bmp -------------------------------------------------------------------------------- /Pythonwin/respw.h: -------------------------------------------------------------------------------- 1 | //{{NO_DEPENDENCIES}} 2 | // Microsoft Developer Studio generated include file. 3 | // Used by pythonwin.rc 4 | // 5 | #define IDR_MAINFRAME 11128 6 | #define IDS_STARTUP_SCRIPT 57346 7 | 8 | // Next default values for new objects 9 | // 10 | #ifdef APSTUDIO_INVOKED 11 | #ifndef APSTUDIO_READONLY_SYMBOLS 12 | #define _APS_NEXT_RESOURCE_VALUE 102 13 | #define _APS_NEXT_COMMAND_VALUE 40001 14 | #define _APS_NEXT_CONTROL_VALUE 1000 15 | #define _APS_NEXT_SYMED_VALUE 101 16 | #endif 17 | #endif 18 | -------------------------------------------------------------------------------- /Pythonwin/start_pythonwin.pyw: -------------------------------------------------------------------------------- 1 | # A Python file that can be used to start Pythonwin, instead of using 2 | # pythonwin.exe 3 | import os 4 | import sys 5 | 6 | import win32ui 7 | 8 | import pywin.framework.intpyapp # InteractivePythonApp() 9 | 10 | assert pywin.framework.intpyapp # not unused 11 | # Pretend this script doesn't exist, or pythonwin tries to edit it 12 | sys.argv[:] = sys.argv[1:] or [""] # like PySys_SetArgv(Ex) 13 | if sys.path[0] not in ("", ".", os.getcwd()): 14 | sys.path.insert(0, os.getcwd()) 15 | # And bootstrap the app. 16 | app = win32ui.GetApp() 17 | if not app.InitInstance(): 18 | # Run when not already handled by DDE 19 | app.Run() 20 | -------------------------------------------------------------------------------- /Pythonwin/stdafx.cpp: -------------------------------------------------------------------------------- 1 | // stdafx.cpp : source file that includes just the standard includes 2 | // stdafx.pch will be the pre-compiled header 3 | // stdafx.obj will contain the pre-compiled type information 4 | 5 | #include "stdafx.h" 6 | -------------------------------------------------------------------------------- /Pythonwin/stdafxdde.h: -------------------------------------------------------------------------------- 1 | #define _USING_V110_SDK71_ 2 | 3 | #include // MFC core and standard components 4 | #include // MFC extensions 5 | #include // Thread safety! 6 | 7 | #include 8 | #include 9 | 10 | // windows defines "small" as "char" which breaks Python's accu.h 11 | #undef small 12 | #include 13 | 14 | // The Pythonwin stuff 15 | #include "oleauto.h" 16 | #include "pywintypes.h" 17 | #include "win32ui.h" 18 | #include "win32assoc.h" 19 | 20 | #include "stddde.h" 21 | -------------------------------------------------------------------------------- /Pythonwin/stdafxole.cpp: -------------------------------------------------------------------------------- 1 | // stdafx.cpp : source file that includes just the standard includes 2 | // stdafx.pch will be the pre-compiled header 3 | // stdafx.obj will contain the pre-compiled type information 4 | 5 | #include "stdafxole.h" 6 | #include "olectl.h" 7 | -------------------------------------------------------------------------------- /Pythonwin/stdafxpw.cpp: -------------------------------------------------------------------------------- 1 | // stdafxpw.cpp : source file that includes just the standard includes 2 | // Python for Windows version. 3 | // stdafxpw.pch will be the pre-compiled header 4 | // stdafxpw.obj will contain the pre-compiled type information 5 | 6 | #include "stdafxpw.h" 7 | -------------------------------------------------------------------------------- /Pythonwin/stdafxpw.h: -------------------------------------------------------------------------------- 1 | // stdafx.h : include file for standard system include files, 2 | // or project specific include files that are used frequently, but 3 | // are changed infrequently 4 | // 5 | #define HIER_LIST 6 | #define WIN32_LEAN_AND_MEAN 7 | #define _USING_V110_SDK71_ 8 | 9 | #include // MFC core and standard components 10 | #include // MFC extensions 11 | #include "afxpriv.h" // for mru class. 12 | 13 | #include "limits.h" 14 | 15 | // allow memory leaks to give me the line number. 16 | #define new DEBUG_NEW 17 | -------------------------------------------------------------------------------- /Pythonwin/win32ImageList.h: -------------------------------------------------------------------------------- 1 | /* win32ImageList : header 2 | 3 | Image List object. 4 | 5 | Created May 1996, Mark Hammond (MHammond@skippinet.com.au) 6 | 7 | Note that this source file contains embedded documentation. 8 | This documentation consists of marked up text inside the 9 | C comments, and is prefixed with an '@' symbol. The source 10 | files are processed by a tool called "autoduck" which 11 | generates Windows .hlp files. 12 | @doc 13 | 14 | */ 15 | 16 | class PythonImageList : public CImageList { 17 | public: 18 | PythonImageList(); 19 | ~PythonImageList(); 20 | #ifdef _DEBUG 21 | virtual void Dump(CDumpContext &dc) const; 22 | #endif 23 | }; 24 | 25 | /////////////////////////////////////////////////////////////////////// 26 | // ImageList 27 | // 28 | 29 | class PYW_EXPORT PyCImageList : public ui_assoc_CObject { 30 | public: 31 | MAKE_PY_CTOR(PyCImageList) 32 | static CImageList *GetImageList(PyObject *self); 33 | static ui_type_CObject type; 34 | 35 | protected: 36 | PyCImageList(); 37 | virtual ~PyCImageList(); 38 | }; 39 | -------------------------------------------------------------------------------- /Pythonwin/win32RichEdit.h: -------------------------------------------------------------------------------- 1 | // win32RichText.h : header file 2 | // 3 | // 4 | ///////////////////////////////////////////////////////// 5 | // 6 | ///////////////////////////////////////////////////////////////////////////// 7 | // PyCRichEditDoc object 8 | class PYW_EXPORT PyCRichEditDoc : public PyCDocument { 9 | protected: 10 | public: 11 | MAKE_PY_CTOR(PyCRichEditDoc); 12 | static ui_type_CObject type; 13 | }; 14 | 15 | // PyCRichEditView 16 | class PYW_EXPORT PyCRichEditView : public PyCCtrlView { 17 | public: 18 | MAKE_PY_CTOR(PyCRichEditView) 19 | static PyCCtrlView_Type type; 20 | static PyObject *create(PyObject *self, PyObject *args); 21 | 22 | protected: 23 | PyCRichEditView() { return; } 24 | }; 25 | -------------------------------------------------------------------------------- /Pythonwin/win32RichEditDocTemplate.h: -------------------------------------------------------------------------------- 1 | 2 | class PyCRichEditDocTemplate : public PyCDocTemplate { 3 | protected: 4 | public: 5 | static PyObject *create(PyObject *self, PyObject *args); 6 | static PyObject *DoCreateRichEditDoc(PyObject *self, PyObject *args); 7 | 8 | static ui_type_CObject type; 9 | MAKE_PY_CTOR(PyCRichEditDocTemplate) 10 | }; 11 | -------------------------------------------------------------------------------- /Pythonwin/win32bitmap.h: -------------------------------------------------------------------------------- 1 | // win32bitmap.h : header file 2 | // 3 | // 4 | ///////////////////////////////////////////////////////// 5 | // 6 | // ui_bitmap 7 | class ui_bitmap : public PyCGdiObject { 8 | public: 9 | static ui_type_CObject type; 10 | MAKE_PY_CTOR(ui_bitmap) 11 | static PyObject *create(PyObject *self, PyObject *args); 12 | static PyObject *create_from_handle(PyObject *self, PyObject *args); 13 | 14 | void ClearSupportData(); 15 | 16 | CPalette *pPal; 17 | CSize sizeBitmap; 18 | 19 | protected: 20 | ui_bitmap(); 21 | ~ui_bitmap(); 22 | 23 | private: 24 | }; 25 | -------------------------------------------------------------------------------- /Pythonwin/win32brush.h: -------------------------------------------------------------------------------- 1 | // -*- Mode: C++; tab-width: 4 -*- 2 | // font class 3 | 4 | class PyCBrush : public PyCGdiObject { 5 | public: 6 | static ui_type_CObject type; 7 | MAKE_PY_CTOR(PyCBrush) 8 | CBrush *GetBrush() { return GetBrush(this); } 9 | static CBrush *GetBrush(PyObject *self); 10 | 11 | static PyObject *create(PyObject *self, PyObject *args); 12 | 13 | protected: 14 | private: 15 | }; 16 | -------------------------------------------------------------------------------- /Pythonwin/win32cmd.h: -------------------------------------------------------------------------------- 1 | // 2 | // Command target header file 3 | // 4 | 5 | // 6 | // Command target 7 | // 8 | class PYW_EXPORT PyCCmdTarget : public ui_assoc_CObject { 9 | friend CVirtualHelper::CVirtualHelper(const char *iname, void *iassoc, EnumVirtualErrorHandling veh); 10 | 11 | public: // some probably shouldn't be, but... 12 | CMapWordToPtr *pNotifyHookList; 13 | CMapWordToPtr *pCommandHookList; 14 | CMapWordToPtr *pOleEventHookList; 15 | CMapWordToPtr *pCommandUpdateHookList; 16 | 17 | // virtuals for Python support 18 | virtual CString repr(); 19 | 20 | static ui_type_CObject type; 21 | 22 | protected: 23 | PyCCmdTarget(); 24 | virtual ~PyCCmdTarget(); 25 | }; 26 | extern void free_hook_list(PyObject *objectHooked, CMapWordToPtr **ppList); 27 | extern PyObject *add_hook_list(PyObject *objectHooked, PyObject *args, CMapWordToPtr **ppList); 28 | -------------------------------------------------------------------------------- /Pythonwin/win32cmdui.h: -------------------------------------------------------------------------------- 1 | // CCmdUI definition. 2 | // 3 | class PyCCmdUI : public ui_assoc_object { 4 | public: 5 | MAKE_PY_CTOR(PyCCmdUI); 6 | static ui_type type; 7 | static CCmdUI *GetCCmdUIPtr(PyObject *self); 8 | 9 | protected: 10 | PyCCmdUI(); 11 | virtual ~PyCCmdUI(); 12 | virtual PyObject *getattro(PyObject *obname); 13 | }; 14 | -------------------------------------------------------------------------------- /Pythonwin/win32ctrlTree.h: -------------------------------------------------------------------------------- 1 | /* win32ctrltree : header 2 | 3 | Tree control object. 4 | 5 | Created May 1996, Mark Hammond (MHammond@skippinet.com.au) 6 | 7 | Note that this source file contains embedded documentation. 8 | This documentation consists of marked up text inside the 9 | C comments, and is prefixed with an '@' symbol. The source 10 | files are processed by a tool called "autoduck" which 11 | generates Windows .hlp files. 12 | @doc 13 | 14 | */ 15 | /////////////////////////////////////////////////////////////////////// 16 | // Control objects. 17 | // 18 | // PyCTreeCtrl 19 | // 20 | class PyCTreeCtrl : public PyCWnd { 21 | public: 22 | static ui_type_CObject type; 23 | MAKE_PY_CTOR(PyCTreeCtrl) 24 | 25 | protected: 26 | PyCTreeCtrl(); 27 | virtual ~PyCTreeCtrl(); 28 | }; 29 | -------------------------------------------------------------------------------- /Pythonwin/win32dc.h: -------------------------------------------------------------------------------- 1 | // device context class 2 | class PYW_EXPORT ui_dc_object : public ui_assoc_CObject { 3 | protected: 4 | ui_dc_object() : m_deleteDC(FALSE) {} 5 | ~ui_dc_object(); 6 | virtual void SetAssocInvalid(); 7 | 8 | public: 9 | static ui_type_CObject type; 10 | MAKE_PY_CTOR(ui_dc_object) 11 | static CDC *GetDC(PyObject *self); 12 | 13 | // couple of python methods 14 | static PyObject *create_dc(PyObject *self, PyObject *args); 15 | static PyObject *create_compatible_dc(PyObject *self, PyObject *args); 16 | static PyObject *create_printer_dc(PyObject *self, PyObject *args); 17 | BOOL m_deleteDC; 18 | }; 19 | -------------------------------------------------------------------------------- /Pythonwin/win32dlgbar.h: -------------------------------------------------------------------------------- 1 | // CDialogBar support for Pythonwin 2 | 3 | class PyCDialogBar : public PyCControlBar { 4 | public: 5 | MAKE_PY_CTOR(PyCDialogBar) 6 | static ui_type_CObject type; 7 | static PyObject *create(PyObject *self, PyObject *args); 8 | static CDialogBar *GetDialogBar(PyObject *self); 9 | 10 | protected: 11 | // virtual CString repr(); maybe add later to show id? 12 | 13 | private: 14 | }; 15 | -------------------------------------------------------------------------------- /Pythonwin/win32dll.h: -------------------------------------------------------------------------------- 1 | // dll holder class 2 | // by Dave Brennan (brennan@hal.com) 3 | 4 | class dll_object : public ui_assoc_object { 5 | public: 6 | MAKE_PY_CTOR(dll_object) 7 | static ui_type type; 8 | static PyObject *create(PyObject *self, PyObject *args); 9 | AFX_EXTENSION_MODULE *pMFCExt; 10 | CDynLinkLibrary *pCDLL; 11 | HINSTANCE GetDll() { return (HINSTANCE)GetGoodCppObject(&type); } 12 | 13 | protected: 14 | dll_object(); 15 | ~dll_object(); 16 | virtual CString repr(); 17 | 18 | private: 19 | BOOL bDidLoadLibrary; 20 | }; 21 | -------------------------------------------------------------------------------- /Pythonwin/win32doc.h: -------------------------------------------------------------------------------- 1 | // 2 | // Document Object 3 | // 4 | 5 | class PYW_EXPORT PyCDocument : public PyCCmdTarget { 6 | protected: 7 | PyCDocument(); 8 | ~PyCDocument(); 9 | 10 | public: 11 | static PyObject *create_edit(PyObject *self, PyObject *args); 12 | static PyObject *create(PyObject *self, PyObject *args); 13 | 14 | static CDocument *GetDoc(PyObject *self); 15 | static PyObject *ui_doc_create(PyObject *self, PyObject *args); 16 | 17 | MAKE_PY_CTOR(PyCDocument); 18 | static ui_type_CObject type; 19 | }; 20 | -------------------------------------------------------------------------------- /Pythonwin/win32font.h: -------------------------------------------------------------------------------- 1 | // font class 2 | 3 | class PyCFont : public PyCGdiObject { 4 | public: 5 | MAKE_PY_CTOR(PyCFont) 6 | static ui_type_CObject type; 7 | static PyObject *create(PyObject *self, PyObject *args); 8 | 9 | protected: 10 | private: 11 | }; 12 | -------------------------------------------------------------------------------- /Pythonwin/win32hl.h: -------------------------------------------------------------------------------- 1 | ///////////////////////////////////////////////////////// 2 | // 3 | // hierlist 4 | 5 | // fwd declare 6 | class CPythonHierControl; 7 | class CPythonHierListItem; 8 | ///////////////////////// 9 | 10 | class ui_hierlist_object : public PyCWnd { 11 | public: 12 | static PyObject *create(PyObject *self, PyObject *args); 13 | CPythonHierControl *GetListObject(); 14 | static CPythonHierControl *GetListObject(PyObject *self); 15 | 16 | static ui_type_CObject type; 17 | MAKE_PY_CTOR(ui_hierlist_object) 18 | protected: 19 | ui_hierlist_object(); 20 | virtual ~ui_hierlist_object(); 21 | }; 22 | class ui_hierlist_item : public ui_assoc_object { 23 | public: 24 | static CPythonHierListItem *GetHLI(PyObject *self); 25 | 26 | protected: 27 | ui_hierlist_item() { return; } 28 | virtual ~ui_hierlist_item() { return; } 29 | 30 | public: 31 | static ui_type type; 32 | MAKE_PY_CTOR(ui_hierlist_item) 33 | }; 34 | -------------------------------------------------------------------------------- /Pythonwin/win32oleDlgs.cpp: -------------------------------------------------------------------------------- 1 | 2 | #include "stdafxole.h" 3 | 4 | #include "win32dlg.h" 5 | #include "win32oleDlgs.h" 6 | 7 | // @doc 8 | 9 | // @object PyCOleDialog|An abstract class which encapsulates an MFC COleDialog object. Derived from a object. 11 | static struct PyMethodDef PyCOleDialog_methods[] = {{NULL, NULL}}; 12 | 13 | ui_type_CObject PyCOleDialog::type("PyCOleDialog", &PyCCommonDialog::type, RUNTIME_CLASS(COleDialog), 14 | sizeof(PyCOleDialog), PYOBJ_OFFSET(PyCOleDialog), PyCOleDialog_methods, NULL); 15 | -------------------------------------------------------------------------------- /Pythonwin/win32oleDlgs.h: -------------------------------------------------------------------------------- 1 | 2 | class PyCOleDialog : public PyCCommonDialog { 3 | public: 4 | static ui_type_CObject type; 5 | }; 6 | 7 | class PyCOleInsertDialog : public PyCOleDialog { 8 | public: 9 | static PyObject *create(PyObject *self, PyObject *args); 10 | MAKE_PY_CTOR(PyCOleInsertDialog); 11 | static ui_type_CObject type; 12 | }; 13 | -------------------------------------------------------------------------------- /Pythonwin/win32pen.h: -------------------------------------------------------------------------------- 1 | // -*- Mode: C++; tab-width: 4 -*- 2 | // font class 3 | 4 | class ui_pen_object : public PyCGdiObject { 5 | public: 6 | static ui_type_CObject type; 7 | MAKE_PY_CTOR(ui_pen_object) 8 | static PyObject *create(PyObject *self, PyObject *args); 9 | 10 | protected: 11 | private: 12 | }; 13 | -------------------------------------------------------------------------------- /Pythonwin/win32prinfo.h: -------------------------------------------------------------------------------- 1 | // printer info class 2 | class PYW_EXPORT ui_prinfo_object : public ui_assoc_object { 3 | protected: 4 | ui_prinfo_object() : m_deletePrInfo(FALSE) {} 5 | ~ui_prinfo_object(); 6 | virtual void SetAssocInvalid(); 7 | virtual void *GetGoodCppObject(ui_type *ui_type_check = NULL) const; 8 | 9 | public: 10 | static ui_type type; 11 | MAKE_PY_CTOR(ui_prinfo_object) 12 | static CPrintInfo *GetPrintInfo(PyObject *self); 13 | BOOL m_deletePrInfo; 14 | }; 15 | -------------------------------------------------------------------------------- /Pythonwin/win32rgn.h: -------------------------------------------------------------------------------- 1 | #ifndef INC_PYCRGN 2 | #define INC_PYCRGN 3 | 4 | #include "win32gdi.h" 5 | 6 | class PyCRgn : public PyCGdiObject { 7 | public: 8 | static ui_type_CObject type; 9 | MAKE_PY_CTOR(PyCRgn) 10 | CRgn *GetRgn() { return GetRgn(this); } 11 | static CRgn *GetRgn(PyObject *self); 12 | 13 | static PyObject *create(PyObject *self, PyObject *args); 14 | static PyObject *create_elliptic_rgn(PyObject *self, PyObject *args); 15 | 16 | static PyObject *create_rect_rgn(PyObject *self, PyObject *args); 17 | static PyObject *combine_rgn(PyObject *self, PyObject *args); 18 | static PyObject *copy_rgn(PyObject *self, PyObject *args); 19 | static PyObject *get_rgn_box(PyObject *self, PyObject *args); 20 | static PyObject *delete_object(PyObject *self, PyObject *args); 21 | static PyObject *get_safe_handle(PyObject *self, PyObject *args); 22 | }; 23 | 24 | #endif 25 | -------------------------------------------------------------------------------- /Pythonwin/win32uioledoc.h: -------------------------------------------------------------------------------- 1 | // Delcaration of the Python support for a PyCOleDocument object 2 | #pragma once 3 | #include "win32doc.h" 4 | 5 | class PyCOleDocument : public PyCDocument { 6 | protected: 7 | public: 8 | static COleDocument *GetDoc(PyObject *self); 9 | static PyObject *Create(PyObject *self, PyObject *args); 10 | 11 | MAKE_PY_CTOR(PyCOleDocument); 12 | static ui_type_CObject type; 13 | }; 14 | 15 | class PyCOleClientItem : public PyCCmdTarget { 16 | protected: 17 | PyCOleClientItem() { ; } 18 | ~PyCOleClientItem() { ; } 19 | 20 | public: 21 | static COleClientItem *GetOleClientItem(PyObject *self); 22 | 23 | MAKE_PY_CTOR(PyCOleClientItem); 24 | static ui_type_CObject type; 25 | }; 26 | -------------------------------------------------------------------------------- /SWIG/readme.txt: -------------------------------------------------------------------------------- 1 | SWIG for Win32 Extensions Readme 2 | -------------------------------- 3 | 4 | This is a release of SWIG 1.1 with slight customizations for Windows. 5 | This release of SWIG should be used only for building the various Win32 6 | and COM extensions for Windows. For the official releases of SWIG and 7 | more information about SWIG, please visit www.swig.org 8 | 9 | To use this: 10 | ----------- 11 | You need to set 2 environment variables for this to work. 12 | 13 | SWIG_LIB: Required by SWIG, and must be set to point to the "swig_lib" 14 | sub-directory in this archive. 15 | 16 | SWIG_EXE: Required by the Win32 extension makefiles, and should be the 17 | fully qualified path to the .exe in this archive. Note that as this 18 | environment variable is used by MSVC, you probably need to set this 19 | variable globally (ie, either in autoexec.bat, or Control Panel->System- 20 | >Environment. 21 | -------------------------------------------------------------------------------- /SWIG/swig.exe: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/mhammond/pywin32/50777ab2e67c8b8d4ca429a598cc97ce33719963/SWIG/swig.exe -------------------------------------------------------------------------------- /SWIG/swig_lib/python/pyexp.swg: -------------------------------------------------------------------------------- 1 | /* Definitions for Windows/Unix exporting */ 2 | #if defined(__WIN32__) 3 | # if defined(_MSC_VER) 4 | # define SWIGEXPORT(a,b) __declspec(dllexport) a b 5 | # else 6 | # if defined(__BORLANDC__) 7 | # define SWIGEXPORT(a,b) a _export b 8 | # else 9 | # define SWIGEXPORT(a,b) a b 10 | # endif 11 | # endif 12 | #else 13 | # define SWIGEXPORT(a,b) a b 14 | #endif 15 | 16 | #ifdef __cplusplus 17 | extern "C" { 18 | #endif 19 | #include "Python.h" 20 | extern void SWIG_MakePtr(char *, void *, char *); 21 | extern void SWIG_RegisterMapping(char *, char *, void *(*)(void *)); 22 | extern char *SWIG_GetPtr(char *, void **, char *); 23 | extern void SWIG_addvarlink(PyObject *, char *, PyObject *(*)(void), int (*)(PyObject *)); 24 | extern PyObject *SWIG_newvarlink(void); 25 | #ifdef __cplusplus 26 | } 27 | #endif 28 | -------------------------------------------------------------------------------- /SWIG/swig_lib/python/pywin32.i: -------------------------------------------------------------------------------- 1 | // I really should think through file names better :-) 2 | %include "pywintypes.i" 3 | -------------------------------------------------------------------------------- /SWIG/swig_lib/stdlib.i: -------------------------------------------------------------------------------- 1 | // 2 | // $Header$ 3 | // 4 | // stdlib.i 5 | // Dave Beazley 6 | // March 24, 1996 7 | // SWIG file for some C stdlib functions 8 | // 9 | /* Revision history 10 | * $Log$ 11 | * Revision 1.1 1996/05/22 17:27:01 beazley 12 | * Initial revision 13 | * 14 | */ 15 | 16 | %module stdlib 17 | %{ 18 | #include 19 | %} 20 | 21 | typedef unsigned int size_t; 22 | 23 | double atof(const char *s); 24 | int atoi(const char *s); 25 | long atol(const char *s); 26 | int rand(); 27 | void srand(unsigned int seed); 28 | void *calloc(size_t nobj, size_t size); 29 | void *malloc(size_t size); 30 | void *realloc(void *ptr, size_t size); 31 | void free(void *ptr); 32 | void abort(void); 33 | int system(const char *s); 34 | char *getenv(const char *name); 35 | int abs(int n); 36 | long labs(long n); 37 | -------------------------------------------------------------------------------- /adodbapi/examples/db_table_names.py: -------------------------------------------------------------------------------- 1 | """db_table_names.py -- a simple demo for ADO database table listing.""" 2 | 3 | import sys 4 | 5 | import adodbapi 6 | 7 | try: 8 | databasename = sys.argv[1] 9 | except IndexError: 10 | databasename = "test.mdb" 11 | 12 | provider = ["prv", "Microsoft.ACE.OLEDB.12.0", "Microsoft.Jet.OLEDB.4.0"] 13 | constr = "Provider=%(prv)s;Data Source=%(db)s" 14 | 15 | # create the connection 16 | con = adodbapi.connect(constr, db=databasename, macro_is64bit=provider) 17 | 18 | print("Table names in= %s" % databasename) 19 | 20 | for table in con.get_table_names(): 21 | print(table) 22 | -------------------------------------------------------------------------------- /adodbapi/examples/test.mdb: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/mhammond/pywin32/50777ab2e67c8b8d4ca429a598cc97ce33719963/adodbapi/examples/test.mdb -------------------------------------------------------------------------------- /adodbapi/schema_table.py: -------------------------------------------------------------------------------- 1 | """call using an open ADO connection --> list of table names""" 2 | 3 | from . import adodbapi 4 | 5 | 6 | def names(connection_object): 7 | ado = connection_object.adoConn 8 | schema = ado.OpenSchema(20) # constant = adSchemaTables 9 | 10 | tables = [] 11 | while not schema.EOF: 12 | name = adodbapi.getIndexedValue(schema.Fields, "TABLE_NAME").Value 13 | tables.append(name) 14 | schema.MoveNext() 15 | del schema 16 | return tables 17 | -------------------------------------------------------------------------------- /adodbapi/test/RunTests.bat: -------------------------------------------------------------------------------- 1 | @Echo off 2 | if "%1"=="" goto skip_arg 3 | set PYTHON=%1 4 | goto skip_python: 5 | :skip_arg 6 | set PYTHON=py -2.7 7 | :skip_python 8 | Echo on 9 | echo . 10 | echo . 11 | del *.pyc 12 | echo . 13 | REM unit test 14 | call %PYTHON% adodbapitest.py --time %2 %3 %4 %5 15 | echo . 16 | echo . 17 | REM generic test 18 | call %PYTHON% test_adodbapi_dbapi20.py %2 19 | echo . 20 | echo . 21 | @Echo off 22 | pause Testing complete 23 | -------------------------------------------------------------------------------- /adodbapi/test/is64bit.py: -------------------------------------------------------------------------------- 1 | """is64bit.Python() --> boolean value of detected Python word size. is64bit.os() --> os build version""" 2 | 3 | import sys 4 | 5 | 6 | def Python(): 7 | return sys.maxsize > 2147483647 8 | 9 | 10 | def os(): 11 | import platform 12 | 13 | pm = platform.machine() 14 | if pm != ".." and pm.endswith("64"): # recent 64 bit Python 15 | return True 16 | else: 17 | import os 18 | 19 | if "PROCESSOR_ARCHITEW6432" in os.environ: 20 | return True # 32 bit program running on 64 bit Windows 21 | try: 22 | return os.environ["PROCESSOR_ARCHITECTURE"].endswith( 23 | "64" 24 | ) # 64 bit Windows 64 bit program 25 | except IndexError: 26 | pass # not Windows 27 | try: 28 | return "64" in platform.architecture()[0] # this often works in Linux 29 | except: 30 | return False # is an older version of Python, assume also an older os (best we can guess) 31 | 32 | 33 | if __name__ == "__main__": 34 | print("is64bit.Python() =", Python(), "is64bit.os() =", os()) 35 | -------------------------------------------------------------------------------- /adodbapi/test/tryconnection.py: -------------------------------------------------------------------------------- 1 | def try_connection(verbose, *args, **kwargs): 2 | import adodbapi 3 | 4 | dbconnect = adodbapi.connect 5 | try: 6 | s = dbconnect(*args, **kwargs) # connect to server 7 | if verbose: 8 | print("Connected to:", s.connection_string) 9 | print("which has tables:", s.get_table_names()) 10 | s.close() # thanks, it worked, goodbye 11 | except adodbapi.DatabaseError as inst: 12 | print(inst.args[0]) # should be the error message 13 | print(f"***Failed getting connection using= {args!r} {kwargs!r}") 14 | return False, (args, kwargs), None 15 | 16 | print(" (successful)") 17 | 18 | return True, (args, kwargs), dbconnect 19 | 20 | 21 | def try_operation_with_expected_exception( 22 | expected_exception_list, some_function, *args, **kwargs 23 | ): 24 | try: 25 | some_function(*args, **kwargs) 26 | except expected_exception_list as e: 27 | return True, e 28 | except: 29 | raise # an exception other than the expected occurred 30 | return False, "The expected exception did not occur" 31 | -------------------------------------------------------------------------------- /com/TestSources/PyCOMTest/ArrayTest.rgs: -------------------------------------------------------------------------------- 1 | HKCR 2 | { 3 | PyCOMTest.ArrayTest.1 = s 'PythonCOM ArrayTest Class' 4 | { 5 | CLSID = s '{f1a51873-24e9-47ed-ae71-925462c5fe3b}' 6 | } 7 | PyCOMTest.ArrayTest = s 'PythonCOM ArrayTest Class' 8 | { 9 | CLSID = s '{f1a51873-24e9-47ed-ae71-925462c5fe3b}' 10 | CurVer = s 'PyCOMTest.ArrayTest.1' 11 | } 12 | NoRemove CLSID 13 | { 14 | ForceRemove {f1a51873-24e9-47ed-ae71-925462c5fe3b} = s 'ArrayTest Class' 15 | { 16 | ProgID = s 'PyCOMTest.ArrayTest.1' 17 | VersionIndependentProgID = s 'PyCOMTest.ArrayTest' 18 | ForceRemove 'Programmable' 19 | InprocServer32 = s '%MODULE%' 20 | { 21 | val ThreadingModel = s 'Apartment' 22 | } 23 | 'TypeLib' = s '{6bcdcb60-5605-11d0-ae5f-cadd4c000000}' 24 | } 25 | } 26 | } 27 | -------------------------------------------------------------------------------- /com/TestSources/PyCOMTest/Connect.def: -------------------------------------------------------------------------------- 1 | ; Connect.def : Declares the module parameters. 2 | 3 | LIBRARY PyCOMTest.DLL 4 | 5 | EXPORTS 6 | DllCanUnloadNow @1 PRIVATE 7 | DllGetClassObject @2 PRIVATE 8 | DllRegisterServer @3 PRIVATE 9 | DllUnregisterServer @4 PRIVATE 10 | -------------------------------------------------------------------------------- /com/TestSources/PyCOMTest/Connect.rc: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/mhammond/pywin32/50777ab2e67c8b8d4ca429a598cc97ce33719963/com/TestSources/PyCOMTest/Connect.rc -------------------------------------------------------------------------------- /com/TestSources/PyCOMTest/PyCOMTest.dsw: -------------------------------------------------------------------------------- 1 | Microsoft Developer Studio Workspace File, Format Version 6.00 2 | # WARNING: DO NOT EDIT OR DELETE THIS WORKSPACE FILE! 3 | 4 | ############################################################################### 5 | 6 | Project: "PyCOMTest"=.\PyCOMTest.dsp - Package Owner=<4> 7 | 8 | Package=<5> 9 | {{{ 10 | begin source code control 11 | "$/Python/com/TestSources/PyCOMTest", WKBAAAAA 12 | . 13 | end source code control 14 | }}} 15 | 16 | Package=<4> 17 | {{{ 18 | }}} 19 | 20 | ############################################################################### 21 | 22 | Global: 23 | 24 | Package=<5> 25 | {{{ 26 | }}} 27 | 28 | Package=<3> 29 | {{{ 30 | }}} 31 | 32 | ############################################################################### 33 | -------------------------------------------------------------------------------- /com/TestSources/PyCOMTest/PyCOMTest.idl: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/mhammond/pywin32/50777ab2e67c8b8d4ca429a598cc97ce33719963/com/TestSources/PyCOMTest/PyCOMTest.idl -------------------------------------------------------------------------------- /com/TestSources/PyCOMTest/buildAndRegister.bat: -------------------------------------------------------------------------------- 1 | msbuild %~dp0\PyCOMTest.sln -property:Configuration=Release 2 | regsvr32 %~dp0\x64\Release\PyCOMTest.dll %* 3 | -------------------------------------------------------------------------------- /com/TestSources/PyCOMTest/connres.h: -------------------------------------------------------------------------------- 1 | //{{NO_DEPENDENCIES}} 2 | // Microsoft Developer Studio generated include file. 3 | // Used by Connect.rc 4 | // 5 | #define IDS_PYCOMTEST_DESC 1 6 | 7 | #define IDR_PYCOMTEST 1 8 | #define IDR_ARRAYTEST 2 9 | 10 | // Next default values for new objects 11 | // 12 | #ifdef APSTUDIO_INVOKED 13 | #ifndef APSTUDIO_READONLY_SYMBOLS 14 | #define _APS_NEXT_RESOURCE_VALUE 201 15 | #define _APS_NEXT_COMMAND_VALUE 32768 16 | #define _APS_NEXT_CONTROL_VALUE 201 17 | #define _APS_NEXT_SYMED_VALUE 101 18 | #endif 19 | #endif 20 | -------------------------------------------------------------------------------- /com/TestSources/PyCOMTest/preconn.cpp: -------------------------------------------------------------------------------- 1 | // preconn.cpp : source file that includes just the standard includes 2 | // preconn.pch will be the pre-compiled header 3 | // preconn.obj will contain the pre-compiled type information 4 | 5 | #include "preconn.h" 6 | -------------------------------------------------------------------------------- /com/TestSources/PyCOMTest/preconn.h: -------------------------------------------------------------------------------- 1 | // stdafx.h : include file for standard system include files, 2 | // or project specific include files that are used frequently, 3 | // but are changed infrequently 4 | 5 | #define _WIN32_DCOM 6 | 7 | #include 8 | // You may derive a class from CComModule and use it if you want to override 9 | // something, but do not change the name of _Module 10 | extern CComModule _Module; 11 | #include 12 | -------------------------------------------------------------------------------- /com/TestSources/PyCOMVBTest/EnumerableCollection.cls: -------------------------------------------------------------------------------- 1 | VERSION 1.0 CLASS 2 | BEGIN 3 | MultiUse = -1 'True 4 | Persistable = 0 'NotPersistable 5 | DataBindingBehavior = 0 'vbNone 6 | DataSourceBehavior = 0 'vbNone 7 | MTSTransactionMode = 0 'NotAnMTSObject 8 | END 9 | Attribute VB_Name = "EnumerableCollection" 10 | Attribute VB_GlobalNameSpace = False 11 | Attribute VB_Creatable = True 12 | Attribute VB_PredeclaredId = False 13 | Attribute VB_Exposed = True 14 | Option Explicit 15 | 16 | Private col As New Collection 17 | 18 | Public Property Get Count() As Integer 19 | Count = col.Count 20 | End Property 21 | 22 | Public Sub Add(ByVal Item As Variant) 23 | col.Add Item 24 | End Sub 25 | 26 | ' Default property 27 | Public Property Get Item(v As Variant) As Variant 28 | Attribute Item.VB_UserMemId = 0 29 | Set Item = col(v) 30 | End Property 31 | 32 | ' NewEnum must have the procedure ID -4 in Procedure Attributes dialog 33 | ' This procedure is *not* marked as hidden 34 | Public Function NewEnum() As IEnumVARIANT 35 | Attribute NewEnum.VB_UserMemId = -4 36 | Set NewEnum = col.[_NewEnum] 37 | End Function 38 | -------------------------------------------------------------------------------- /com/TestSources/PyCOMVBTest/IPyComTestInterface.cls: -------------------------------------------------------------------------------- 1 | VERSION 1.0 CLASS 2 | BEGIN 3 | MultiUse = -1 'True 4 | Persistable = 0 'NotPersistable 5 | DataBindingBehavior = 0 'vbNone 6 | DataSourceBehavior = 0 'vbNone 7 | MTSTransactionMode = 0 'NotAnMTSObject 8 | END 9 | Attribute VB_Name = "IPyComTestInterface" 10 | Attribute VB_GlobalNameSpace = False 11 | Attribute VB_Creatable = True 12 | Attribute VB_PredeclaredId = False 13 | Attribute VB_Exposed = True 14 | ' We had a few problems with Interfaces and VB. 15 | Function setn(ByVal i As Integer) 16 | 'n = i 17 | End Function 18 | 19 | Function getn() As Integer 20 | 'getn = n 21 | End Function 22 | -------------------------------------------------------------------------------- /com/TestSources/PyCOMVBTest/PyComTestImplementation.cls: -------------------------------------------------------------------------------- 1 | VERSION 1.0 CLASS 2 | BEGIN 3 | MultiUse = -1 'True 4 | Persistable = 0 'NotPersistable 5 | DataBindingBehavior = 0 'vbNone 6 | DataSourceBehavior = 0 'vbNone 7 | MTSTransactionMode = 0 'NotAnMTSObject 8 | END 9 | Attribute VB_Name = "PyComTestImplementation" 10 | Attribute VB_GlobalNameSpace = False 11 | Attribute VB_Creatable = True 12 | Attribute VB_PredeclaredId = False 13 | Attribute VB_Exposed = True 14 | ' We had a few problems with Interfaces and VB. 15 | Implements IPyComTestInterface 16 | Private n As Integer 17 | 18 | Function IPyComTestInterface_setn(ByVal i As Integer) 19 | n = i 20 | End Function 21 | 22 | Function IPyComTestInterface_getn() As Integer 23 | IPyComTestInterface_getn = n 24 | End Function 25 | -------------------------------------------------------------------------------- /com/TestSources/PyCOMVBTest/TestModule.bas: -------------------------------------------------------------------------------- 1 | Attribute VB_Name = "TestModule" 2 | Option Explicit 3 | 4 | Sub Main() 5 | Dim o As Tester 6 | Dim c As Collection 7 | Dim n 8 | Set o = New Tester 9 | Set c = o.CollectionProperty 10 | Set n = c 11 | c(1) = "New Value" 12 | Debug.Print "c[1] = ", c(1) 13 | End Sub 14 | -------------------------------------------------------------------------------- /com/TestSources/PyCOMVBTest/VBTest.vbp: -------------------------------------------------------------------------------- 1 | Type=Exe 2 | Reference=*\G{00020430-0000-0000-C000-000000000046}#2.0#0#E:\NT\System32\stdole2.tlb#OLE Automation 3 | Reference=*\G{C989D035-AB4B-11D1-A66B-00AA00125A98}#c.0#0#..\Build\PyCOMVBTest.dll#Python COM VB Test Harness 4 | Module=TestModule; TestModule.bas 5 | Startup="Sub Main" 6 | HelpFile="" 7 | Command32="" 8 | Name="Project1" 9 | HelpContextID="0" 10 | CompatibleMode="0" 11 | MajorVer=1 12 | MinorVer=0 13 | RevisionVer=0 14 | AutoIncrementVer=0 15 | ServerSupportFiles=0 16 | VersionCompanyName="Skippi-Net" 17 | CompilationType=0 18 | OptimizationType=0 19 | FavorPentiumPro(tm)=0 20 | CodeViewDebugInfo=0 21 | NoAliasing=0 22 | BoundsCheck=0 23 | OverflowCheck=0 24 | FlPointCheck=0 25 | FDIVCheck=0 26 | UnroundedFP=0 27 | StartMode=0 28 | Unattended=0 29 | ThreadPerObject=0 30 | MaxNumberOfThreads=1 31 | -------------------------------------------------------------------------------- /com/pythoncom.py: -------------------------------------------------------------------------------- 1 | # Magic utility that "redirects" to pythoncomXX.dll 2 | import pywintypes 3 | 4 | pywintypes.__import_pywin32_system_module__("pythoncom", globals()) 5 | -------------------------------------------------------------------------------- /com/win32com/HTML/image/BTN_HomePage.gif: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/mhammond/pywin32/50777ab2e67c8b8d4ca429a598cc97ce33719963/com/win32com/HTML/image/BTN_HomePage.gif -------------------------------------------------------------------------------- /com/win32com/HTML/image/BTN_ManualTop.gif: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/mhammond/pywin32/50777ab2e67c8b8d4ca429a598cc97ce33719963/com/win32com/HTML/image/BTN_ManualTop.gif -------------------------------------------------------------------------------- /com/win32com/HTML/image/BTN_NextPage.gif: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/mhammond/pywin32/50777ab2e67c8b8d4ca429a598cc97ce33719963/com/win32com/HTML/image/BTN_NextPage.gif -------------------------------------------------------------------------------- /com/win32com/HTML/image/BTN_PrevPage.gif: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/mhammond/pywin32/50777ab2e67c8b8d4ca429a598cc97ce33719963/com/win32com/HTML/image/BTN_PrevPage.gif -------------------------------------------------------------------------------- /com/win32com/HTML/image/blank.gif: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/mhammond/pywin32/50777ab2e67c8b8d4ca429a598cc97ce33719963/com/win32com/HTML/image/blank.gif -------------------------------------------------------------------------------- /com/win32com/HTML/image/pycom_blowing.gif: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/mhammond/pywin32/50777ab2e67c8b8d4ca429a598cc97ce33719963/com/win32com/HTML/image/pycom_blowing.gif -------------------------------------------------------------------------------- /com/win32com/HTML/image/pythoncom.gif: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/mhammond/pywin32/50777ab2e67c8b8d4ca429a598cc97ce33719963/com/win32com/HTML/image/pythoncom.gif -------------------------------------------------------------------------------- /com/win32com/HTML/image/www_icon.gif: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/mhammond/pywin32/50777ab2e67c8b8d4ca429a598cc97ce33719963/com/win32com/HTML/image/www_icon.gif -------------------------------------------------------------------------------- /com/win32com/demos/__init__.py: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/mhammond/pywin32/50777ab2e67c8b8d4ca429a598cc97ce33719963/com/win32com/demos/__init__.py -------------------------------------------------------------------------------- /com/win32com/makegw/__init__.py: -------------------------------------------------------------------------------- 1 | # indicates a python package. 2 | -------------------------------------------------------------------------------- /com/win32com/server/__init__.py: -------------------------------------------------------------------------------- 1 | # Empty __init__ file to designate a sub-package. 2 | -------------------------------------------------------------------------------- /com/win32com/server/factory.py: -------------------------------------------------------------------------------- 1 | # Class factory utilities. 2 | import pythoncom 3 | 4 | 5 | def RegisterClassFactories(clsids, flags=None, clsctx=None): 6 | """Given a list of CLSID, create and register class factories. 7 | 8 | Returns a list, which should be passed to RevokeClassFactories 9 | """ 10 | if flags is None: 11 | flags = pythoncom.REGCLS_MULTIPLEUSE | pythoncom.REGCLS_SUSPENDED 12 | if clsctx is None: 13 | clsctx = pythoncom.CLSCTX_LOCAL_SERVER 14 | ret = [] 15 | for clsid in clsids: 16 | # Some server append '-Embedding' etc 17 | if clsid[0] not in ["-", "/"]: 18 | factory = pythoncom.MakePyFactory(clsid) 19 | regId = pythoncom.CoRegisterClassObject(clsid, factory, clsctx, flags) 20 | ret.append((factory, regId)) 21 | return ret 22 | 23 | 24 | def RevokeClassFactories(infos): 25 | for factory, revokeId in infos: 26 | pythoncom.CoRevokeClassObject(revokeId) 27 | -------------------------------------------------------------------------------- /com/win32com/servers/__init__.py: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/mhammond/pywin32/50777ab2e67c8b8d4ca429a598cc97ce33719963/com/win32com/servers/__init__.py -------------------------------------------------------------------------------- /com/win32com/src/PythonCOM.def: -------------------------------------------------------------------------------- 1 | EXPORTS 2 | DllCanUnloadNow @1 PRIVATE 3 | DllGetClassObject @2 PRIVATE 4 | 5 | ; Some exports for clients who may "LoadLibrary"... 6 | PyCom_VariantFromPyObject 7 | PyCom_PyObjectFromVariant 8 | PyCom_InterfaceFromPyObject 9 | PyCom_PyObjectFromIUnknown 10 | PyCom_MakeOlePythonCall 11 | 12 | PyCom_CoInitializeEx 13 | PyCom_CoInitialize 14 | PyCom_CoUninitialize 15 | -------------------------------------------------------------------------------- /com/win32com/src/PythonCOMLoader.def: -------------------------------------------------------------------------------- 1 | EXPORTS 2 | DllCanUnloadNow PRIVATE 3 | DllGetClassObject PRIVATE 4 | -------------------------------------------------------------------------------- /com/win32com/src/extensions/PyGErrorLog.cpp: -------------------------------------------------------------------------------- 1 | #include "stdafx.h" 2 | #include "PythonCOM.h" 3 | #include "PythonCOMServer.h" 4 | #include "propbag.h" 5 | 6 | STDMETHODIMP PyGErrorLog::AddError( 7 | /* [in] */ LPCOLESTR pszPropName, 8 | /* [in] */ EXCEPINFO __RPC_FAR *pExcepInfo) 9 | { 10 | if (pszPropName == NULL || pExcepInfo == NULL) 11 | return E_POINTER; 12 | 13 | PY_GATEWAY_METHOD; 14 | PyObject *obExcepInfo = PyCom_PyObjectFromExcepInfo(pExcepInfo); 15 | if (!obExcepInfo) 16 | return PyCom_SetCOMErrorFromPyException(GetIID()); 17 | 18 | PyObject *obName = PyWinObject_FromWCHAR(pszPropName); 19 | HRESULT hr = InvokeViaPolicy("AddError", NULL, "OO", obName, obExcepInfo); 20 | Py_DECREF(obExcepInfo); 21 | Py_XDECREF(obName); 22 | return hr; 23 | } 24 | -------------------------------------------------------------------------------- /com/win32com/src/extensions/PyGPersist.cpp: -------------------------------------------------------------------------------- 1 | #include "stdafx.h" 2 | #include "PythonCOM.h" 3 | #include "PythonCOMServer.h" 4 | #include "propbag.h" 5 | 6 | STDMETHODIMP PyGPersist::GetClassID( 7 | /* [out] */ CLSID __RPC_FAR *pClassID) 8 | { 9 | if (pClassID == NULL) 10 | return PyCom_SetCOMErrorFromSimple(E_POINTER, GetIID()); 11 | 12 | HRESULT hr; 13 | PY_GATEWAY_METHOD; 14 | PyObject *result; 15 | hr = InvokeViaPolicy("GetClassID", &result); 16 | if (SUCCEEDED(hr)) { 17 | hr = PyWinObject_AsIID(result, pClassID) ? S_OK : E_FAIL; 18 | Py_DECREF(result); 19 | 20 | // register the error if necessary 21 | PyCom_SetCOMErrorFromPyException(GetIID()); 22 | } 23 | return hr; 24 | } 25 | -------------------------------------------------------------------------------- /com/win32com/src/extensions/PyGPersistStreamInit.cpp: -------------------------------------------------------------------------------- 1 | #include "stdafx.h" 2 | #include "PyIPersistStreamInit.h" 3 | #include "PyIStream.h" 4 | 5 | STDMETHODIMP PyGPersistStreamInit::InitNew(void) 6 | { 7 | PY_GATEWAY_METHOD; 8 | return InvokeViaPolicy("InitNew"); 9 | } 10 | -------------------------------------------------------------------------------- /com/win32com/src/extensions/PyIStorage.cpp: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/mhammond/pywin32/50777ab2e67c8b8d4ca429a598cc97ce33719963/com/win32com/src/extensions/PyIStorage.cpp -------------------------------------------------------------------------------- /com/win32com/src/include/PyGConnectionPoint.h: -------------------------------------------------------------------------------- 1 | class PyGConnectionPoint : public PyGatewayBase, public IConnectionPoint { 2 | protected: 3 | PyGConnectionPoint(PyObject *instance) : PyGatewayBase(instance) { ; } 4 | PYGATEWAY_MAKE_SUPPORT(PyGConnectionPoint, IConnectionPoint, IID_IConnectionPoint) 5 | 6 | // IConnectionPoint 7 | STDMETHOD(GetConnectionInterface)(IID *pIID); 8 | 9 | STDMETHOD(GetConnectionPointContainer)(IConnectionPointContainer **ppCPC); 10 | 11 | STDMETHOD(Advise)(IUnknown *pUnk, DWORD *pdwCookie); 12 | 13 | STDMETHOD(Unadvise)(DWORD cookie); 14 | 15 | STDMETHOD(EnumConnections)(IEnumConnections **ppEnum); 16 | }; 17 | -------------------------------------------------------------------------------- /com/win32com/src/include/PyGConnectionPointContainer.h: -------------------------------------------------------------------------------- 1 | class PyGConnectionPointContainer : public PyGatewayBase, public IConnectionPointContainer { 2 | protected: 3 | PyGConnectionPointContainer(PyObject *instance) : PyGatewayBase(instance) { ; } 4 | PYGATEWAY_MAKE_SUPPORT(PyGConnectionPointContainer, IConnectionPointContainer, IID_IConnectionPointContainer) 5 | 6 | // IConnectionPointContainer 7 | STDMETHOD(EnumConnectionPoints)(IEnumConnectionPoints **); 8 | STDMETHOD(FindConnectionPoint)(REFIID riid, IConnectionPoint **ppCP); 9 | }; 10 | -------------------------------------------------------------------------------- /com/win32com/src/include/PyGPersistStorage.h: -------------------------------------------------------------------------------- 1 | // This file declares the IPersistStorage gateway for Python. 2 | // Generated by makegw.py 3 | 4 | class PyGPersistStorage : public PyGPersist, public IPersistStorage { 5 | protected: 6 | PyGPersistStorage(PyObject *instance) : PyGPersist(instance) { ; } 7 | PYGATEWAY_MAKE_SUPPORT2(PyGPersistStorage, IPersistStorage, IID_IPersistStorage, PyGPersist) 8 | 9 | // IPersist 10 | STDMETHOD(GetClassID)(CLSID FAR *pClassID) { return PyGPersist::GetClassID(pClassID); } 11 | 12 | // IPersistStorage 13 | STDMETHOD(IsDirty)(void); 14 | 15 | STDMETHOD(InitNew)(IStorage __RPC_FAR *pStg); 16 | 17 | STDMETHOD(Load)(IStorage __RPC_FAR *pStg); 18 | 19 | STDMETHOD(Save)(IStorage __RPC_FAR *pStgSave, BOOL fSameAsLoad); 20 | 21 | STDMETHOD(SaveCompleted)(IStorage __RPC_FAR *pStgNew); 22 | 23 | STDMETHOD(HandsOffStorage)(void); 24 | }; 25 | -------------------------------------------------------------------------------- /com/win32com/src/include/PyIBindCtx.h: -------------------------------------------------------------------------------- 1 | 2 | ///////////////////////////////////////////////////////////////////////////// 3 | // class PyIBindCtx 4 | 5 | class PYCOM_EXPORT PyIBindCtx : public PyIUnknown { 6 | public: 7 | MAKE_PYCOM_CTOR(PyIBindCtx); 8 | static PyComTypeObject type; 9 | static IBindCtx *GetI(PyObject *self); 10 | 11 | static PyObject *GetRunningObjectTable(PyObject *self, PyObject *args); 12 | static PyObject *GetBindOptions(PyObject *self, PyObject *args); 13 | static PyObject *SetBindOptions(PyObject *self, PyObject *args); 14 | static PyObject *RegisterObjectParam(PyObject *self, PyObject *args); 15 | static PyObject *RevokeObjectParam(PyObject *self, PyObject *args); 16 | static PyObject *GetObjectParam(PyObject *self, PyObject *args); 17 | static PyObject *EnumObjectParam(PyObject *self, PyObject *args); 18 | 19 | protected: 20 | PyIBindCtx(IUnknown *); 21 | ~PyIBindCtx(); 22 | }; 23 | -------------------------------------------------------------------------------- /com/win32com/src/include/PyICatInformation.h: -------------------------------------------------------------------------------- 1 | ///////////////////////////////////////////////////////////////////////////// 2 | // class PyICatInformation 3 | class PyICatInformation : public PyIUnknown { 4 | public: 5 | MAKE_PYCOM_CTOR(PyICatInformation); 6 | static PyComTypeObject type; 7 | static ICatInformation *GetI(PyObject *self); 8 | 9 | static PyObject *EnumCategories(PyObject *self, PyObject *args); 10 | static PyObject *GetCategoryDesc(PyObject *self, PyObject *args); 11 | static PyObject *EnumClassesOfCategories(PyObject *self, PyObject *args); 12 | 13 | protected: 14 | PyICatInformation(IUnknown *); 15 | ~PyICatInformation(); 16 | }; 17 | -------------------------------------------------------------------------------- /com/win32com/src/include/PyICatRegister.h: -------------------------------------------------------------------------------- 1 | class PyICatRegister : public PyIUnknown { 2 | public: 3 | MAKE_PYCOM_CTOR(PyICatRegister); 4 | static ICatRegister *GetI(PyObject *self); 5 | static PyComTypeObject type; 6 | 7 | // The Python methods 8 | static PyObject *RegisterCategories(PyObject *self, PyObject *args); 9 | static PyObject *UnRegisterCategories(PyObject *self, PyObject *args); 10 | static PyObject *RegisterClassImplCategories(PyObject *self, PyObject *args); 11 | static PyObject *UnRegisterClassImplCategories(PyObject *self, PyObject *args); 12 | static PyObject *RegisterClassReqCategories(PyObject *self, PyObject *args); 13 | static PyObject *UnRegisterClassReqCategories(PyObject *self, PyObject *args); 14 | 15 | protected: 16 | PyICatRegister(IUnknown *pdisp); 17 | ~PyICatRegister(); 18 | }; 19 | -------------------------------------------------------------------------------- /com/win32com/src/include/PyIConnectionPoint.h: -------------------------------------------------------------------------------- 1 | class PyIConnectionPoint : public PyIUnknown { 2 | public: 3 | MAKE_PYCOM_CTOR(PyIConnectionPoint); 4 | static IConnectionPoint *GetI(PyObject *self); 5 | static PyComTypeObject type; 6 | 7 | // The Python methods 8 | static PyObject *GetConnectionInterface(PyObject *self, PyObject *args); 9 | static PyObject *GetConnectionPointContainer(PyObject *self, PyObject *args); 10 | static PyObject *Advise(PyObject *self, PyObject *args); 11 | static PyObject *Unadvise(PyObject *self, PyObject *args); 12 | static PyObject *EnumConnections(PyObject *self, PyObject *args); 13 | 14 | protected: 15 | PyIConnectionPoint(IUnknown *pdisp); 16 | ~PyIConnectionPoint(); 17 | }; 18 | -------------------------------------------------------------------------------- /com/win32com/src/include/PyIConnectionPointContainer.h: -------------------------------------------------------------------------------- 1 | class PyIConnectionPointContainer : public PyIUnknown { 2 | public: 3 | MAKE_PYCOM_CTOR(PyIConnectionPointContainer); 4 | static IConnectionPointContainer *GetI(PyObject *self); 5 | static PyComTypeObject type; 6 | 7 | // The Python methods 8 | static PyObject *EnumConnectionPoints(PyObject *self, PyObject *args); 9 | static PyObject *FindConnectionPoint(PyObject *self, PyObject *args); 10 | 11 | protected: 12 | PyIConnectionPointContainer(IUnknown *pdisp); 13 | ~PyIConnectionPointContainer(); 14 | }; 15 | -------------------------------------------------------------------------------- /com/win32com/src/include/PyIContext.h: -------------------------------------------------------------------------------- 1 | // This file declares the IContext Interface and Gateway for Python. 2 | // Generated by makegw.py 3 | // --------------------------------------------------- 4 | // 5 | // Interface Declaration 6 | #include "PythonCOM.h" 7 | class PyIContext : public PyIUnknown { 8 | public: 9 | MAKE_PYCOM_CTOR(PyIContext); 10 | static IContext *GetI(PyObject *self); 11 | static PyComEnumProviderTypeObject type; 12 | 13 | // The Python methods 14 | static PyObject *SetProperty(PyObject *self, PyObject *args); 15 | static PyObject *RemoveProperty(PyObject *self, PyObject *args); 16 | static PyObject *GetProperty(PyObject *self, PyObject *args); 17 | static PyObject *EnumContextProps(PyObject *self, PyObject *args); 18 | 19 | protected: 20 | PyIContext(IUnknown *pdisp); 21 | ~PyIContext(); 22 | }; 23 | -------------------------------------------------------------------------------- /com/win32com/src/include/PyIEnumContextProps.h: -------------------------------------------------------------------------------- 1 | // This file declares the IEnumContextProps Interface and Gateway for Python. 2 | // Generated by makegw.py 3 | // --------------------------------------------------- 4 | // 5 | // Interface Declaration 6 | 7 | class PyIEnumContextProps : public PyIUnknown { 8 | public: 9 | MAKE_PYCOM_CTOR(PyIEnumContextProps); 10 | static IEnumContextProps *GetI(PyObject *self); 11 | static PyComEnumTypeObject type; 12 | 13 | // The Python methods 14 | static PyObject *Next(PyObject *self, PyObject *args); 15 | static PyObject *Skip(PyObject *self, PyObject *args); 16 | static PyObject *Reset(PyObject *self, PyObject *args); 17 | static PyObject *Clone(PyObject *self, PyObject *args); 18 | static PyObject *Count(PyObject *self, PyObject *args); 19 | 20 | protected: 21 | PyIEnumContextProps(IUnknown *pdisp); 22 | ~PyIEnumContextProps(); 23 | }; 24 | -------------------------------------------------------------------------------- /com/win32com/src/include/PyIGlobalInterfaceTable.h: -------------------------------------------------------------------------------- 1 | // This file declares the IGlobalInterfaceTable.h Interface and Gateway for Python. 2 | // Generated by makegw.py 3 | // --------------------------------------------------- 4 | // 5 | // Interface Declaration 6 | 7 | class PyIGlobalInterfaceTable : public PyIUnknown { 8 | public: 9 | MAKE_PYCOM_CTOR(PyIGlobalInterfaceTable); 10 | static IGlobalInterfaceTable *GetI(PyObject *self); 11 | static PyComTypeObject type; 12 | 13 | // The Python methods 14 | static PyObject *RegisterInterfaceInGlobal(PyObject *self, PyObject *args); 15 | static PyObject *RevokeInterfaceFromGlobal(PyObject *self, PyObject *args); 16 | static PyObject *GetInterfaceFromGlobal(PyObject *self, PyObject *args); 17 | 18 | protected: 19 | PyIGlobalInterfaceTable(IUnknown *pdisp); 20 | ~PyIGlobalInterfaceTable(); 21 | }; 22 | -------------------------------------------------------------------------------- /com/win32com/src/include/PyIPersist.h: -------------------------------------------------------------------------------- 1 | #ifndef __PYIPERSIST_H__ 2 | #define __PYIPERSIST_H__ 3 | 4 | #include "PythonCOM.h" 5 | #include "PythonCOMServer.h" 6 | 7 | class PYCOM_EXPORT PyIPersist : public PyIUnknown { 8 | public: 9 | MAKE_PYCOM_CTOR(PyIPersist); 10 | static PyComTypeObject type; 11 | static IPersist *GetI(PyObject *self); 12 | 13 | static PyObject *GetClassID(PyObject *self, PyObject *args); 14 | 15 | protected: 16 | PyIPersist(IUnknown *); 17 | ~PyIPersist(); 18 | }; 19 | 20 | // Disable an OK warning... 21 | #pragma warning(disable : 4275) 22 | // warning C4275: non dll-interface struct 'IPersist' used as base for dll-interface class 'GPersist' 23 | 24 | class PYCOM_EXPORT PyGPersist : public PyGatewayBase, public IPersist { 25 | protected: 26 | PyGPersist(PyObject *instance) : PyGatewayBase(instance) { ; } 27 | PYGATEWAY_MAKE_SUPPORT(PyGPersist, IPersist, IID_IPersist) 28 | 29 | // IPersist 30 | STDMETHOD(GetClassID) 31 | ( 32 | /* [out] */ CLSID __RPC_FAR *pClassID); 33 | }; 34 | 35 | #pragma warning(default : 4275) 36 | 37 | #endif // __PYIPERSIST_H__ 38 | -------------------------------------------------------------------------------- /com/win32com/src/include/PyIPersistStorage.h: -------------------------------------------------------------------------------- 1 | // This file declares the IPersistStorage interface for Python. 2 | // Generated by makegw.py 3 | 4 | class PyIPersistStorage : public PyIPersist { 5 | public: 6 | MAKE_PYCOM_CTOR(PyIPersistStorage); 7 | static IPersistStorage *GetI(PyObject *self); 8 | static PyComTypeObject type; 9 | 10 | // The Python methods 11 | static PyObject *IsDirty(PyObject *self, PyObject *args); 12 | static PyObject *InitNew(PyObject *self, PyObject *args); 13 | static PyObject *Load(PyObject *self, PyObject *args); 14 | static PyObject *Save(PyObject *self, PyObject *args); 15 | static PyObject *SaveCompleted(PyObject *self, PyObject *args); 16 | static PyObject *HandsOffStorage(PyObject *self, PyObject *args); 17 | 18 | protected: 19 | PyIPersistStorage(IUnknown *pdisp); 20 | ~PyIPersistStorage(); 21 | }; 22 | -------------------------------------------------------------------------------- /com/win32com/src/include/PyIRunningObjectTable.h: -------------------------------------------------------------------------------- 1 | 2 | class PyIRunningObjectTable : public PyIUnknown { 3 | public: 4 | MAKE_PYCOM_CTOR(PyIRunningObjectTable); 5 | static PyComEnumProviderTypeObject type; 6 | static IRunningObjectTable *GetI(PyObject *self); 7 | 8 | static PyObject *IsRunning(PyObject *self, PyObject *args); 9 | static PyObject *GetObject(PyObject *self, PyObject *args); 10 | static PyObject *EnumRunning(PyObject *self, PyObject *args); 11 | static PyObject *Register(PyObject *self, PyObject *args); 12 | static PyObject *Revoke(PyObject *self, PyObject *args); 13 | 14 | protected: 15 | PyIRunningObjectTable(IUnknown *); 16 | ~PyIRunningObjectTable(); 17 | }; 18 | -------------------------------------------------------------------------------- /com/win32com/src/include/PyIServiceProvider.h: -------------------------------------------------------------------------------- 1 | 2 | ///////////////////////////////////////////////////////////////////////////// 3 | // class PyIServiceProvider 4 | class PYCOM_EXPORT PyIServiceProvider : public PyIUnknown { 5 | public: 6 | MAKE_PYCOM_CTOR(PyIServiceProvider); 7 | static PyComTypeObject type; 8 | static IServiceProvider *GetI(PyObject *self); 9 | 10 | static PyObject *QueryService(PyObject *self, PyObject *args); 11 | 12 | protected: 13 | PyIServiceProvider(IUnknown *); 14 | ~PyIServiceProvider(); 15 | }; 16 | 17 | class PyGServiceProvider : public PyGatewayBase, public IServiceProvider { 18 | protected: 19 | PyGServiceProvider(PyObject *instance) : PyGatewayBase(instance) { ; } 20 | PYGATEWAY_MAKE_SUPPORT(PyGServiceProvider, IServiceProvider, IID_IServiceProvider) 21 | 22 | STDMETHOD(QueryService)(REFGUID guidService, REFIID riid, void **ppv); 23 | }; 24 | -------------------------------------------------------------------------------- /com/win32com/src/include/stdafx.h: -------------------------------------------------------------------------------- 1 | // stdafx.h : include file for standard system include files, 2 | // or project specific include files that are used frequently, but 3 | // are changed infrequently 4 | // 5 | 6 | // _WIN32_DCOM screws win95 and NT :-( However, we need to define this 7 | // so we don't lose all the constants etc that come with DCOM 8 | // 9 | #define _WIN32_DCOM 10 | 11 | // objidl.h checks for this to define IContext and IEnumContextProps 12 | #define USE_COM_CONTEXT_DEF 13 | 14 | // PyWinTypes.h pulls in Python.h and windows.h. 15 | #define PY_SSIZE_T_CLEAN 16 | #include 17 | -------------------------------------------------------------------------------- /com/win32com/src/stdafx.cpp: -------------------------------------------------------------------------------- 1 | // stdafx.cpp : source file that includes just the standard includes 2 | // stdafx.obj will contain the pre-compiled type information 3 | 4 | #include "stdafx.h" 5 | -------------------------------------------------------------------------------- /com/win32com/test/__init__.py: -------------------------------------------------------------------------------- 1 | # Empty file to designate a Python package 2 | -------------------------------------------------------------------------------- /com/win32com/test/readme.txt: -------------------------------------------------------------------------------- 1 | COM Test Suite Readme 2 | --------------------- 3 | 4 | Running the test suite: 5 | ----------------------- 6 | * Open a command prompt 7 | * Change to the "win32com\test" directory. 8 | * run "testall.py". This will perform level 1 testing. 9 | You may specify 1, 2, or 3 on the command line ("testutil 3") 10 | to execute more tests. 11 | 12 | In general, this should just run the best it can, utilizing what is available 13 | on the machine. It is likely some tests will refuse to run due to objects not 14 | being locally available - this is normal. 15 | 16 | The `com/TestSources/` directory has source code to a C++ and VB component used purely 17 | for testing. You may like to build and register these, particularly if you 18 | are doing anything related to argument/result handling. 19 | You can run `com/TestSources/PyCOMTest/buildAndRegister.bat` directly. 20 | -------------------------------------------------------------------------------- /com/win32com/test/testConversionErrors.py: -------------------------------------------------------------------------------- 1 | import unittest 2 | 3 | import win32com.client 4 | import win32com.server.util 5 | import win32com.test.util 6 | 7 | 8 | class Tester: 9 | _public_methods_ = ["TestValue"] 10 | 11 | def TestValue(self, v): 12 | pass 13 | 14 | 15 | def test_ob(): 16 | return win32com.client.Dispatch(win32com.server.util.wrap(Tester())) 17 | 18 | 19 | class TestException(Exception): 20 | pass 21 | 22 | 23 | # The object we try and pass - pywin32 will call __float__ as a last resort. 24 | class BadConversions: 25 | def __float__(self): 26 | raise TestException 27 | 28 | 29 | class TestCase(win32com.test.util.TestCase): 30 | def test_float(self): 31 | self.assertRaises(TestException, test_ob().TestValue, BadConversions()) 32 | 33 | 34 | if __name__ == "__main__": 35 | unittest.main() 36 | -------------------------------------------------------------------------------- /com/win32com/test/testDictionary.vbs: -------------------------------------------------------------------------------- 1 | ' Test Pyhon.Dictionary using VBScript - this uses 2 | ' IDispatchEx, so is an interesting test. 3 | 4 | set ob = CreateObject("Python.Dictionary") 5 | ob("hello") = "there" 6 | ' Our keys are case insensitive. 7 | ob.Item("hi") = ob("HELLO") 8 | 9 | dim ok 10 | ok = true 11 | 12 | if ob("hello") <> "there" then 13 | WScript.Echo "**** The dictionary value was wrong!!" 14 | ok = false 15 | end if 16 | 17 | if ob("hi") <> "there" then 18 | WScript.Echo "**** The other dictionary value was wrong!!" 19 | ok = false 20 | end if 21 | 22 | if ok then 23 | WScript.Echo "VBScript has successfully tested Python.Dictionary" 24 | end if 25 | -------------------------------------------------------------------------------- /com/win32com/test/testInterp.vbs: -------------------------------------------------------------------------------- 1 | set o = CreateObject("Python.Interpreter") 2 | if o.Eval("1+1") <> 2 Then 3 | WScript.Echo "Eval('1+1') failed" 4 | bFailed = True 5 | end if 6 | 7 | if bFailed then 8 | WScript.Echo "*********** VBScript tests failed *********" 9 | else 10 | WScript.Echo "VBScript test worked OK" 11 | end if 12 | -------------------------------------------------------------------------------- /com/win32com/test/testROT.py: -------------------------------------------------------------------------------- 1 | import unittest 2 | 3 | import pythoncom 4 | import win32com.test.util 5 | import winerror 6 | 7 | 8 | class TestROT(win32com.test.util.TestCase): 9 | def testit(self): 10 | ctx = pythoncom.CreateBindCtx() 11 | rot = pythoncom.GetRunningObjectTable() 12 | num = 0 13 | for mk in rot: 14 | name = mk.GetDisplayName(ctx, None) 15 | num += 1 16 | # Monikers themselves can iterate their contents (sometimes :) 17 | try: 18 | for sub in mk: 19 | num += 1 20 | except pythoncom.com_error as exc: 21 | if exc.hresult != winerror.E_NOTIMPL: 22 | raise 23 | 24 | # if num < 2: 25 | # print("Only", num, "objects in the ROT - this is unusual") 26 | 27 | 28 | if __name__ == "__main__": 29 | unittest.main() 30 | -------------------------------------------------------------------------------- /com/win32com/test/testWMI.py: -------------------------------------------------------------------------------- 1 | import unittest 2 | 3 | import win32com.test.util 4 | from win32com.client import GetObject 5 | 6 | 7 | class Simple(win32com.test.util.TestCase): 8 | def testit(self): 9 | cses = GetObject("WinMgMts:").InstancesOf("Win32_Process") 10 | vals = [] 11 | for cs in cses: 12 | val = cs.Properties_("Caption").Value 13 | vals.append(val) 14 | self.assertFalse(len(vals) < 5, "We only found %d processes!" % len(vals)) 15 | 16 | 17 | if __name__ == "__main__": 18 | unittest.main() 19 | -------------------------------------------------------------------------------- /com/win32com/test/testxslt.js: -------------------------------------------------------------------------------- 1 | //Args: input-file style-file output-file 2 | var xml = WScript.CreateObject("Microsoft.XMLDOM"); //input 3 | xml.validateOnParse=false; 4 | xml.load(WScript.Arguments(0)); 5 | var xsl = WScript.CreateObject("Microsoft.XMLDOM"); //style 6 | xsl.validateOnParse=false; 7 | xsl.load(WScript.Arguments(1)); 8 | var out = WScript.CreateObject("Scripting.FileSystemObject"); //output 9 | var replace = true; var unicode = false; //output file properties 10 | var hdl = out.CreateTextFile( WScript.Arguments(2), replace, unicode ) 11 | hdl.write( xml.transformNode( xsl.documentElement )); 12 | //eof 13 | -------------------------------------------------------------------------------- /com/win32com/test/testxslt.py: -------------------------------------------------------------------------------- 1 | import os 2 | import tempfile 3 | import unittest 4 | 5 | import win32com.test.util 6 | 7 | expected_output = "The jscript test worked.\nThe Python test worked" 8 | 9 | 10 | class XSLT(win32com.test.util.TestCase): 11 | def testAll(self): 12 | output_name = tempfile.mktemp("-pycom-test") 13 | cmd = ( 14 | "cscript //nologo testxslt.js doesnt_matter.xml testxslt.xsl " + output_name 15 | ) 16 | win32com.test.util.ExecuteShellCommand(cmd, self) 17 | try: 18 | f = open(output_name) 19 | try: 20 | got = f.read() 21 | if got != expected_output: 22 | print(f"ERROR: XSLT expected output of {expected_output!r}") 23 | print(f"but got {got!r}") 24 | finally: 25 | f.close() 26 | finally: 27 | try: 28 | os.unlink(output_name) 29 | except OSError: 30 | pass 31 | 32 | 33 | if __name__ == "__main__": 34 | unittest.main() 35 | -------------------------------------------------------------------------------- /com/win32comext/adsi/src/PyADSIUtil.h: -------------------------------------------------------------------------------- 1 | // PyADSIUtil.h 2 | #include "iads.h" 3 | #include "Adshlp.h" 4 | 5 | PyObject *PyADSIObject_FromADS_OBJECT_INFO(ADS_OBJECT_INFO *); 6 | 7 | PyObject *PyADSIObject_FromADS_ATTR_INFOs(ADS_ATTR_INFO *infos, DWORD cinfos); 8 | BOOL PyADSIObject_AsADS_ATTR_INFOs(PyObject *ob, ADS_ATTR_INFO **ppret, DWORD *pcinfos); 9 | void PyADSIObject_FreeADS_ATTR_INFOs(ADS_ATTR_INFO *pattr, DWORD cattr); 10 | 11 | // Helpers for passing arrays of Unicode around. 12 | BOOL PyADSI_MakeNames(PyObject *obNames, WCHAR ***names, DWORD *pcnames); 13 | void PyADSI_FreeNames(WCHAR **names, DWORD cnames); 14 | 15 | BOOL PyADSIObject_AsADS_SEARCHPREF_INFOs(PyObject *ob, ADS_SEARCHPREF_INFO **ppret, DWORD *pcinfos); 16 | void PyADSIObject_FreeADS_SEARCHPREF_INFOs(ADS_SEARCHPREF_INFO *pattr, DWORD cattr); 17 | 18 | PyObject *PyADSIObject_FromADSVALUE(ADSVALUE &v); 19 | -------------------------------------------------------------------------------- /com/win32comext/adsi/src/PyIADs.h: -------------------------------------------------------------------------------- 1 | // This file declares the IADs Interface and Gateway for Python. 2 | // Generated by makegw.py 3 | // --------------------------------------------------- 4 | // 5 | // Interface Declaration 6 | 7 | class PyIADs : public PyIDispatch { 8 | public: 9 | MAKE_PYCOM_CTOR(PyIADs); 10 | static IADs *GetI(PyObject *self); 11 | static PyComTypeObject type; 12 | 13 | // The Python methods 14 | static PyObject *GetInfo(PyObject *self, PyObject *args); 15 | static PyObject *SetInfo(PyObject *self, PyObject *args); 16 | static PyObject *Get(PyObject *self, PyObject *args); 17 | static PyObject *Put(PyObject *self, PyObject *args); 18 | static PyObject *GetEx(PyObject *self, PyObject *args); 19 | static PyObject *PutEx(PyObject *self, PyObject *args); 20 | static PyObject *GetInfoEx(PyObject *self, PyObject *args); 21 | 22 | protected: 23 | PyIADs(IUnknown *pdisp); 24 | ~PyIADs(); 25 | }; 26 | -------------------------------------------------------------------------------- /com/win32comext/adsi/src/PyIADsDeleteOps.i: -------------------------------------------------------------------------------- 1 | %module IADsDeleteOps // A COM interface to ADSI's IADsDeleteOps interface. 2 | 3 | %include "typemaps.i" 4 | %include "pywin32.i" 5 | %include "pythoncom.i" 6 | %include "adsilib.i" 7 | 8 | %{ 9 | 10 | #include "PyIADsDeleteOps.h" 11 | #define SWIG_THIS_IID IID_IADsDeleteOps 12 | 13 | PyIADsDeleteOps::PyIADsDeleteOps(IUnknown *pDisp) : 14 | PyIDispatch(pDisp) 15 | { 16 | ob_type = &type; 17 | } 18 | 19 | PyIADsDeleteOps::~PyIADsDeleteOps() 20 | { 21 | } 22 | 23 | IADsDeleteOps *PyIADsDeleteOps::GetI(PyObject *self) 24 | { 25 | return (IADsDeleteOps *)PyIDispatch::GetI(self); 26 | } 27 | 28 | %} 29 | 30 | // @pyswig |DeleteObject| 31 | // @pyswig int|flags|0| 32 | HRESULT DeleteObject(LONG flags = 0); 33 | -------------------------------------------------------------------------------- /com/win32comext/authorization/__init__.py: -------------------------------------------------------------------------------- 1 | # This is a python package 2 | # __PackageSupportBuildPath__ not needed for distutil based builds, 3 | # but not everyone is there yet. 4 | import win32com 5 | 6 | win32com.__PackageSupportBuildPath__(__path__) 7 | -------------------------------------------------------------------------------- /com/win32comext/axcontrol/__init__.py: -------------------------------------------------------------------------------- 1 | # See if we have a special directory for the binaries (for developers) 2 | import win32com 3 | 4 | win32com.__PackageSupportBuildPath__(__path__) 5 | -------------------------------------------------------------------------------- /com/win32comext/axcontrol/src/axcontrol_pch.h: -------------------------------------------------------------------------------- 1 | // axcontrol_pch.h : header file for PCH generation for the olectl COM extension 2 | 3 | #include 4 | #include 5 | #include 6 | #include // Used to be 7 | 8 | extern BOOL PyObject_AsLOGPALETTE(PyObject *pbLogPal, LOGPALETTE **ppLogPal); 9 | extern void PyObject_FreeLOGPALETTE(LOGPALETTE *pLogPal); 10 | extern PyObject *PyObject_FromLOGPALETTE(LOGPALETTE *pLP); 11 | 12 | extern BOOL PyObject_AsDVTARGETDEVICE(PyObject *ob, DVTARGETDEVICE **pptd); 13 | extern void PyObject_FreeDVTARGETDEVICE(DVTARGETDEVICE *ptd); 14 | extern PyObject *PyObject_FromDVTARGETDEVICE(DVTARGETDEVICE *pTD); 15 | 16 | // We should not be using this! 17 | #define OleSetOleError PyCom_BuildPyException 18 | -------------------------------------------------------------------------------- /com/win32comext/axdebug/Test/ttest.py: -------------------------------------------------------------------------------- 1 | """A multiline 2 | docstring""" 3 | 4 | print("ttest is being imported") 5 | 6 | 7 | def test(): 8 | print("Hello from test") 9 | a = 1 10 | b = a 11 | c = b 12 | s = """\ 13 | A multi line string 14 | """ 15 | -------------------------------------------------------------------------------- /com/win32comext/axdebug/__init__.py: -------------------------------------------------------------------------------- 1 | # See if we have a special directory for the binaries (for developers) 2 | import win32com 3 | 4 | win32com.__PackageSupportBuildPath__(__path__) 5 | -------------------------------------------------------------------------------- /com/win32comext/axdebug/src/PyIDebugDocumentInfo.h: -------------------------------------------------------------------------------- 1 | // Interface Declaration 2 | 3 | class PyIDebugDocumentInfo : public PyIUnknown { 4 | public: 5 | MAKE_PYCOM_CTOR_ERRORINFO(PyIDebugDocumentInfo, IID_IDebugDocumentInfo); 6 | static IDebugDocumentInfo *GetI(PyObject *self); 7 | static PyComTypeObject type; 8 | 9 | // The Python methods 10 | static PyObject *GetName(PyObject *self, PyObject *args); 11 | static PyObject *GetDocumentClassId(PyObject *self, PyObject *args); 12 | 13 | protected: 14 | PyIDebugDocumentInfo(IUnknown *pdisp); 15 | ~PyIDebugDocumentInfo(); 16 | }; 17 | // --------------------------------------------------- 18 | // 19 | // Gateway Declaration 20 | 21 | class PyGDebugDocumentInfo : public PyGatewayBase, public IDebugDocumentInfo { 22 | protected: 23 | PyGDebugDocumentInfo(PyObject *instance) : PyGatewayBase(instance) { ; } 24 | PYGATEWAY_MAKE_SUPPORT(PyGDebugDocumentInfo, IDebugDocumentInfo, IID_IDebugDocumentInfo) 25 | 26 | // IDebugDocumentInfo 27 | STDMETHOD(GetName)(DOCUMENTNAMETYPE dnt, BSTR *pbstrName); 28 | STDMETHOD(GetDocumentClassId)(CLSID *pclsidDocument); 29 | }; 30 | -------------------------------------------------------------------------------- /com/win32comext/axdebug/src/stdafx.cpp: -------------------------------------------------------------------------------- 1 | // stdafx.cpp 2 | 3 | #include "stdafx.h" 4 | -------------------------------------------------------------------------------- /com/win32comext/axscript/__init__.py: -------------------------------------------------------------------------------- 1 | # See if we have a special directory for the binaries (for developers) 2 | import win32com 3 | 4 | win32com.__PackageSupportBuildPath__(__path__) 5 | -------------------------------------------------------------------------------- /com/win32comext/axscript/asputil.py: -------------------------------------------------------------------------------- 1 | """A utility module for ASP (Active Server Pages on MS Internet Info Server. 2 | 3 | Contains: 4 | iif -- A utility function to avoid using "if" statements in ASP <% tags 5 | 6 | """ 7 | 8 | 9 | def iif(cond, t, f): 10 | if cond: 11 | return t 12 | else: 13 | return f 14 | -------------------------------------------------------------------------------- /com/win32comext/axscript/client/__init__.py: -------------------------------------------------------------------------------- 1 | # This is a Python package 2 | -------------------------------------------------------------------------------- /com/win32comext/axscript/demos/client/asp/CreateObject.asp: -------------------------------------------------------------------------------- 1 | 2 | 3 | 17 | 18 | 19 | -------------------------------------------------------------------------------- /com/win32comext/axscript/demos/client/asp/interrupt/test.asp: -------------------------------------------------------------------------------- 1 | <%@ language=python%> 2 | 3 | <%Response.Redirect("test1.html")%> 4 | 5 | -------------------------------------------------------------------------------- /com/win32comext/axscript/demos/client/asp/interrupt/test.html: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | GOT There 5 | 8 | 9 | 10 | 11 | -------------------------------------------------------------------------------- /com/win32comext/axscript/demos/client/asp/interrupt/test1.asp: -------------------------------------------------------------------------------- 1 | <%@ language =Python%> 2 | 3 | 4 | <%Response.Redirect("test.html")%> 5 | 6 | 7 | -------------------------------------------------------------------------------- /com/win32comext/axscript/demos/client/asp/interrupt/test1.html: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | GOT HERE 5 | 8 | 9 | 10 | 11 | -------------------------------------------------------------------------------- /com/win32comext/axscript/demos/client/asp/tut1.asp: -------------------------------------------------------------------------------- 1 | 2 | 3 | 9 | 10 | 11 | -------------------------------------------------------------------------------- /com/win32comext/axscript/demos/client/ie/MarqueeText1.htm: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | Internet Workshop 5 | 6 | 7 | 8 | 9 |

10 |
11 |

Python AX Script Engine 12 |
Demo using the Marquee Control 13 |
Mark Hammond. 14 | 15 |

This is really quite a boring demo, as the Marquee control does everything. However, there is Python code behind the buttons that change the speed. This code is all of 2 lines per button!!! 16 | 17 |

For more information on Python as an ActiveX scripting language, see 18 | 19 |

Python 20 |
https://www.python.org 21 | 22 |
23 | 24 | 25 | -------------------------------------------------------------------------------- /com/win32comext/axscript/demos/client/ie/dbgtest.htm: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | 7 | 8 | 14 | 15 | 16 | 17 | -------------------------------------------------------------------------------- /com/win32comext/axscript/demos/client/ie/demo.htm: -------------------------------------------------------------------------------- 1 | 2 | 3 | Python AXScript Demos 4 | 5 | 6 | 7 | 18 | 19 | 20 | 21 | 22 | 23 | 24 | 25 | 26 | -------------------------------------------------------------------------------- /com/win32comext/axscript/demos/client/ie/demo_menu.htm: -------------------------------------------------------------------------------- 1 | 2 | 3 |

Scripting Demos

4 |

An Introduction to the 5 | scripting engine. 6 | 7 |

The Calculator Demo is a very 8 | cool sample written by Aaron Watters. 9 | 10 |

Mouse track is another of 11 | Aaron's samples, and shows how fast the Python engine is! 12 | 13 |

The foo2 sample is mainly used 14 | for debugging and testing, but does show some forms in action. 15 | -------------------------------------------------------------------------------- /com/win32comext/axscript/demos/client/ie/docwrite.htm: -------------------------------------------------------------------------------- 1 | 2 | 3 | A page generated by Python 4 | 5 | 10 | 11 | 23 | 24 | 25 | 26 | -------------------------------------------------------------------------------- /com/win32comext/axscript/demos/client/ie/form.htm: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 |

5 | Name
6 | Address
7 | 9 | 10 | 13 | 14 | 23 | 24 | 25 | 26 | -------------------------------------------------------------------------------- /com/win32comext/axscript/demos/client/ie/pycom_blowing.gif: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/mhammond/pywin32/50777ab2e67c8b8d4ca429a598cc97ce33719963/com/win32comext/axscript/demos/client/ie/pycom_blowing.gif -------------------------------------------------------------------------------- /com/win32comext/axscript/demos/client/wsh/blank.pys: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/mhammond/pywin32/50777ab2e67c8b8d4ca429a598cc97ce33719963/com/win32comext/axscript/demos/client/wsh/blank.pys -------------------------------------------------------------------------------- /com/win32comext/axscript/demos/client/wsh/excel.pys: -------------------------------------------------------------------------------- 1 | #app=WScript.Application 2 | #app._print_details_() # Use this to see what Python knows about a COM object. 3 | 4 | g_index = 1 5 | # A procedure, using a global. 6 | def Show(desc, value = None): 7 | global g_index # Need global for g_index, as I locally assign. 8 | # No global needed to "xl" object, as only referenced. 9 | # Also note "xl" is assigned later in the script - ie, Python is very late bound. 10 | xl.Cells(g_index, 1).Value = desc 11 | if value: xl.Cells(g_index, 2).Value = value 12 | g_index = g_index + 1 13 | 14 | xl = WScript.CreateObject("Excel.Application") 15 | import sys 16 | 17 | xl.Visible = 1 18 | xl.Workbooks.Add() 19 | 20 | # Show the WScript properties. 21 | Show("Application Friendly Name", WScript.Name) 22 | Show("Application Version", WScript.Version) 23 | Show("Application Context: Fully Qualified Name", WScript.FullName) 24 | Show("Application Context: Path Only", WScript.Path) 25 | Show("State of Interactive Mode", WScript.Interactive) 26 | 27 | Show("All script arguments:") 28 | args = WScript.Arguments 29 | 30 | for i in range(0,args.Count()): 31 | Show("Arg %d" % i, args(i)) 32 | -------------------------------------------------------------------------------- /com/win32comext/axscript/demos/client/wsh/test.pys: -------------------------------------------------------------------------------- 1 | # Testall - test core AX support. 2 | 3 | # Test "Restricted Execution" (ie, IObjectSafety). 4 | # This will fail if in a "restricted execution" environment, but 5 | # will silenty do nothing of not restricted. This same line in an MSIE 6 | # script would cause an exception. 7 | print("Importing win32api...") 8 | import win32api 9 | if 1==1: 10 | print("Hi") 11 | 12 | WScript.Echo("Hello from WScript") 13 | 14 | #fail 15 | -------------------------------------------------------------------------------- /com/win32comext/axscript/server/__init__.py: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/mhammond/pywin32/50777ab2e67c8b8d4ca429a598cc97ce33719963/com/win32comext/axscript/server/__init__.py -------------------------------------------------------------------------------- /com/win32comext/axscript/src/GUIDs.cpp: -------------------------------------------------------------------------------- 1 | /* 2 | * FILENAME: 3 | * GUIDs.cpp 4 | * 5 | * DESCRIPTION: 6 | * Define the GUIDs used by the project. Both internally defined 7 | * GUIDs as well as GUIDs from external sources. 8 | */ 9 | #include 10 | #pragma data_seg(".text") 11 | 12 | #include "initguid.h" 13 | 14 | // === ActiveX Guids === 15 | #if PMAC 16 | #define INITGUID 17 | #endif 18 | 19 | // === Project Guids === 20 | #include "GUIDs.h" 21 | // NOTE - The standard "activscp.h" header is not good enough - 22 | // need to use IE4 SDK or MSVC6 etc 23 | #include "activscp.h" 24 | // #include "multinfo.h" 25 | 26 | #if !WIN16 27 | #pragma data_seg() 28 | #endif // !WIN16 29 | -------------------------------------------------------------------------------- /com/win32comext/axscript/src/GUIDs.h: -------------------------------------------------------------------------------- 1 | #ifndef GUIDS_H 2 | #define GUIDS_H 3 | 4 | /* 5 | * FILENAME: 6 | * GUIDs.h 7 | * 8 | * DESCRIPTION: 9 | * GUID definitions for the project. 10 | */ 11 | 12 | DEFINE_GUID(IID_IScript, 0x350E5A60L, 0x2F61, 0x11CF, 0xAA, 0xA5, 0x00, 0x40, 0x1C, 0x60, 0x85, 0x01); 13 | DEFINE_GUID(IID_IDispatchEx, 0xa0aac450, 0xa77b, 0x11cf, 0x91, 0xd0, 0x0, 0xaa, 0x0, 0xc1, 0x4a, 0x7c); 14 | 15 | // {DF630910-1C1D-11d0-AE36-8C0F5E000000} 16 | DEFINE_GUID(CLSID_PyScript2, 0xdf630910, 0x1c1d, 0x11d0, 0xae, 0x36, 0x8c, 0xf, 0x5e, 0x0, 0x0, 0x0); 17 | // {DF630910-1C1D-11d0-AE36-8C0F5E000000} 18 | static const GUID szCLSID_PyScript2 = {0xdf630910, 0x1c1d, 0x11d0, {0xae, 0x36, 0x8c, 0xf, 0x5e, 0x0, 0x0, 0x0}}; 19 | 20 | #endif 21 | -------------------------------------------------------------------------------- /com/win32comext/axscript/src/PyGActiveScriptError.h: -------------------------------------------------------------------------------- 1 | class PYAXSCRIPT_EXPORT PyGActiveScriptError : public PyGatewayBase, public IActiveScriptError { 2 | protected: 3 | PyGActiveScriptError(PyObject *instance) : PyGatewayBase(instance) { ; } 4 | PYGATEWAY_MAKE_SUPPORT(PyGActiveScriptError, IActiveScriptError, IID_IActiveScriptError) 5 | 6 | // IActiveScriptError 7 | STDMETHOD(GetExceptionInfo)(EXCEPINFO __RPC_FAR *pexcepinfo); 8 | 9 | STDMETHOD(GetSourcePosition) 10 | (DWORD __RPC_FAR *pdwSourceContext, ULONG __RPC_FAR *pulLineNumber, LONG __RPC_FAR *plCharacterPosition); 11 | 12 | STDMETHOD(GetSourceLineText)(BSTR __RPC_FAR *pbstrSourceLine); 13 | }; 14 | -------------------------------------------------------------------------------- /com/win32comext/axscript/src/PyIActiveScriptError.h: -------------------------------------------------------------------------------- 1 | // This file declares the IActiveScriptError Interface and Gateway for Python. 2 | // Generated by makegw.py 3 | // --------------------------------------------------- 4 | // 5 | // Interface Declaration 6 | 7 | class PYAXSCRIPT_EXPORT PyIActiveScriptError : public PyIUnknown { 8 | public: 9 | MAKE_PYCOM_CTOR_ERRORINFO(PyIActiveScriptError, IID_IActiveScriptError); 10 | static IActiveScriptError *GetI(PyObject *self); 11 | static PyComTypeObject type; 12 | 13 | // The Python methods 14 | static PyObject *GetExceptionInfo(PyObject *self, PyObject *args); 15 | static PyObject *GetSourcePosition(PyObject *self, PyObject *args); 16 | static PyObject *GetSourceLineText(PyObject *self, PyObject *args); 17 | 18 | protected: 19 | PyIActiveScriptError(IUnknown *pdisp); 20 | ~PyIActiveScriptError(); 21 | }; 22 | -------------------------------------------------------------------------------- /com/win32comext/axscript/src/PyIProvideMultipleClassInfo.h: -------------------------------------------------------------------------------- 1 | class PYAXSCRIPT_EXPORT PyIProvideMultipleClassInfo : public PyIProvideClassInfo2 { 2 | public: 3 | MAKE_PYCOM_CTOR_ERRORINFO(PyIProvideMultipleClassInfo, IID_IProvideMultipleClassInfo); 4 | static IProvideMultipleClassInfo *GetI(PyObject *self); 5 | static PyComTypeObject type; 6 | 7 | // The Python methods 8 | static PyObject *GetMultiTypeInfoCount(PyObject *self, PyObject *args); 9 | static PyObject *GetInfoOfIndex(PyObject *self, PyObject *args); 10 | 11 | protected: 12 | PyIProvideMultipleClassInfo(IUnknown *pdisp); 13 | ~PyIProvideMultipleClassInfo(); 14 | }; 15 | -------------------------------------------------------------------------------- /com/win32comext/axscript/src/stdafx.cpp: -------------------------------------------------------------------------------- 1 | // stdafx.cpp 2 | 3 | #include "stdafx.h" 4 | -------------------------------------------------------------------------------- /com/win32comext/axscript/src/stdafx.h: -------------------------------------------------------------------------------- 1 | // stdafx.h : include file for standard system include files, 2 | // or project specific include files that are used frequently, but 3 | // are changed infrequently 4 | // 5 | 6 | #include 7 | 8 | #if defined(MAINWIN) && defined(_POSIX_C_SOURCE) 9 | #undef _POSIX_C_SOURCE 10 | #endif 11 | 12 | #include 13 | 14 | // Must come after Python headers. 15 | #include 16 | 17 | #include 18 | 19 | #include "PythonCOM.h" 20 | #include "PythonCOMServer.h" 21 | 22 | // NOTE - The standard "activscp.h" header is not good enough - 23 | // need to use the IE4 SDK or MSVC6 etc. 24 | #include "activscp.h" 25 | #include "objsafe.h" 26 | #include "AXScript.h" 27 | -------------------------------------------------------------------------------- /com/win32comext/axscript/test/debugTest.pys: -------------------------------------------------------------------------------- 1 | def Function(i): 2 | Test.Echo(i) 3 | 4 | print(dir()) 5 | 6 | a=1 7 | b=a 8 | c=b # And here is a comment 9 | d="A string" 10 | print(a) 11 | Test.echo("Hello from Python") 12 | for i in range(2): 13 | Function(i) 14 | a = """\ 15 | A multi-line string! 16 | """ 17 | -------------------------------------------------------------------------------- /com/win32comext/axscript/test/debugTest.vbs: -------------------------------------------------------------------------------- 1 | a=1 2 | b=a 3 | Test.Echo "Hello from VBScript" 4 | ' Here is a comment 5 | for i = 1 to 10 6 | 7 | next 8 | -------------------------------------------------------------------------------- /com/win32comext/bits/__init__.py: -------------------------------------------------------------------------------- 1 | # This is a python package 2 | # __PackageSupportBuildPath__ not needed for distutil based builds, 3 | # but not everyone is there yet. 4 | import win32com 5 | 6 | win32com.__PackageSupportBuildPath__(__path__) 7 | -------------------------------------------------------------------------------- /com/win32comext/bits/src/PyIBackgroundCopyCallback.h: -------------------------------------------------------------------------------- 1 | // This file declares the IBackgroundCopyCallback Gateway for Python. 2 | // Generated by makegw.py 3 | // --------------------------------------------------- 4 | // 5 | // Gateway Declaration 6 | 7 | #include "PythonCOMServer.h" 8 | 9 | class PyGBackgroundCopyCallback : public PyGatewayBase, public IBackgroundCopyCallback { 10 | protected: 11 | PyGBackgroundCopyCallback(PyObject *instance) : PyGatewayBase(instance) { ; } 12 | PYGATEWAY_MAKE_SUPPORT2(PyGBackgroundCopyCallback, IBackgroundCopyCallback, IID_IBackgroundCopyCallback, 13 | PyGatewayBase) 14 | 15 | // IBackgroundCopyCallback 16 | STDMETHOD(JobTransferred)(IBackgroundCopyJob *pJob); 17 | 18 | STDMETHOD(JobError)(IBackgroundCopyJob *pJob, IBackgroundCopyError *pError); 19 | 20 | STDMETHOD(JobModification)(IBackgroundCopyJob *pJob, DWORD dwReserved); 21 | }; 22 | -------------------------------------------------------------------------------- /com/win32comext/bits/src/PyIBackgroundCopyError.h: -------------------------------------------------------------------------------- 1 | // This file declares the IBackgroundCopyError Interface for Python. 2 | // Generated by makegw.py 3 | // --------------------------------------------------- 4 | // 5 | // Interface Declaration 6 | 7 | class PyIBackgroundCopyError : public PyIUnknown { 8 | public: 9 | MAKE_PYCOM_CTOR(PyIBackgroundCopyError); 10 | static IBackgroundCopyError *GetI(PyObject *self); 11 | static PyComTypeObject type; 12 | 13 | // The Python methods 14 | static PyObject *GetError(PyObject *self, PyObject *args); 15 | static PyObject *GetFile(PyObject *self, PyObject *args); 16 | static PyObject *GetErrorDescription(PyObject *self, PyObject *args); 17 | static PyObject *GetErrorContextDescription(PyObject *self, PyObject *args); 18 | static PyObject *GetProtocol(PyObject *self, PyObject *args); 19 | 20 | protected: 21 | PyIBackgroundCopyError(IUnknown *pdisp); 22 | ~PyIBackgroundCopyError(); 23 | }; 24 | -------------------------------------------------------------------------------- /com/win32comext/bits/src/PyIBackgroundCopyFile.h: -------------------------------------------------------------------------------- 1 | // This file declares the IBackgroundCopyFile Interface for Python. 2 | // Generated by makegw.py 3 | // --------------------------------------------------- 4 | // 5 | // Interface Declaration 6 | 7 | class PyIBackgroundCopyFile : public PyIUnknown { 8 | public: 9 | MAKE_PYCOM_CTOR(PyIBackgroundCopyFile); 10 | static IBackgroundCopyFile *GetI(PyObject *self); 11 | static PyComTypeObject type; 12 | 13 | // The Python methods 14 | static PyObject *GetRemoteName(PyObject *self, PyObject *args); 15 | static PyObject *GetLocalName(PyObject *self, PyObject *args); 16 | static PyObject *GetProgress(PyObject *self, PyObject *args); 17 | 18 | protected: 19 | PyIBackgroundCopyFile(IUnknown *pdisp); 20 | ~PyIBackgroundCopyFile(); 21 | }; 22 | -------------------------------------------------------------------------------- /com/win32comext/bits/src/PyIBackgroundCopyFile2.h: -------------------------------------------------------------------------------- 1 | // This file declares the IBackgroundCopyFile2 Interface for Python. 2 | // Generated by makegw.py 3 | // --------------------------------------------------- 4 | // 5 | // Interface Declaration 6 | 7 | class PyIBackgroundCopyFile2 : public PyIBackgroundCopyFile { 8 | public: 9 | MAKE_PYCOM_CTOR(PyIBackgroundCopyFile2); 10 | static IBackgroundCopyFile2 *GetI(PyObject *self); 11 | static PyComTypeObject type; 12 | 13 | // The Python methods 14 | static PyObject *GetFileRanges(PyObject *self, PyObject *args); 15 | static PyObject *SetRemoteName(PyObject *self, PyObject *args); 16 | 17 | protected: 18 | PyIBackgroundCopyFile2(IUnknown *pdisp); 19 | ~PyIBackgroundCopyFile2(); 20 | }; 21 | -------------------------------------------------------------------------------- /com/win32comext/bits/src/PyIBackgroundCopyJob2.h: -------------------------------------------------------------------------------- 1 | // This file declares the IBackgroundCopyJob2 Interface for Python. 2 | // Generated by makegw.py 3 | // --------------------------------------------------- 4 | // 5 | // Interface Declaration 6 | 7 | #include "PyIBackgroundCopyJob.h" 8 | 9 | class PyIBackgroundCopyJob2 : public PyIBackgroundCopyJob { 10 | public: 11 | MAKE_PYCOM_CTOR(PyIBackgroundCopyJob2); 12 | static IBackgroundCopyJob2 *GetI(PyObject *self); 13 | static PyComTypeObject type; 14 | 15 | // The Python methods 16 | static PyObject *SetNotifyCmdLine(PyObject *self, PyObject *args); 17 | static PyObject *GetNotifyCmdLine(PyObject *self, PyObject *args); 18 | static PyObject *GetReplyProgress(PyObject *self, PyObject *args); 19 | static PyObject *GetReplyData(PyObject *self, PyObject *args); 20 | static PyObject *SetReplyFileName(PyObject *self, PyObject *args); 21 | static PyObject *GetReplyFileName(PyObject *self, PyObject *args); 22 | static PyObject *SetCredentials(PyObject *self, PyObject *args); 23 | 24 | protected: 25 | PyIBackgroundCopyJob2(IUnknown *pdisp); 26 | ~PyIBackgroundCopyJob2(); 27 | }; 28 | -------------------------------------------------------------------------------- /com/win32comext/bits/src/PyIBackgroundCopyJob3.h: -------------------------------------------------------------------------------- 1 | // This file declares the IBackgroundCopyJob3 Interface for Python. 2 | // Generated by makegw.py 3 | // --------------------------------------------------- 4 | // 5 | // Interface Declaration 6 | 7 | class PyIBackgroundCopyJob3 : public PyIBackgroundCopyJob2 { 8 | public: 9 | MAKE_PYCOM_CTOR(PyIBackgroundCopyJob3); 10 | static IBackgroundCopyJob3 *GetI(PyObject *self); 11 | static PyComTypeObject type; 12 | 13 | // The Python methods 14 | static PyObject *ReplaceRemotePrefix(PyObject *self, PyObject *args); 15 | static PyObject *AddFileWithRanges(PyObject *self, PyObject *args); 16 | static PyObject *SetFileACLFlags(PyObject *self, PyObject *args); 17 | static PyObject *GetFileACLFlags(PyObject *self, PyObject *args); 18 | 19 | protected: 20 | PyIBackgroundCopyJob3(IUnknown *pdisp); 21 | ~PyIBackgroundCopyJob3(); 22 | }; 23 | -------------------------------------------------------------------------------- /com/win32comext/bits/src/PyIBackgroundCopyManager.h: -------------------------------------------------------------------------------- 1 | // This file declares the IBackgroundCopyManager Interface for Python. 2 | // Generated by makegw.py 3 | // --------------------------------------------------- 4 | // 5 | // Interface Declaration 6 | 7 | class PyIBackgroundCopyManager : public PyIUnknown { 8 | public: 9 | MAKE_PYCOM_CTOR(PyIBackgroundCopyManager); 10 | static IBackgroundCopyManager *GetI(PyObject *self); 11 | static PyComTypeObject type; 12 | 13 | // The Python methods 14 | static PyObject *CreateJob(PyObject *self, PyObject *args); 15 | static PyObject *GetJob(PyObject *self, PyObject *args); 16 | static PyObject *EnumJobs(PyObject *self, PyObject *args); 17 | static PyObject *GetErrorDescription(PyObject *self, PyObject *args); 18 | 19 | protected: 20 | PyIBackgroundCopyManager(IUnknown *pdisp); 21 | ~PyIBackgroundCopyManager(); 22 | }; 23 | -------------------------------------------------------------------------------- /com/win32comext/bits/src/PyIEnumBackgroundCopyFiles.h: -------------------------------------------------------------------------------- 1 | // This file declares the IEnumBackgroundCopyFiles Interface for Python. 2 | // Generated by makegw.py 3 | // --------------------------------------------------- 4 | // 5 | // Interface Declaration 6 | 7 | class PyIEnumBackgroundCopyFiles : public PyIUnknown { 8 | public: 9 | MAKE_PYCOM_CTOR(PyIEnumBackgroundCopyFiles); 10 | static IEnumBackgroundCopyFiles *GetI(PyObject *self); 11 | static PyComEnumTypeObject type; 12 | 13 | // The Python methods 14 | static PyObject *Next(PyObject *self, PyObject *args); 15 | static PyObject *Skip(PyObject *self, PyObject *args); 16 | static PyObject *Reset(PyObject *self, PyObject *args); 17 | static PyObject *Clone(PyObject *self, PyObject *args); 18 | static PyObject *GetCount(PyObject *self, PyObject *args); 19 | 20 | protected: 21 | PyIEnumBackgroundCopyFiles(IUnknown *pdisp); 22 | ~PyIEnumBackgroundCopyFiles(); 23 | }; 24 | -------------------------------------------------------------------------------- /com/win32comext/bits/src/PyIEnumBackgroundCopyJobs.h: -------------------------------------------------------------------------------- 1 | // This file declares the IEnumBackgroundCopyJobs Interface for Python. 2 | // Generated by makegw.py 3 | // --------------------------------------------------- 4 | // 5 | // Interface Declaration 6 | 7 | class PyIEnumBackgroundCopyJobs : public PyIUnknown { 8 | public: 9 | MAKE_PYCOM_CTOR(PyIEnumBackgroundCopyJobs); 10 | static IEnumBackgroundCopyJobs *GetI(PyObject *self); 11 | static PyComEnumTypeObject type; 12 | 13 | // The Python methods 14 | static PyObject *Next(PyObject *self, PyObject *args); 15 | static PyObject *Skip(PyObject *self, PyObject *args); 16 | static PyObject *Reset(PyObject *self, PyObject *args); 17 | static PyObject *Clone(PyObject *self, PyObject *args); 18 | static PyObject *GetCount(PyObject *self, PyObject *args); 19 | 20 | protected: 21 | PyIEnumBackgroundCopyJobs(IUnknown *pdisp); 22 | ~PyIEnumBackgroundCopyJobs(); 23 | }; 24 | -------------------------------------------------------------------------------- /com/win32comext/bits/src/bits_pch.h: -------------------------------------------------------------------------------- 1 | // bits_pch.h : header file for PCH generation for the BITS COM extension 2 | 3 | #include 4 | #include 5 | 6 | BOOL PyObject_AsBG_FILE_INFO_LIST(PyObject *ob, ULONG *pnum, BG_FILE_INFO **fi); 7 | void PyObject_FreeBG_FILE_INFO_LIST(ULONG pnum, BG_FILE_INFO *fi); 8 | 9 | BOOL PyObject_AsBG_FILE_RANGE_LIST(PyObject *ob, DWORD *pnum, BG_FILE_RANGE **fr); 10 | void PyObject_FreeBG_FILE_RANGE_LIST(DWORD num, BG_FILE_RANGE *fr); 11 | 12 | PyObject *PyObject_FromBG_FILE_PROGRESS(BG_FILE_PROGRESS *fp); 13 | PyObject *PyObject_FromBG_JOB_PROGRESS(BG_JOB_PROGRESS *jp); 14 | PyObject *PyObject_FromBG_JOB_REPLY_PROGRESS(BG_JOB_REPLY_PROGRESS *jrs); 15 | PyObject *PyObject_FromBG_JOB_TIMES(BG_JOB_TIMES *jt); 16 | 17 | BOOL PyObject_AsBG_AUTH_CREDENTIALS(PyObject *ob, BG_AUTH_CREDENTIALS *pRet); 18 | 19 | BOOL PyObject_AsBG_JOB_TYPE(PyObject *ob, BG_JOB_TYPE *jt); 20 | void PyObject_FreeBG_JOB_TYPE(BG_JOB_TYPE *jt); 21 | -------------------------------------------------------------------------------- /com/win32comext/directsound/__init__.py: -------------------------------------------------------------------------------- 1 | # See if we have a special directory for the binaries (for developers) 2 | import win32com 3 | 4 | win32com.__PackageSupportBuildPath__(__path__) 5 | -------------------------------------------------------------------------------- /com/win32comext/directsound/src/PyDSBCAPS.cpp: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/mhammond/pywin32/50777ab2e67c8b8d4ca429a598cc97ce33719963/com/win32comext/directsound/src/PyDSBCAPS.cpp -------------------------------------------------------------------------------- /com/win32comext/directsound/src/PyDSBUFFERDESC.cpp: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/mhammond/pywin32/50777ab2e67c8b8d4ca429a598cc97ce33719963/com/win32comext/directsound/src/PyDSBUFFERDESC.cpp -------------------------------------------------------------------------------- /com/win32comext/directsound/src/PyIDirectSound.h: -------------------------------------------------------------------------------- 1 | // This file declares the IDirectSound Interface for Python. 2 | // --------------------------------------------------- 3 | // 4 | // Interface Declaration 5 | 6 | class PyIDirectSound : public PyIUnknown { 7 | public: 8 | MAKE_PYCOM_CTOR(PyIDirectSound); 9 | static IDirectSound *GetI(PyObject *self); 10 | static PyComTypeObject type; 11 | 12 | // The Python methods 13 | static PyObject *Initialize(PyObject *self, PyObject *args); 14 | static PyObject *SetCooperativeLevel(PyObject *self, PyObject *args); 15 | static PyObject *CreateSoundBuffer(PyObject *self, PyObject *args); 16 | static PyObject *Compact(PyObject *self, PyObject *args); 17 | static PyObject *GetCaps(PyObject *self, PyObject *args); 18 | static PyObject *GetSpeakerConfig(PyObject *self, PyObject *args); 19 | static PyObject *SetSpeakerConfig(PyObject *self, PyObject *args); 20 | 21 | PyIDirectSound(IUnknown *pdisp); 22 | ~PyIDirectSound(); 23 | }; 24 | -------------------------------------------------------------------------------- /com/win32comext/directsound/src/PyIDirectSoundCapture.h: -------------------------------------------------------------------------------- 1 | // This file declares the IDirectSoundCapture Interface for Python. 2 | // --------------------------------------------------- 3 | // 4 | // Interface Declaration 5 | 6 | class PyIDirectSoundCapture : public PyIUnknown { 7 | public: 8 | MAKE_PYCOM_CTOR(PyIDirectSoundCapture); 9 | static IDirectSoundCapture *GetI(PyObject *self); 10 | static PyComTypeObject type; 11 | 12 | static PyObject *QueryInterface(PyObject *self, PyObject *args); 13 | 14 | // The Python methods 15 | 16 | static PyObject *Initialize(PyObject *self, PyObject *args); 17 | static PyObject *CreateCaptureBuffer(PyObject *self, PyObject *args); 18 | static PyObject *GetCaps(PyObject *self, PyObject *args); 19 | 20 | PyIDirectSoundCapture(IUnknown *pdisp); 21 | ~PyIDirectSoundCapture(); 22 | 23 | PyObject *m_DS; 24 | }; 25 | -------------------------------------------------------------------------------- /com/win32comext/directsound/src/PyIDirectSoundNotify.h: -------------------------------------------------------------------------------- 1 | // This file declares the IDirectSoundNotify Interface for Python. 2 | // --------------------------------------------------- 3 | // 4 | // Interface Declaration 5 | 6 | class PyIDirectSoundNotify : public PyIUnknown { 7 | public: 8 | MAKE_PYCOM_CTOR(PyIDirectSoundNotify); 9 | static IDirectSoundNotify *GetI(PyObject *self); 10 | static PyComTypeObject type; 11 | 12 | // The Python methods 13 | static PyObject *SetNotificationPositions(PyObject *self, PyObject *args); 14 | 15 | PyIDirectSoundNotify(IUnknown *pdisp); 16 | ~PyIDirectSoundNotify(); 17 | 18 | PyObject *m_DS; 19 | }; 20 | -------------------------------------------------------------------------------- /com/win32comext/directsound/test/01-Intro.wav: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/mhammond/pywin32/50777ab2e67c8b8d4ca429a598cc97ce33719963/com/win32comext/directsound/test/01-Intro.wav -------------------------------------------------------------------------------- /com/win32comext/directsound/test/__init__.py: -------------------------------------------------------------------------------- 1 | # This is a Python package, imported by the win32com test suite. 2 | -------------------------------------------------------------------------------- /com/win32comext/ifilter/__init__.py: -------------------------------------------------------------------------------- 1 | # empty file to designate as a package. 2 | -------------------------------------------------------------------------------- /com/win32comext/ifilter/src/PyIFilter.h: -------------------------------------------------------------------------------- 1 | // This file declares the IFilter Interface for Python. 2 | // Generated by makegw.py 3 | // --------------------------------------------------- 4 | // 5 | // Interface Declaration 6 | 7 | class PyIFilter : public PyIUnknown { 8 | public: 9 | MAKE_PYCOM_CTOR(PyIFilter); 10 | static IFilter *GetI(PyObject *self); 11 | static PyComTypeObject type; 12 | 13 | // The Python methods 14 | static PyObject *Init(PyObject *self, PyObject *args); 15 | static PyObject *GetChunk(PyObject *self, PyObject *args); 16 | static PyObject *GetText(PyObject *self, PyObject *args); 17 | static PyObject *GetValue(PyObject *self, PyObject *args); 18 | static PyObject *BindRegion(PyObject *self, PyObject *args); 19 | 20 | protected: 21 | PyIFilter(IUnknown *pdisp); 22 | ~PyIFilter(); 23 | }; 24 | -------------------------------------------------------------------------------- /com/win32comext/internet/__init__.py: -------------------------------------------------------------------------------- 1 | # See if we have a special directory for the binaries (for developers) 2 | import win32com 3 | 4 | win32com.__PackageSupportBuildPath__(__path__) 5 | -------------------------------------------------------------------------------- /com/win32comext/internet/src/PyIHTMLOMWindowServices.h: -------------------------------------------------------------------------------- 1 | // This file declares the IHTMLOMWindowServices Interface and Gateway for Python. 2 | // Generated by makegw.py 3 | // --------------------------------------------------- 4 | // 5 | // Gateway Declaration 6 | 7 | class PyGHTMLOMWindowServices : public PyGatewayBase, public IHTMLOMWindowServices { 8 | protected: 9 | PyGHTMLOMWindowServices(PyObject *instance) : PyGatewayBase(instance) { ; } 10 | PYGATEWAY_MAKE_SUPPORT2(PyGHTMLOMWindowServices, IHTMLOMWindowServices, IID_IHTMLOMWindowServices, PyGatewayBase) 11 | 12 | // IHTMLOMWindowServices 13 | STDMETHOD(moveTo)(LONG x, LONG y); 14 | 15 | STDMETHOD(moveBy)(LONG x, LONG y); 16 | 17 | STDMETHOD(resizeTo)(LONG x, LONG y); 18 | 19 | STDMETHOD(resizeBy)(LONG x, LONG y); 20 | }; 21 | -------------------------------------------------------------------------------- /com/win32comext/internet/src/internet_pch.h: -------------------------------------------------------------------------------- 1 | // axcontrol_pch.h : header file for PCH generation for the olectl COM extension 2 | 3 | #include 4 | #include 5 | #include 6 | #include // Used to be 7 | #include 8 | 9 | BOOL PyObject_AsPROTOCOLDATA(PyObject *ob, PROTOCOLDATA *pPD); 10 | PyObject *PyObject_FromPROTOCOLDATA(PROTOCOLDATA *pPD); 11 | 12 | BOOL PyObject_AsBINDINFO(PyObject *ob, BINDINFO *pPD); 13 | PyObject *PyObject_FromBINDINFO(BINDINFO *pPD); 14 | 15 | // We should not be using this! 16 | #define OleSetOleError PyCom_BuildPyException 17 | -------------------------------------------------------------------------------- /com/win32comext/mapi/__init__.py: -------------------------------------------------------------------------------- 1 | if isinstance(__path__, str): 2 | # For freeze to work! 3 | import sys 4 | 5 | try: 6 | import mapi 7 | 8 | sys.modules["win32com.mapi.mapi"] = mapi 9 | except ImportError: 10 | pass 11 | try: 12 | import exchange 13 | 14 | sys.modules["win32com.mapi.exchange"] = exchange 15 | except ImportError: 16 | pass 17 | else: 18 | import win32com 19 | 20 | # See if we have a special directory for the binaries (for developers) 21 | win32com.__PackageSupportBuildPath__(__path__) 22 | -------------------------------------------------------------------------------- /com/win32comext/mapi/src/MAPIStubLibrary/README.md: -------------------------------------------------------------------------------- 1 | # MAPIStubLibrary 2 | 3 | The MAPI Stub Library is a drop in replacement for mapi32.lib which supports building both 32 and 64 bit MAPI applications. This library eliminates the need to explicitly link to MAPI. 4 | 5 | **See the [documentation](https://msdn.microsoft.com/en-us/library/office/cc963763.aspx) for information on building the MAPI Stub Library and integrating it into your project.** 6 | **See the [FAQ](https://mapistublibrary.codeplex.com/wikipage?title=FAQ) for questions about this library, such as when and why to use it.** 7 | 8 | --- 9 | 10 | These MAPI headers were downloaded from and enable us to build the MAPI extension. 11 | -------------------------------------------------------------------------------- /com/win32comext/mapi/src/PyIABContainer.i: -------------------------------------------------------------------------------- 1 | /* File : PyIABContainer.i */ 2 | 3 | %module IABContainer // An COM interface to MAPI 4 | 5 | %include "typemaps.i" 6 | %include "pywin32.i" 7 | %include "pythoncom.i" 8 | %include "mapilib.i" 9 | 10 | %{ 11 | 12 | #include "PyIMAPIProp.h" 13 | #include "PyIMAPIContainer.h" 14 | #include "PyIABContainer.h" 15 | 16 | PyIABContainer::PyIABContainer(IUnknown *pDisp) : 17 | PyIMAPIContainer(pDisp) 18 | { 19 | ob_type = &type; 20 | } 21 | 22 | PyIABContainer::~PyIABContainer() 23 | { 24 | } 25 | 26 | /*static*/ IABContainer *PyIABContainer::GetI(PyObject *self) 27 | { 28 | return (IABContainer *)PyIUnknown::GetI(self); 29 | } 30 | 31 | 32 | %} 33 | -------------------------------------------------------------------------------- /com/win32comext/mapi/src/PyIDistList.i: -------------------------------------------------------------------------------- 1 | /* File : PyIDistList.i */ 2 | 3 | %module IDistList // An COM interface to MAPI 4 | 5 | %include "typemaps.i" 6 | %include "pywin32.i" 7 | %include "pythoncom.i" 8 | %include "mapilib.i" 9 | 10 | %{ 11 | 12 | #include "PyIMAPIProp.h" 13 | #include "PyIMAPIContainer.h" 14 | #include "PyIDistList.h" 15 | 16 | PyIDistList::PyIDistList(IUnknown *pDisp) : 17 | PyIMAPIContainer(pDisp) 18 | { 19 | ob_type = &type; 20 | } 21 | 22 | PyIDistList::~PyIDistList() 23 | { 24 | } 25 | 26 | /*static*/ IDistList *PyIDistList::GetI(PyObject *self) 27 | { 28 | return (IDistList *)PyIUnknown::GetI(self); 29 | } 30 | 31 | 32 | %} 33 | -------------------------------------------------------------------------------- /com/win32comext/mapi/src/PyIMailUser.i: -------------------------------------------------------------------------------- 1 | /* File : PyIMailUser.i */ 2 | 3 | %module IMailUser // An COM interface to MAPI 4 | 5 | %include "typemaps.i" 6 | %include "pywin32.i" 7 | %include "pythoncom.i" 8 | %include "mapilib.i" 9 | 10 | %{ 11 | 12 | #include "PyIMAPIProp.h" 13 | #include "PyIMAPIContainer.h" 14 | #include "PyIMailUser.h" 15 | 16 | PyIMailUser::PyIMailUser(IUnknown *pDisp) : 17 | PyIMAPIContainer(pDisp) 18 | { 19 | ob_type = &type; 20 | } 21 | 22 | PyIMailUser::~PyIMailUser() 23 | { 24 | } 25 | 26 | /*static*/ IMailUser *PyIMailUser::GetI(PyObject *self) 27 | { 28 | return (IMailUser *)PyIUnknown::GetI(self); 29 | } 30 | 31 | 32 | %} 33 | -------------------------------------------------------------------------------- /com/win32comext/mapi/src/PyIProfSect.i: -------------------------------------------------------------------------------- 1 | /* File : PyIProfSect.i */ 2 | 3 | %module IProfSect // An interface for accessing profile sections 4 | 5 | %include "typemaps.i" 6 | %include "pywin32.i" 7 | %include "pythoncom.i" 8 | %include "mapilib.i" 9 | 10 | %{ 11 | 12 | #include "PyIMAPIProp.h" 13 | #include "PyIProfSect.h" 14 | 15 | PyIProfSect::PyIProfSect(IUnknown *pDisp) : 16 | PyIMAPIProp(pDisp) 17 | { 18 | ob_type = &type; 19 | } 20 | 21 | PyIProfSect::~PyIProfSect() 22 | { 23 | } 24 | 25 | /*static*/ IProfSect *PyIProfSect::GetI(PyObject *self) 26 | { 27 | return (IProfSect *)PyIUnknown::GetI(self); 28 | } 29 | 30 | 31 | %} 32 | -------------------------------------------------------------------------------- /com/win32comext/mapi/src/exchangeguids.cpp: -------------------------------------------------------------------------------- 1 | #define INITGUID 2 | 3 | #define USES_IID_IExchangeFolderACLs 4 | 5 | #ifndef BUILD_FREEZE 6 | /* In a frozen environemt, these are likely to be picked 7 | up by the MAPI module */ 8 | 9 | #define USES_IID_IMsgStore 10 | #define USES_IID_IMAPISession 11 | #define USES_IID_IAttachment 12 | #define USES_IID_IProfSect 13 | #define USES_IID_IMAPIStatus 14 | #define USES_IID_IMailUser 15 | #define USES_IID_IDistList 16 | #define USES_IID_IABContainer 17 | #define USES_IID_IProfSect 18 | #define USES_IID_IMessage 19 | #define USES_IID_IMAPIFolder 20 | #define USES_IID_IAddrBook 21 | #define USES_IID_IMAPIProp 22 | #define USES_IID_IMAPIPropData 23 | #define USES_IID_IMAPIContainer 24 | 25 | #endif /* BUILD_FREEZE */ 26 | #include "windows.h" 27 | #include "mapiguid.h" 28 | #include "edkguid.h" 29 | -------------------------------------------------------------------------------- /com/win32comext/mapi/src/extraMAPIDefs.h: -------------------------------------------------------------------------------- 1 | #pragma once 2 | 3 | // https://learn.microsoft.com/en-ca/archive/blogs/stephen_griffin/the-elusive-0x81002746-error 4 | // https://github.com/microsoft/mfcmapi/blob/main/core/interpret/errorArray.h 5 | #define MAIL_E_NAMENOTFOUND MAKE_SCODE(SEVERITY_ERROR, 0x0100, 10054) 6 | #define MAPI_E_STORE_FULL MAKE_MAPI_E(0x60C) 7 | #define MAPI_E_LOCKID_LIMIT MAKE_MAPI_E(0x60D) 8 | #define MAPI_E_NAMED_PROP_QUOTA_EXCEEDED MAKE_MAPI_E(0x900) 9 | #define MAPI_E_PROFILE_DELETED MAKE_MAPI_E(0x204) 10 | #define MAPI_E_RECONNECTED MAKE_MAPI_E(0x125) 11 | #define MAPI_E_OFFLINE MAKE_MAPI_E(0x126) 12 | 13 | #define MAPI_FORCE_ACCESS 0x00080000 14 | -------------------------------------------------------------------------------- /com/win32comext/mapi/src/mapiguids.cpp: -------------------------------------------------------------------------------- 1 | #define INITGUID 2 | 3 | #define USES_IID_IMAPISession 4 | #define USES_IID_IMAPIStatus 5 | #define USES_IID_IMAPITable 6 | #define USES_IID_IMAPIProp 7 | #define USES_IID_IMAPIFolder 8 | #define USES_IID_IMessage 9 | #define USES_IID_IMsgStore 10 | #define USES_IID_IMAPIContainer 11 | #define USES_IID_IMAPIProgress 12 | #define USES_IID_IAttachment 13 | #define USES_IID_IProfAdmin 14 | #define USES_IID_IMAPIAdviseSink 15 | #define USES_IID_IAddrBook 16 | #define USES_IID_IMAPIPropData 17 | #define USES_IID_IMailUser 18 | #define USES_IID_IDistList 19 | #define USES_IID_IABContainer 20 | #define USES_IID_IProfSect 21 | #define USES_IID_IMsgServiceAdmin 22 | #define USES_IID_IProviderAdmin 23 | 24 | #define USES_PS_PUBLIC_STRINGS 25 | #define USES_PS_MAPI 26 | #define USES_PS_ROUTING_EMAIL_ADDRESSES 27 | #define USES_PS_ROUTING_ADDRTYPE 28 | #define USES_PS_ROUTING_DISPLAY_NAME 29 | #define USES_PS_ROUTING_ENTRYID 30 | #define USES_PS_ROUTING_SEARCH_KEY 31 | 32 | #include "windows.h" 33 | #include "mapiguid.h" 34 | #include "extraMAPIGuids.h" 35 | #define USES_IID_IMsgServiceAdmin2 36 | #include "mapiaux.h" 37 | -------------------------------------------------------------------------------- /com/win32comext/propsys/__init__.py: -------------------------------------------------------------------------------- 1 | # this is a python package 2 | -------------------------------------------------------------------------------- /com/win32comext/propsys/src/PyIObjectWithPropertyKey.h: -------------------------------------------------------------------------------- 1 | // This file declares the IObjectWithPropertyKey Interface and Gateway for Python. 2 | // Generated by makegw.py 3 | // --------------------------------------------------- 4 | // 5 | // Interface Declaration 6 | 7 | class PyIObjectWithPropertyKey : public PyIUnknown { 8 | public: 9 | MAKE_PYCOM_CTOR(PyIObjectWithPropertyKey); 10 | static IObjectWithPropertyKey *GetI(PyObject *self); 11 | static PyComTypeObject type; 12 | 13 | // The Python methods 14 | static PyObject *SetPropertyKey(PyObject *self, PyObject *args); 15 | static PyObject *GetPropertyKey(PyObject *self, PyObject *args); 16 | 17 | protected: 18 | PyIObjectWithPropertyKey(IUnknown *pdisp); 19 | ~PyIObjectWithPropertyKey(); 20 | }; 21 | -------------------------------------------------------------------------------- /com/win32comext/propsys/src/PyIPersistSerializedPropStorage.h: -------------------------------------------------------------------------------- 1 | // This file declares the IPersistSerializedPropStorage Interface for Python. 2 | // Generated by makegw.py 3 | // --------------------------------------------------- 4 | // 5 | // Interface Declaration 6 | 7 | class PyIPersistSerializedPropStorage : public PyIUnknown { 8 | public: 9 | MAKE_PYCOM_CTOR(PyIPersistSerializedPropStorage); 10 | static IPersistSerializedPropStorage *GetI(PyObject *self); 11 | static PyComTypeObject type; 12 | 13 | // The Python methods 14 | static PyObject *SetFlags(PyObject *self, PyObject *args); 15 | static PyObject *SetPropertyStorage(PyObject *self, PyObject *args); 16 | static PyObject *GetPropertyStorage(PyObject *self, PyObject *args); 17 | 18 | protected: 19 | PyIPersistSerializedPropStorage(IUnknown *pdisp); 20 | ~PyIPersistSerializedPropStorage(); 21 | }; 22 | -------------------------------------------------------------------------------- /com/win32comext/propsys/src/PyIPropertyChange.h: -------------------------------------------------------------------------------- 1 | // This file declares the IPropertyChange Interface and Gateway for Python. 2 | // Generated by makegw.py 3 | // --------------------------------------------------- 4 | // 5 | // Interface Declaration 6 | 7 | class PyIPropertyChange : public PyIObjectWithPropertyKey { 8 | public: 9 | MAKE_PYCOM_CTOR(PyIPropertyChange); 10 | static IPropertyChange *GetI(PyObject *self); 11 | static PyComTypeObject type; 12 | 13 | // The Python methods 14 | static PyObject *ApplyToPropVariant(PyObject *self, PyObject *args); 15 | 16 | protected: 17 | PyIPropertyChange(IUnknown *pdisp); 18 | ~PyIPropertyChange(); 19 | }; 20 | -------------------------------------------------------------------------------- /com/win32comext/propsys/src/PyIPropertyChangeArray.h: -------------------------------------------------------------------------------- 1 | // This file declares the IPropertyChangeArray Interface and Gateway for Python. 2 | // Generated by makegw.py 3 | // --------------------------------------------------- 4 | // 5 | // Interface Declaration 6 | 7 | class PyIPropertyChangeArray : public PyIUnknown { 8 | public: 9 | MAKE_PYCOM_CTOR(PyIPropertyChangeArray); 10 | static IPropertyChangeArray *GetI(PyObject *self); 11 | static PyComTypeObject type; 12 | 13 | // The Python methods 14 | static PyObject *GetCount(PyObject *self, PyObject *args); 15 | static PyObject *GetAt(PyObject *self, PyObject *args); 16 | static PyObject *InsertAt(PyObject *self, PyObject *args); 17 | static PyObject *Append(PyObject *self, PyObject *args); 18 | static PyObject *AppendOrReplace(PyObject *self, PyObject *args); 19 | static PyObject *RemoveAt(PyObject *self, PyObject *args); 20 | static PyObject *IsKeyInArray(PyObject *self, PyObject *args); 21 | 22 | protected: 23 | PyIPropertyChangeArray(IUnknown *pdisp); 24 | ~PyIPropertyChangeArray(); 25 | }; 26 | -------------------------------------------------------------------------------- /com/win32comext/propsys/src/PyIPropertyDescriptionAliasInfo.h: -------------------------------------------------------------------------------- 1 | // This file declares the IPropertyDescriptionAliasInfo Interface and Gateway for Python. 2 | // Generated by makegw.py 3 | // --------------------------------------------------- 4 | // 5 | // Interface Declaration 6 | 7 | #include "PythonCOM.h" 8 | #include "PythonCOMServer.h" 9 | #include "propsys.h" 10 | 11 | class PyIPropertyDescriptionAliasInfo : public PyIPropertyDescription { 12 | public: 13 | MAKE_PYCOM_CTOR(PyIPropertyDescriptionAliasInfo); 14 | static IPropertyDescriptionAliasInfo *GetI(PyObject *self); 15 | static PyComTypeObject type; 16 | 17 | // The Python methods 18 | static PyObject *GetSortByAlias(PyObject *self, PyObject *args); 19 | static PyObject *GetAdditionalSortByAliases(PyObject *self, PyObject *args); 20 | 21 | protected: 22 | PyIPropertyDescriptionAliasInfo(IUnknown *pdisp); 23 | ~PyIPropertyDescriptionAliasInfo(); 24 | }; 25 | -------------------------------------------------------------------------------- /com/win32comext/propsys/src/PyIPropertyDescriptionSearchInfo.h: -------------------------------------------------------------------------------- 1 | // This file declares the IPropertyDescriptionSearchInfo Interface and Gateway for Python. 2 | // Generated by makegw.py 3 | // --------------------------------------------------- 4 | // 5 | // Interface Declaration 6 | #include "PythonCOM.h" 7 | #include "PythonCOMServer.h" 8 | #include "propsys.h" 9 | class PyIPropertyDescriptionSearchInfo : public PyIPropertyDescription { 10 | public: 11 | MAKE_PYCOM_CTOR(PyIPropertyDescriptionSearchInfo); 12 | static IPropertyDescriptionSearchInfo *GetI(PyObject *self); 13 | static PyComTypeObject type; 14 | 15 | // The Python methods 16 | static PyObject *GetSearchInfoFlags(PyObject *self, PyObject *args); 17 | static PyObject *GetColumnIndexType(PyObject *self, PyObject *args); 18 | static PyObject *GetProjectionString(PyObject *self, PyObject *args); 19 | static PyObject *GetMaxSize(PyObject *self, PyObject *args); 20 | 21 | protected: 22 | PyIPropertyDescriptionSearchInfo(IUnknown *pdisp); 23 | ~PyIPropertyDescriptionSearchInfo(); 24 | }; 25 | -------------------------------------------------------------------------------- /com/win32comext/propsys/src/PyIPropertyEnumType.h: -------------------------------------------------------------------------------- 1 | // This file declares the IPropertyEnumType Interface and Gateway for Python. 2 | // Generated by makegw.py 3 | // --------------------------------------------------- 4 | // 5 | // Interface Declaration 6 | 7 | class PyIPropertyEnumType : public PyIUnknown { 8 | public: 9 | MAKE_PYCOM_CTOR(PyIPropertyEnumType); 10 | static IPropertyEnumType *GetI(PyObject *self); 11 | static PyComTypeObject type; 12 | 13 | // The Python methods 14 | static PyObject *GetEnumType(PyObject *self, PyObject *args); 15 | static PyObject *GetValue(PyObject *self, PyObject *args); 16 | static PyObject *GetRangeMinValue(PyObject *self, PyObject *args); 17 | static PyObject *GetRangeSetValue(PyObject *self, PyObject *args); 18 | static PyObject *GetDisplayText(PyObject *self, PyObject *args); 19 | 20 | protected: 21 | PyIPropertyEnumType(IUnknown *pdisp); 22 | ~PyIPropertyEnumType(); 23 | }; 24 | -------------------------------------------------------------------------------- /com/win32comext/propsys/src/PyIPropertyEnumTypeList.h: -------------------------------------------------------------------------------- 1 | // This file declares the IPropertyEnumTypeList Interface and Gateway for Python. 2 | // Generated by makegw.py 3 | // --------------------------------------------------- 4 | // 5 | // Interface Declaration 6 | 7 | class PyIPropertyEnumTypeList : public PyIUnknown { 8 | public: 9 | MAKE_PYCOM_CTOR(PyIPropertyEnumTypeList); 10 | static IPropertyEnumTypeList *GetI(PyObject *self); 11 | static PyComTypeObject type; 12 | 13 | // The Python methods 14 | static PyObject *GetCount(PyObject *self, PyObject *args); 15 | static PyObject *GetAt(PyObject *self, PyObject *args); 16 | static PyObject *GetConditionAt(PyObject *self, PyObject *args); 17 | static PyObject *FindMatchingIndex(PyObject *self, PyObject *args); 18 | 19 | protected: 20 | PyIPropertyEnumTypeList(IUnknown *pdisp); 21 | ~PyIPropertyEnumTypeList(); 22 | }; 23 | -------------------------------------------------------------------------------- /com/win32comext/propsys/src/PyIPropertyStoreCache.h: -------------------------------------------------------------------------------- 1 | // This file declares the IPropertyStoreCache Interface and Gateway for Python. 2 | // Generated by makegw.py 3 | // --------------------------------------------------- 4 | // 5 | // Interface Declaration 6 | #include "PythonCOM.h" 7 | #include "PyIPropertyStore.h" 8 | #include "propsys.h" 9 | class PyIPropertyStoreCache : public PyIPropertyStore { 10 | public: 11 | MAKE_PYCOM_CTOR(PyIPropertyStoreCache); 12 | static IPropertyStoreCache *GetI(PyObject *self); 13 | static PyComTypeObject type; 14 | 15 | // The Python methods 16 | static PyObject *GetState(PyObject *self, PyObject *args); 17 | static PyObject *GetValueAndState(PyObject *self, PyObject *args); 18 | static PyObject *SetState(PyObject *self, PyObject *args); 19 | static PyObject *SetValueAndState(PyObject *self, PyObject *args); 20 | 21 | protected: 22 | PyIPropertyStoreCache(IUnknown *pdisp); 23 | ~PyIPropertyStoreCache(); 24 | }; 25 | -------------------------------------------------------------------------------- /com/win32comext/propsys/test/testpropsys.py: -------------------------------------------------------------------------------- 1 | from win32com.propsys import propsys, pscon # nopycln: import 2 | 3 | print("propsys was imported (sorry - that is the extent of the tests,") 4 | print("but see the shell folder_view demo, which uses this module)") 5 | # that's all folks! 6 | -------------------------------------------------------------------------------- /com/win32comext/shell/__init__.py: -------------------------------------------------------------------------------- 1 | # See if we have a special directory for the binaries (for developers) 2 | import win32com 3 | 4 | win32com.__PackageSupportBuildPath__(__path__) 5 | -------------------------------------------------------------------------------- /com/win32comext/shell/demos/shellexecuteex.py: -------------------------------------------------------------------------------- 1 | import win32con 2 | from win32com.shell import shell, shellcon 3 | 4 | 5 | def ExplorePIDL(): 6 | pidl = shell.SHGetSpecialFolderLocation(0, shellcon.CSIDL_DESKTOP) 7 | print("The desktop is at", shell.SHGetPathFromIDList(pidl)) 8 | shell.ShellExecuteEx( 9 | fMask=shellcon.SEE_MASK_NOCLOSEPROCESS, 10 | nShow=win32con.SW_NORMAL, 11 | lpClass="folder", 12 | lpVerb="explore", 13 | lpIDList=pidl, 14 | ) 15 | print("Done!") 16 | 17 | 18 | if __name__ == "__main__": 19 | ExplorePIDL() 20 | -------------------------------------------------------------------------------- /com/win32comext/shell/demos/walk_shell_folders.py: -------------------------------------------------------------------------------- 1 | # A little sample that walks from the desktop into child 2 | # items. 3 | from win32com.shell import shell, shellcon 4 | 5 | 6 | def walk(folder, depth=2, indent=""): 7 | try: 8 | pidls = folder.EnumObjects(0, shellcon.SHCONTF_FOLDERS) 9 | except shell.error: 10 | # no items 11 | return 12 | for pidl in pidls: 13 | dn = folder.GetDisplayNameOf(pidl, shellcon.SHGDN_NORMAL) 14 | print(indent, dn) 15 | if depth: 16 | try: 17 | child = folder.BindToObject(pidl, None, shell.IID_IShellFolder) 18 | except shell.error: 19 | pass 20 | else: 21 | walk(child, depth - 1, indent + " ") 22 | 23 | 24 | walk(shell.SHGetDesktopFolder()) 25 | -------------------------------------------------------------------------------- /com/win32comext/shell/src/PyIApplicationDestinations.h: -------------------------------------------------------------------------------- 1 | // This file declares the IApplicationDestinations Interface for Python. 2 | // Generated by makegw.py 3 | // --------------------------------------------------- 4 | // 5 | // Interface Declaration 6 | 7 | class PyIApplicationDestinations : public PyIUnknown { 8 | public: 9 | MAKE_PYCOM_CTOR(PyIApplicationDestinations); 10 | static IApplicationDestinations *GetI(PyObject *self); 11 | static PyComTypeObject type; 12 | 13 | // The Python methods 14 | static PyObject *SetAppID(PyObject *self, PyObject *args); 15 | static PyObject *RemoveDestination(PyObject *self, PyObject *args); 16 | static PyObject *RemoveAllDestinations(PyObject *self, PyObject *args); 17 | 18 | protected: 19 | PyIApplicationDestinations(IUnknown *pdisp); 20 | ~PyIApplicationDestinations(); 21 | }; 22 | -------------------------------------------------------------------------------- /com/win32comext/shell/src/PyIApplicationDocumentLists.h: -------------------------------------------------------------------------------- 1 | // This file declares the IApplicationDocumentLists Interface for Python. 2 | // Generated by makegw.py 3 | // --------------------------------------------------- 4 | // 5 | // Interface Declaration 6 | 7 | class PyIApplicationDocumentLists : public PyIUnknown { 8 | public: 9 | MAKE_PYCOM_CTOR(PyIApplicationDocumentLists); 10 | static IApplicationDocumentLists *GetI(PyObject *self); 11 | static PyComTypeObject type; 12 | 13 | // The Python methods 14 | static PyObject *SetAppID(PyObject *self, PyObject *args); 15 | static PyObject *GetList(PyObject *self, PyObject *args); 16 | 17 | protected: 18 | PyIApplicationDocumentLists(IUnknown *pdisp); 19 | ~PyIApplicationDocumentLists(); 20 | }; 21 | -------------------------------------------------------------------------------- /com/win32comext/shell/src/PyICategorizer.h: -------------------------------------------------------------------------------- 1 | // This file declares the ICategorizer Interface and Gateway for Python. 2 | // Generated by makegw.py 3 | // --------------------------------------------------- 4 | // 5 | // Gateway Declaration 6 | 7 | class PyGCategorizer : public PyGatewayBase, public ICategorizer { 8 | protected: 9 | PyGCategorizer(PyObject *instance) : PyGatewayBase(instance) { ; } 10 | PYGATEWAY_MAKE_SUPPORT2(PyGCategorizer, ICategorizer, IID_ICategorizer, PyGatewayBase) 11 | 12 | // ICategorizer 13 | STDMETHOD(GetDescription)(__RPC__out_ecount_full_string(cch) LPWSTR pszDesc, UINT cch); 14 | 15 | STDMETHOD(GetCategory) 16 | (UINT cidl, __RPC__in_ecount_full(cidl) PCUITEMID_CHILD_ARRAY apidl, 17 | __RPC__out_ecount_full(cidl) DWORD *rgCategoryIds); 18 | 19 | STDMETHOD(GetCategoryInfo)(DWORD dwCategoryId, __RPC__out CATEGORY_INFO *pci); 20 | 21 | STDMETHOD(CompareCategory)(CATSORT_FLAGS csfFlags, DWORD dwCategoryId1, DWORD dwCategoryId2); 22 | }; 23 | -------------------------------------------------------------------------------- /com/win32comext/shell/src/PyIContextMenu2.h: -------------------------------------------------------------------------------- 1 | // This file declares the IContextMenu Interface and Gateway for Python. 2 | // Generated by makegw.py 3 | // --------------------------------------------------- 4 | // --------------------------------------------------- 5 | // 6 | // Gateway Declaration 7 | #pragma once 8 | 9 | #include "PyIContextMenu.h" 10 | 11 | class PyGContextMenu2 : public PyGContextMenu, public IContextMenu2 { 12 | protected: 13 | PyGContextMenu2(PyObject *instance) : PyGContextMenu(instance) { ; } 14 | PYGATEWAY_MAKE_SUPPORT2(PyGContextMenu2, IContextMenu2, IID_IContextMenu2, PyGContextMenu) 15 | 16 | // IContextMenu 17 | STDMETHOD(QueryContextMenu)(HMENU hmenu, UINT indexMenu, UINT idCmdFirst, UINT idCmdLast, UINT uFlags); 18 | 19 | STDMETHOD(InvokeCommand)(CMINVOKECOMMANDINFO __RPC_FAR *lpici); 20 | 21 | STDMETHOD(GetCommandString)(UINT_PTR idCmd, UINT uType, UINT __RPC_FAR *pwReserved, LPSTR pszName, UINT cchMax); 22 | // IContextMenu2 23 | STDMETHOD(HandleMenuMsg)(UINT uMsg, WPARAM wParam, LPARAM lParam); 24 | }; 25 | -------------------------------------------------------------------------------- /com/win32comext/shell/src/PyIContextMenu3.h: -------------------------------------------------------------------------------- 1 | // This file declares the IContextMenu Interface and Gateway for Python. 2 | // Generated by makegw.py 3 | // --------------------------------------------------- 4 | // --------------------------------------------------- 5 | // 6 | // Gateway Declaration 7 | #include "PyIContextMenu2.h" 8 | 9 | class PyGContextMenu3 : public PyGContextMenu2, public IContextMenu3 { 10 | protected: 11 | PyGContextMenu3(PyObject *instance) : PyGContextMenu2(instance) { ; } 12 | PYGATEWAY_MAKE_SUPPORT2(PyGContextMenu3, IContextMenu3, IID_IContextMenu3, PyGContextMenu2) 13 | 14 | // IContextMenu 15 | STDMETHOD(QueryContextMenu)(HMENU hmenu, UINT indexMenu, UINT idCmdFirst, UINT idCmdLast, UINT uFlags); 16 | 17 | STDMETHOD(InvokeCommand)(CMINVOKECOMMANDINFO __RPC_FAR *lpici); 18 | 19 | STDMETHOD(GetCommandString)(UINT_PTR idCmd, UINT uType, UINT __RPC_FAR *pwReserved, LPSTR pszName, UINT cchMax); 20 | // IContextMenu2 21 | STDMETHOD(HandleMenuMsg)(UINT uMsg, WPARAM wParam, LPARAM lParam); 22 | // IContextMenu3 23 | STDMETHOD(HandleMenuMsg2)(UINT uMsg, WPARAM wParam, LPARAM lParam, LRESULT *plResult); 24 | }; 25 | -------------------------------------------------------------------------------- /com/win32comext/shell/src/PyIDefaultExtractIconInit.h: -------------------------------------------------------------------------------- 1 | // This file declares the IDefaultExtractIconInit Interface and Gateway for Python. 2 | // Generated by makegw.py 3 | // --------------------------------------------------- 4 | // 5 | // Interface Declaration 6 | 7 | class PyIDefaultExtractIconInit : public PyIUnknown { 8 | public: 9 | MAKE_PYCOM_CTOR(PyIDefaultExtractIconInit); 10 | static IDefaultExtractIconInit *GetI(PyObject *self); 11 | static PyComTypeObject type; 12 | 13 | // The Python methods 14 | static PyObject *SetFlags(PyObject *self, PyObject *args); 15 | static PyObject *SetKey(PyObject *self, PyObject *args); 16 | static PyObject *SetNormalIcon(PyObject *self, PyObject *args); 17 | static PyObject *SetOpenIcon(PyObject *self, PyObject *args); 18 | static PyObject *SetShortcutIcon(PyObject *self, PyObject *args); 19 | static PyObject *SetDefaultIcon(PyObject *self, PyObject *args); 20 | 21 | protected: 22 | PyIDefaultExtractIconInit(IUnknown *pdisp); 23 | ~PyIDefaultExtractIconInit(); 24 | }; 25 | -------------------------------------------------------------------------------- /com/win32comext/shell/src/PyIDeskBand.h: -------------------------------------------------------------------------------- 1 | // This file declares the IDeskBand Gateway for Python. 2 | // --------------------------------------------------- 3 | // --------------------------------------------------- 4 | // 5 | // Gateway Declaration 6 | 7 | class PyGDeskBand : public PyGDockingWindow, public IDeskBand { 8 | protected: 9 | PyGDeskBand(PyObject *instance) : PyGDockingWindow(instance) { ; } 10 | PYGATEWAY_MAKE_SUPPORT2(PyGDeskBand, IDeskBand, IID_IDeskBand, PyGDockingWindow) 11 | 12 | // IOleWindow 13 | STDMETHOD(GetWindow)(HWND __RPC_FAR *phwnd); 14 | 15 | STDMETHOD(ContextSensitiveHelp)(BOOL fEnterMode); 16 | 17 | // IDockingWindow 18 | STDMETHOD(ShowDW)(BOOL fShow); 19 | STDMETHOD(CloseDW)(DWORD dwReserved); 20 | STDMETHOD(ResizeBorderDW)(LPCRECT prcBorder, IUnknown *punkToolbarSite, BOOL fReserved); 21 | 22 | // IDeskBand 23 | STDMETHOD(GetBandInfo)(DWORD dwBandID, DWORD dwViewMode, DESKBANDINFO *pdbi); 24 | }; 25 | -------------------------------------------------------------------------------- /com/win32comext/shell/src/PyIDockingWindow.h: -------------------------------------------------------------------------------- 1 | // This file declares the IDockingWindow Gateway for Python. 2 | // --------------------------------------------------------- 3 | // 4 | // Gateway Declaration 5 | 6 | class PyGDockingWindow : public PyGOleWindow, public IDockingWindow { 7 | protected: 8 | PyGDockingWindow(PyObject *instance) : PyGOleWindow(instance) { ; } 9 | PYGATEWAY_MAKE_SUPPORT2(PyGDockingWindow, IDockingWindow, IID_IDockingWindow, PyGOleWindow) 10 | 11 | // IOleWindow 12 | STDMETHOD(GetWindow)(HWND __RPC_FAR *phwnd); 13 | 14 | STDMETHOD(ContextSensitiveHelp)(BOOL fEnterMode); 15 | 16 | // IDockingWindow 17 | STDMETHOD(ShowDW)(BOOL fShow); 18 | STDMETHOD(CloseDW)(DWORD dwReserved); 19 | STDMETHOD(ResizeBorderDW)(LPCRECT prcBorder, IUnknown *punkToolbarSite, BOOL fReserved); 20 | }; 21 | -------------------------------------------------------------------------------- /com/win32comext/shell/src/PyIEmptyVolumeCacheCallBack.h: -------------------------------------------------------------------------------- 1 | // This file declares the IEmptyVolumeCacheCallBack Interface for Python. 2 | // --------------------------------------------------- 3 | // 4 | // Interface Declaration 5 | 6 | class PyIEmptyVolumeCacheCallBack : public PyIUnknown { 7 | public: 8 | MAKE_PYCOM_CTOR(PyIEmptyVolumeCacheCallBack); 9 | static IEmptyVolumeCacheCallBack *GetI(PyObject *self); 10 | static PyComTypeObject type; 11 | 12 | // The Python methods 13 | static PyObject *ScanProgress(PyObject *self, PyObject *args); 14 | static PyObject *PurgeProgress(PyObject *self, PyObject *args); 15 | 16 | protected: 17 | PyIEmptyVolumeCacheCallBack(IUnknown *pdisp); 18 | ~PyIEmptyVolumeCacheCallBack(); 19 | }; 20 | -------------------------------------------------------------------------------- /com/win32comext/shell/src/PyIEnumObjects.h: -------------------------------------------------------------------------------- 1 | // This file declares the IEnumObjects Interface for Python. 2 | // Generated by makegw.py 3 | // --------------------------------------------------- 4 | // 5 | // Interface Declaration 6 | 7 | class PyIEnumObjects : public PyIUnknown { 8 | public: 9 | MAKE_PYCOM_CTOR(PyIEnumObjects); 10 | static IEnumObjects *GetI(PyObject *self); 11 | static PyComEnumTypeObject type; 12 | 13 | // The Python methods 14 | static PyObject *Next(PyObject *self, PyObject *args); 15 | static PyObject *Skip(PyObject *self, PyObject *args); 16 | static PyObject *Reset(PyObject *self, PyObject *args); 17 | static PyObject *Clone(PyObject *self, PyObject *args); 18 | 19 | protected: 20 | PyIEnumObjects(IUnknown *pdisp); 21 | ~PyIEnumObjects(); 22 | }; 23 | -------------------------------------------------------------------------------- /com/win32comext/shell/src/PyIExplorerCommandProvider.h: -------------------------------------------------------------------------------- 1 | // This file declares the IExplorerCommandProvider Interface and Gateway for Python. 2 | // Generated by makegw.py 3 | // --------------------------------------------------- 4 | // 5 | // Gateway Declaration 6 | 7 | class PyGExplorerCommandProvider : public PyGatewayBase, public IExplorerCommandProvider { 8 | protected: 9 | PyGExplorerCommandProvider(PyObject *instance) : PyGatewayBase(instance) { ; } 10 | PYGATEWAY_MAKE_SUPPORT2(PyGExplorerCommandProvider, IExplorerCommandProvider, IID_IExplorerCommandProvider, 11 | PyGatewayBase) 12 | 13 | // IExplorerCommandProvider 14 | STDMETHOD(GetCommands)(__RPC__in_opt IUnknown *punkSite, __RPC__in REFIID riid, __RPC__deref_out_opt void **ppv); 15 | 16 | STDMETHOD(GetCommand)(__RPC__in REFGUID rguidCommandId, __RPC__in REFIID riid, __RPC__deref_out_opt void **ppv); 17 | }; 18 | -------------------------------------------------------------------------------- /com/win32comext/shell/src/PyIExplorerPaneVisibility.h: -------------------------------------------------------------------------------- 1 | // This file declares the IExplorerPaneVisibility Interface and Gateway for Python. 2 | // Generated by makegw.py 3 | // --------------------------------------------------- 4 | // 5 | // Interface Declaration 6 | 7 | class PyIExplorerPaneVisibility : public PyIUnknown { 8 | public: 9 | MAKE_PYCOM_CTOR(PyIExplorerPaneVisibility); 10 | static IExplorerPaneVisibility *GetI(PyObject *self); 11 | static PyComTypeObject type; 12 | 13 | // The Python methods 14 | static PyObject *GetPaneState(PyObject *self, PyObject *args); 15 | 16 | protected: 17 | PyIExplorerPaneVisibility(IUnknown *pdisp); 18 | ~PyIExplorerPaneVisibility(); 19 | }; 20 | -------------------------------------------------------------------------------- /com/win32comext/shell/src/PyIExtractImage.h: -------------------------------------------------------------------------------- 1 | // This file declares the IExtractImage Interface for Python. 2 | // Generated by makegw.py 3 | // --------------------------------------------------- 4 | // 5 | // Interface Declaration 6 | 7 | class PyIExtractImage : public PyIUnknown { 8 | public: 9 | MAKE_PYCOM_CTOR(PyIExtractImage); 10 | static IExtractImage *GetI(PyObject *self); 11 | static PyComTypeObject type; 12 | 13 | // The Python methods 14 | static PyObject *GetLocation(PyObject *self, PyObject *args); 15 | static PyObject *Extract(PyObject *self, PyObject *args); 16 | 17 | protected: 18 | PyIExtractImage(IUnknown *pdisp); 19 | ~PyIExtractImage(); 20 | }; 21 | -------------------------------------------------------------------------------- /com/win32comext/shell/src/PyIObjectArray.h: -------------------------------------------------------------------------------- 1 | // This file declares the IObjectArray Interface for Python. 2 | // Generated by makegw.py 3 | // --------------------------------------------------- 4 | // 5 | // Interface Declaration 6 | 7 | class PyIObjectArray : public PyIUnknown { 8 | public: 9 | MAKE_PYCOM_CTOR(PyIObjectArray); 10 | static IObjectArray *GetI(PyObject *self); 11 | static PyComTypeObject type; 12 | 13 | // The Python methods 14 | static PyObject *GetCount(PyObject *self, PyObject *args); 15 | static PyObject *GetAt(PyObject *self, PyObject *args); 16 | 17 | protected: 18 | PyIObjectArray(IUnknown *pdisp); 19 | ~PyIObjectArray(); 20 | }; 21 | -------------------------------------------------------------------------------- /com/win32comext/shell/src/PyIObjectCollection.h: -------------------------------------------------------------------------------- 1 | // This file declares the IObjectCollection Interface for Python. 2 | // Generated by makegw.py 3 | // --------------------------------------------------- 4 | // 5 | // Interface Declaration 6 | 7 | class PyIObjectCollection : public PyIObjectArray { 8 | public: 9 | MAKE_PYCOM_CTOR(PyIObjectCollection); 10 | static IObjectCollection *GetI(PyObject *self); 11 | static PyComTypeObject type; 12 | 13 | // The Python methods 14 | static PyObject *AddObject(PyObject *self, PyObject *args); 15 | static PyObject *AddFromArray(PyObject *self, PyObject *args); 16 | static PyObject *RemoveObjectAt(PyObject *self, PyObject *args); 17 | static PyObject *Clear(PyObject *self, PyObject *args); 18 | 19 | protected: 20 | PyIObjectCollection(IUnknown *pdisp); 21 | ~PyIObjectCollection(); 22 | }; 23 | -------------------------------------------------------------------------------- /com/win32comext/shell/src/PyIShellExtInit.h: -------------------------------------------------------------------------------- 1 | // This file declares the IShellExtInit Interface and Gateway for Python. 2 | // Generated by makegw.py 3 | // --------------------------------------------------- 4 | // 5 | // Interface Declaration 6 | 7 | class PyIShellExtInit : public PyIUnknown { 8 | public: 9 | MAKE_PYCOM_CTOR(PyIShellExtInit); 10 | static IShellExtInit *GetI(PyObject *self); 11 | static PyComTypeObject type; 12 | 13 | // The Python methods 14 | static PyObject *Initialize(PyObject *self, PyObject *args); 15 | 16 | protected: 17 | PyIShellExtInit(IUnknown *pdisp); 18 | ~PyIShellExtInit(); 19 | }; 20 | // --------------------------------------------------- 21 | // 22 | // Gateway Declaration 23 | 24 | class PyGShellExtInit : public PyGatewayBase, public IShellExtInit { 25 | protected: 26 | PyGShellExtInit(PyObject *instance) : PyGatewayBase(instance) { ; } 27 | PYGATEWAY_MAKE_SUPPORT2(PyGShellExtInit, IShellExtInit, IID_IShellExtInit, PyGatewayBase) 28 | 29 | // IShellExtInit 30 | STDMETHOD(Initialize)(LPCITEMIDLIST pFolder, IDataObject *pDataObject, HKEY hkey); 31 | }; 32 | -------------------------------------------------------------------------------- /com/win32comext/shell/src/PyIShellIcon.h: -------------------------------------------------------------------------------- 1 | // This file declares the IShellIcon Interface and Gateway for Python. 2 | // Generated by makegw.py 3 | // --------------------------------------------------- 4 | // 5 | // Interface Declaration 6 | 7 | class PyIShellIcon : public PyIUnknown { 8 | public: 9 | MAKE_PYCOM_CTOR(PyIShellIcon); 10 | static IShellIcon *GetI(PyObject *self); 11 | static PyComTypeObject type; 12 | 13 | // The Python methods 14 | static PyObject *GetIconOf(PyObject *self, PyObject *args); 15 | 16 | protected: 17 | PyIShellIcon(IUnknown *pdisp); 18 | ~PyIShellIcon(); 19 | }; 20 | // --------------------------------------------------- 21 | // 22 | // Gateway Declaration 23 | 24 | class PyGShellIcon : public PyGatewayBase, public IShellIcon { 25 | protected: 26 | PyGShellIcon(PyObject *instance) : PyGatewayBase(instance) { ; } 27 | PYGATEWAY_MAKE_SUPPORT2(PyGShellIcon, IShellIcon, IID_IShellIcon, PyGatewayBase) 28 | 29 | // IShellIcon 30 | STDMETHOD(GetIconOf)(LPCITEMIDLIST pidl, UINT flags, int __RPC_FAR *index); 31 | }; 32 | -------------------------------------------------------------------------------- /com/win32comext/shell/src/PyIShellLinkDataList.h: -------------------------------------------------------------------------------- 1 | class PyIShellLinkDataList : public PyIUnknown { 2 | public: 3 | MAKE_PYCOM_CTOR(PyIShellLinkDataList); 4 | static IShellLinkDataList *GetI(PyObject *self); 5 | static PyComTypeObject type; 6 | 7 | // The Python methods 8 | static PyObject *AddDataBlock(PyObject *self, PyObject *args); 9 | static PyObject *CopyDataBlock(PyObject *self, PyObject *args); 10 | static PyObject *RemoveDataBlock(PyObject *self, PyObject *args); 11 | static PyObject *GetFlags(PyObject *self, PyObject *args); 12 | static PyObject *SetFlags(PyObject *self, PyObject *args); 13 | 14 | protected: 15 | PyIShellLinkDataList(IUnknown *pdisp); 16 | ~PyIShellLinkDataList(); 17 | }; 18 | -------------------------------------------------------------------------------- /com/win32comext/shell/src/PyITaskbarList.h: -------------------------------------------------------------------------------- 1 | // This file declares the ITaskbarList Interface for Python. 2 | // Generated by makegw.py 3 | // --------------------------------------------------- 4 | // 5 | // Interface Declaration 6 | 7 | class PyITaskbarList : public PyIUnknown { 8 | public: 9 | MAKE_PYCOM_CTOR(PyITaskbarList); 10 | static ITaskbarList *GetI(PyObject *self); 11 | static PyComTypeObject type; 12 | 13 | // The Python methods 14 | static PyObject *HrInit(PyObject *self, PyObject *args); 15 | static PyObject *AddTab(PyObject *self, PyObject *args); 16 | static PyObject *DeleteTab(PyObject *self, PyObject *args); 17 | static PyObject *ActivateTab(PyObject *self, PyObject *args); 18 | static PyObject *SetActiveAlt(PyObject *self, PyObject *args); 19 | 20 | protected: 21 | PyITaskbarList(IUnknown *pdisp); 22 | ~PyITaskbarList(); 23 | }; 24 | -------------------------------------------------------------------------------- /com/win32comext/shell/src/PyIUniformResourceLocator.h: -------------------------------------------------------------------------------- 1 | #include "intshcut.h" 2 | class PyIUniformResourceLocator : public PyIUnknown { 3 | public: 4 | MAKE_PYCOM_CTOR(PyIUniformResourceLocator); 5 | static IUniformResourceLocator *GetI(PyObject *self); 6 | static PyComTypeObject type; 7 | 8 | // The Python methods 9 | static PyObject *GetURL(PyObject *self, PyObject *args); 10 | static PyObject *SetURL(PyObject *self, PyObject *args); 11 | static PyObject *InvokeCommand(PyObject *self, PyObject *args); 12 | 13 | protected: 14 | PyIUniformResourceLocator(IUnknown *pdisp); 15 | ~PyIUniformResourceLocator(); 16 | }; 17 | -------------------------------------------------------------------------------- /com/win32comext/shell/test/testShellFolder.py: -------------------------------------------------------------------------------- 1 | from win32com.shell import shell 2 | from win32com.shell.shellcon import * 3 | 4 | sf = shell.SHGetDesktopFolder() 5 | print("Shell Folder is", sf) 6 | 7 | names = [] 8 | for i in sf: # Magically calls EnumObjects 9 | name = sf.GetDisplayNameOf(i, SHGDN_NORMAL) 10 | names.append(name) 11 | 12 | # And get the enumerator manually 13 | enum = sf.EnumObjects(0, SHCONTF_FOLDERS | SHCONTF_NONFOLDERS | SHCONTF_INCLUDEHIDDEN) 14 | num = 0 15 | for i in enum: 16 | num += 1 17 | if num != len(names): 18 | print("Should have got the same number of names!?") 19 | print("Found", len(names), "items on the desktop") 20 | for name in names: 21 | print(name) 22 | -------------------------------------------------------------------------------- /com/win32comext/taskscheduler/__init__.py: -------------------------------------------------------------------------------- 1 | # This is a python package 2 | # __PackageSupportBuildPath__ not needed for distutil based builds, 3 | # but not everyone is there yet. 4 | import win32com 5 | 6 | win32com.__PackageSupportBuildPath__(__path__) 7 | -------------------------------------------------------------------------------- /com/win32comext/taskscheduler/src/PyIProvideTaskPage.h: -------------------------------------------------------------------------------- 1 | // This file declares the IProvideTaskPage Interface for Python. 2 | // Generated by makegw.py 3 | // --------------------------------------------------- 4 | // 5 | // Interface Declaration 6 | 7 | #include "PythonCOM.h" 8 | #include "mstask.h" 9 | 10 | class PyIProvideTaskPage : public PyIUnknown { 11 | public: 12 | MAKE_PYCOM_CTOR(PyIProvideTaskPage); 13 | static IProvideTaskPage *GetI(PyObject *self); 14 | static PyComTypeObject type; 15 | 16 | // The Python methods 17 | static PyObject *GetPage(PyObject *self, PyObject *args); 18 | 19 | protected: 20 | PyIProvideTaskPage(IUnknown *pdisp); 21 | ~PyIProvideTaskPage(); 22 | }; 23 | -------------------------------------------------------------------------------- /com/win32comext/taskscheduler/test/test_localsystem.py: -------------------------------------------------------------------------------- 1 | f = open("test_localsystem.txt", "w") 2 | f.write("I have run\n") 3 | f.close() 4 | -------------------------------------------------------------------------------- /isapi/README.txt: -------------------------------------------------------------------------------- 1 | A Python ISAPI extension. Contributed by Phillip Frantz, and is 2 | Copyright 2002-2003 by Blackdog Software Pty Ltd. 3 | 4 | See the 'samples' directory, and particularly samples\README.txt 5 | 6 | You can find documentation in the PyWin32.chm file that comes with pywin32 - 7 | you can open this from Pythonwin->Help, or from the start menu. 8 | -------------------------------------------------------------------------------- /isapi/samples/README.txt: -------------------------------------------------------------------------------- 1 | In this directory you will find examples of ISAPI filters and extensions. 2 | 3 | The filter loading mechanism works like this: 4 | * IIS loads the special Python "loader" DLL. This DLL will generally have a 5 | leading underscore as part of its name. 6 | * This loader DLL looks for a Python module, by removing the first letter of 7 | the DLL base name. 8 | 9 | This means that an ISAPI extension module consists of 2 key files - the loader 10 | DLL (eg, "_MyIISModule.dll", and a Python module (which for this example 11 | would be "MyIISModule.py") 12 | 13 | When you install an ISAPI extension, the installation code checks to see if 14 | there is a loader DLL for your implementation file - if one does not exist, 15 | or the standard loader is different, it is copied and renamed accordingly. 16 | 17 | We use this mechanism to provide the maximum separation between different 18 | Python extensions installed on the same server - otherwise filter order and 19 | other tricky IIS semantics would need to be replicated. Also, each filter 20 | gets its own thread-pool, etc. 21 | -------------------------------------------------------------------------------- /isapi/test/README.txt: -------------------------------------------------------------------------------- 1 | This is a directory for tests of the PyISAPI framework. 2 | 3 | For demos, please see the pyisapi 'samples' directory. 4 | -------------------------------------------------------------------------------- /pycln.toml: -------------------------------------------------------------------------------- 1 | [tool.pycln] 2 | all = true 3 | skip_imports = [ 4 | # Modules with known side-effects 5 | "coloreditor", # Adds doc template 6 | "IDLEenvironment", # Injects fast_readline into the IDLE auto-indent extension 7 | "pythoncom", # pythoncomXX.dll loader 8 | "pywintypes", # pywintypesXX.dll loader 9 | "win32com", # Sets pythoncom.frozen and adds modules to path based on the registry 10 | "win32traceutil", # Redirects output to win32trace remote collector 11 | "win32ui", # Must always be imported before dde 12 | ] 13 | # Note: com/win32com/client/gencache.py does read files but only to fill in it's own dicts from cache 14 | -------------------------------------------------------------------------------- /pyproject.toml: -------------------------------------------------------------------------------- 1 | [build-system] 2 | # setuptools==77.0.3 made PEP-639 license deprecations introduced by 77.0.0 into warnings rather than errors 3 | # setuptools==75.4 dropped support for Python 3.8 4 | requires = [ 5 | "setuptools >=77.0.3; python_version >='3.9'", 6 | "setuptools <76.1; python_version <'3.9'", 7 | ] 8 | build-backend = "setuptools.build_meta" 9 | -------------------------------------------------------------------------------- /pywin32.pth: -------------------------------------------------------------------------------- 1 | # .pth file for the PyWin32 extensions 2 | win32 3 | win32\lib 4 | Pythonwin 5 | # And some hackery to deal with environments where the post_install script 6 | # isn't run. 7 | import pywin32_bootstrap 8 | -------------------------------------------------------------------------------- /win32/Demos/EvtSubscribe_pull.py: -------------------------------------------------------------------------------- 1 | ## Demonstrates how to create a "pull" subscription 2 | import win32con 3 | import win32event 4 | import win32evtlog 5 | 6 | query_text = '*[System[Provider[@Name="Microsoft-Windows-Winlogon"]]]' 7 | 8 | h = win32event.CreateEvent(None, 0, 0, None) 9 | s = win32evtlog.EvtSubscribe( 10 | "System", 11 | win32evtlog.EvtSubscribeStartAtOldestRecord, 12 | SignalEvent=h, 13 | Query=query_text, 14 | ) 15 | 16 | while 1: 17 | while 1: 18 | events = win32evtlog.EvtNext(s, 10) 19 | if len(events) == 0: 20 | break 21 | ##for event in events: 22 | ## print(win32evtlog.EvtRender(event, win32evtlog.EvtRenderEventXml)) 23 | print("retrieved %s events" % len(events)) 24 | while 1: 25 | print("waiting...") 26 | w = win32event.WaitForSingleObjectEx(h, 2000, True) 27 | if w == win32con.WAIT_OBJECT_0: 28 | break 29 | -------------------------------------------------------------------------------- /win32/Demos/EvtSubscribe_push.py: -------------------------------------------------------------------------------- 1 | ## Demonstrates a "push" subscription with a callback function 2 | from __future__ import annotations 3 | 4 | from time import sleep 5 | 6 | import win32evtlog 7 | 8 | query_text = '*[System[Provider[@Name="Microsoft-Windows-Winlogon"]]]' 9 | 10 | 11 | def c(reason, context, evt): 12 | if reason == win32evtlog.EvtSubscribeActionError: 13 | print("EvtSubscribeActionError") 14 | elif reason == win32evtlog.EvtSubscribeActionDeliver: 15 | print("EvtSubscribeActionDeliver") 16 | else: 17 | print("??? Unknown action ???", reason) 18 | context.append(win32evtlog.EvtRender(evt, win32evtlog.EvtRenderEventXml)) 19 | return 0 20 | 21 | 22 | evttext: list[str] = [] 23 | s = win32evtlog.EvtSubscribe( 24 | "System", 25 | win32evtlog.EvtSubscribeStartAtOldestRecord, 26 | Query="*", 27 | Callback=c, 28 | Context=evttext, 29 | ) 30 | 31 | sleep(0.001) 32 | print("\n".join(evttext)) 33 | -------------------------------------------------------------------------------- /win32/Demos/c_extension/README.txt: -------------------------------------------------------------------------------- 1 | This directory contains a sample Python extension module which 2 | includes PyWinTypes.h and links against PyWinTypesXX.lib The same technique 3 | can be used to include and extend pythoncom. 4 | 5 | The sample does nothing useful other than to show how to compile and link 6 | such an extension using a standard pywin32 installation. 7 | -------------------------------------------------------------------------------- /win32/Demos/c_extension/setup.py: -------------------------------------------------------------------------------- 1 | # A sample distutils script to show to build your own 2 | # extension module which extends pywintypes or pythoncom. 3 | # 4 | # Use 'python -m build' to build this extension. 5 | import os 6 | from setuptools import Extension, setup 7 | from sysconfig import get_paths 8 | 9 | sources = ["win32_extension.cpp"] 10 | lib_dir = get_paths()["platlib"] 11 | 12 | # Specify the directory where the PyWin32 .h and .lib files are installed. 13 | # If you are doing a win32com extension, you will also need to add 14 | # win32com\Include and win32com\Libs. 15 | ext = Extension( 16 | "win32_extension", 17 | sources, 18 | include_dirs=[os.path.join(lib_dir, "win32", "include")], 19 | library_dirs=[os.path.join(lib_dir, "win32", "libs")], 20 | ) 21 | 22 | setup( 23 | name="win32 extension sample", 24 | version="0.1", 25 | ext_modules=[ext], 26 | ) 27 | -------------------------------------------------------------------------------- /win32/Demos/c_extension/win32_extension.cpp: -------------------------------------------------------------------------------- 1 | // Note: this sample does nothing useful other than to show you how 2 | // your own Python extension can link with and use the functions from 3 | // pywintypesXX.dll 4 | #include "Python.h" 5 | #include "PyWinTypes.h" 6 | 7 | static struct PyMethodDef win32extension_functions[] = {0}; 8 | 9 | extern "C" __declspec(dllexport) void initwin32_extension(void) 10 | { 11 | // Initialize PyWin32 globals (such as error objects etc) 12 | PyWinGlobals_Ensure(); 13 | 14 | PyObject *module; 15 | module = Py_InitModule("win32_extension", win32extension_functions); 16 | if (!module) 17 | return; 18 | } 19 | -------------------------------------------------------------------------------- /win32/Demos/dde/ddeclient.py: -------------------------------------------------------------------------------- 1 | # 'Request' example added jjk 11/20/98 2 | 3 | import win32ui # isort: skip # Must be imported before dde ! 4 | import dde 5 | 6 | server = dde.CreateServer() 7 | server.Create("TestClient") 8 | 9 | conversation = dde.CreateConversation(server) 10 | 11 | conversation.ConnectTo("RunAny", "RunAnyCommand") 12 | conversation.Exec("DoSomething") 13 | conversation.Exec("DoSomethingElse") 14 | 15 | conversation.ConnectTo("RunAny", "ComputeStringLength") 16 | s = "abcdefghi" 17 | sl = conversation.Request(s) 18 | print(f'length of "{s}" is {sl}') 19 | -------------------------------------------------------------------------------- /win32/Demos/images/frowny.bmp: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/mhammond/pywin32/50777ab2e67c8b8d4ca429a598cc97ce33719963/win32/Demos/images/frowny.bmp -------------------------------------------------------------------------------- /win32/Demos/images/smiley.bmp: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/mhammond/pywin32/50777ab2e67c8b8d4ca429a598cc97ce33719963/win32/Demos/images/smiley.bmp -------------------------------------------------------------------------------- /win32/Demos/pipes/cat.py: -------------------------------------------------------------------------------- 1 | """cat.py 2 | a version of unix cat, tweaked to show off runproc.py 3 | """ 4 | 5 | import sys 6 | 7 | data = sys.stdin.read(1) 8 | sys.stdout.write(data) 9 | sys.stdout.flush() 10 | while data: 11 | data = sys.stdin.read(1) 12 | sys.stdout.write(data) 13 | sys.stdout.flush() 14 | # Just here to have something to read from stderr. 15 | sys.stderr.write("Blah...") 16 | 17 | # end of cat.py 18 | -------------------------------------------------------------------------------- /win32/Demos/security/lsaregevent.py: -------------------------------------------------------------------------------- 1 | import win32event 2 | import win32security 3 | 4 | evt = win32event.CreateEvent(None, 0, 0, None) 5 | win32security.LsaRegisterPolicyChangeNotification( 6 | win32security.PolicyNotifyAuditEventsInformation, evt 7 | ) 8 | print("Waiting for you change Audit policy in Management console ...") 9 | ret_code = win32event.WaitForSingleObject(evt, 1000000000) 10 | ## should come back when you change Audit policy in Management console ... 11 | print(ret_code) 12 | win32security.LsaUnregisterPolicyChangeNotification( 13 | win32security.PolicyNotifyAuditEventsInformation, evt 14 | ) 15 | -------------------------------------------------------------------------------- /win32/Demos/security/lsastore.py: -------------------------------------------------------------------------------- 1 | import win32security 2 | 3 | policy_handle = win32security.GetPolicyHandle("", win32security.POLICY_ALL_ACCESS) 4 | privatedata = "some sensitive data" 5 | keyname = "tmp" 6 | win32security.LsaStorePrivateData(policy_handle, keyname, privatedata) 7 | retrieveddata = win32security.LsaRetrievePrivateData(policy_handle, keyname) 8 | assert retrieveddata == privatedata 9 | 10 | ## passing None deletes key 11 | win32security.LsaStorePrivateData(policy_handle, keyname, None) 12 | win32security.LsaClose(policy_handle) 13 | -------------------------------------------------------------------------------- /win32/Demos/security/query_information.py: -------------------------------------------------------------------------------- 1 | import win32api 2 | import win32security 3 | import winerror 4 | from ntsecuritycon import TOKEN_QUERY, TokenUser 5 | 6 | 7 | # This is a Python implementation of win32api.GetDomainName() 8 | def GetDomainName(): 9 | try: 10 | tok = win32security.OpenThreadToken(win32api.GetCurrentThread(), TOKEN_QUERY, 1) 11 | except win32api.error as details: 12 | if details[0] != winerror.ERROR_NO_TOKEN: 13 | raise 14 | # attempt to open the process token, since no thread token 15 | # exists 16 | tok = win32security.OpenProcessToken(win32api.GetCurrentProcess(), TOKEN_QUERY) 17 | sid, attr = win32security.GetTokenInformation(tok, TokenUser) 18 | win32api.CloseHandle(tok) 19 | 20 | name, dom, typ = win32security.LookupAccountSid(None, sid) 21 | return dom 22 | 23 | 24 | if __name__ == "__main__": 25 | print("Domain name is", GetDomainName()) 26 | -------------------------------------------------------------------------------- /win32/Demos/security/sa_inherit.py: -------------------------------------------------------------------------------- 1 | import pywintypes 2 | import win32security 3 | 4 | sa = pywintypes.SECURITY_ATTRIBUTES() 5 | tmp_sid = win32security.LookupAccountName("", "tmp")[0] 6 | sa.SetSecurityDescriptorOwner(tmp_sid, 0) 7 | sid = sa.SECURITY_DESCRIPTOR.GetSecurityDescriptorOwner() 8 | print(win32security.LookupAccountSid("", sid)) 9 | -------------------------------------------------------------------------------- /win32/Demos/security/set_policy_info.py: -------------------------------------------------------------------------------- 1 | import win32security 2 | 3 | policy_handle = win32security.GetPolicyHandle("rupole", win32security.POLICY_ALL_ACCESS) 4 | 5 | event_audit_info = win32security.LsaQueryInformationPolicy( 6 | policy_handle, win32security.PolicyAuditEventsInformation 7 | ) 8 | print(event_audit_info) 9 | 10 | new_audit_info = list(event_audit_info[1]) 11 | new_audit_info[win32security.AuditCategoryPolicyChange] = ( 12 | win32security.POLICY_AUDIT_EVENT_SUCCESS | win32security.POLICY_AUDIT_EVENT_FAILURE 13 | ) 14 | new_audit_info[win32security.AuditCategoryAccountLogon] = ( 15 | win32security.POLICY_AUDIT_EVENT_SUCCESS | win32security.POLICY_AUDIT_EVENT_FAILURE 16 | ) 17 | new_audit_info[win32security.AuditCategoryLogon] = ( 18 | win32security.POLICY_AUDIT_EVENT_SUCCESS | win32security.POLICY_AUDIT_EVENT_FAILURE 19 | ) 20 | 21 | win32security.LsaSetInformationPolicy( 22 | policy_handle, win32security.PolicyAuditEventsInformation, (1, new_audit_info) 23 | ) 24 | 25 | win32security.LsaClose(policy_handle) 26 | -------------------------------------------------------------------------------- /win32/Demos/service/install/perf_install.h: -------------------------------------------------------------------------------- 1 | #All these simply list the counters in order. 2 | #Important that you add these in this order in 3 | #the Python code. 4 | 5 | #define SERVICE 0 6 | #define HEARTBEAT 2 7 | #define READ 4 8 | #define WRITE 6 9 | #define THREAD 8 10 | -------------------------------------------------------------------------------- /win32/Demos/service/install/perf_install.ini: -------------------------------------------------------------------------------- 1 | [info] 2 | drivername = PipeServicePerf 3 | symbolfile = perf_install.h 4 | 5 | [languages] 6 | 009 = English 7 | 8 | [text] 9 | SERVICE_009_NAME = Python Demo Service 10 | SERVICE_009_HELP = Shows performance statistics for the sample Python service 11 | HEARTBEAT_009_NAME = Heartbeat pulse 12 | HEARTBEAT_009_HELP = Regular counter to indicate the service is alive. Useful so system monitors can detect health even under low loads. 13 | READ_009_NAME = Bytes read/sec 14 | READ_009_HELP = Number of bytes read in total 15 | WRITE_009_NAME = Bytes written/sec 16 | WRITE_009_HELP = Number of bytes written in total 17 | THREADS_009_NAME = Number of threads 18 | THREADS_009_HELP = Number of threads currently servicing client connections 19 | -------------------------------------------------------------------------------- /win32/Demos/service/install/readme.txt: -------------------------------------------------------------------------------- 1 | This directory contains stuff needed to install the Performance 2 | Monitoring counters for the test service. 3 | 4 | This stuff is only needed at install time, and not used at runtime. 5 | 6 | This sample code does attempt to install this information at runtime 7 | when the sample service is installed. However, if you use a setup 8 | program for example this is not needed in the runtime environment. 9 | 10 | The NT API's require a .h and a .ini. These are not used by the Python 11 | runtime at all. It is your programs responsibility to create counters 12 | in your Python code which correspond to the entries here. 13 | -------------------------------------------------------------------------------- /win32/Demos/win32servicedemo.py: -------------------------------------------------------------------------------- 1 | import win32con 2 | import win32service 3 | 4 | 5 | def EnumServices(): 6 | resume = 0 7 | accessSCM = win32con.GENERIC_READ 8 | accessSrv = win32service.SC_MANAGER_ALL_ACCESS 9 | 10 | # Open Service Control Manager 11 | hscm = win32service.OpenSCManager(None, None, accessSCM) 12 | 13 | # Enumerate Service Control Manager DB 14 | 15 | typeFilter = win32service.SERVICE_WIN32 16 | stateFilter = win32service.SERVICE_STATE_ALL 17 | 18 | statuses = win32service.EnumServicesStatus(hscm, typeFilter, stateFilter) 19 | for short_name, desc, status in statuses: 20 | print(short_name, desc, status) 21 | 22 | 23 | EnumServices() 24 | -------------------------------------------------------------------------------- /win32/Demos/win32ts_logoff_disconnected.py: -------------------------------------------------------------------------------- 1 | """Finds any disconnected terminal service sessions and logs them off""" 2 | 3 | import pywintypes 4 | import win32ts 5 | import winerror 6 | 7 | sessions = win32ts.WTSEnumerateSessions(win32ts.WTS_CURRENT_SERVER_HANDLE) 8 | for session in sessions: 9 | """ 10 | WTS_CONNECTSTATE_CLASS: WTSActive,WTSConnected,WTSConnectQuery,WTSShadow,WTSDisconnected, 11 | WTSIdle,WTSListen,WTSReset,WTSDown,WTSInit 12 | """ 13 | if session["State"] == win32ts.WTSDisconnected: 14 | sessionid = session["SessionId"] 15 | username = win32ts.WTSQuerySessionInformation( 16 | win32ts.WTS_CURRENT_SERVER_HANDLE, sessionid, win32ts.WTSUserName 17 | ) 18 | print("Logging off disconnected user:", username) 19 | try: 20 | win32ts.WTSLogoffSession(win32ts.WTS_CURRENT_SERVER_HANDLE, sessionid, True) 21 | except pywintypes.error as e: 22 | if e.winerror == winerror.ERROR_ACCESS_DENIED: 23 | print("Can't kill that session:", e.strerror) 24 | else: 25 | raise 26 | -------------------------------------------------------------------------------- /win32/Lib/afxres.py: -------------------------------------------------------------------------------- 1 | import warnings 2 | 3 | from pywin.mfc.afxres import * 4 | 5 | warnings.warn( 6 | "Importing the global `afxres` module is deprecated. Import from `pywin.mfc.afxres` instead.", 7 | category=DeprecationWarning, 8 | ) 9 | -------------------------------------------------------------------------------- /win32/Lib/pywin32_bootstrap.py: -------------------------------------------------------------------------------- 1 | # Imported by pywin32.pth to bootstrap the pywin32 environment in "portable" 2 | # environments or any other case where the post-install script isn't run. 3 | # 4 | # In short, there's a directory installed by pywin32 named 'pywin32_system32' 5 | # with some important DLLs which need to be found by Python when some pywin32 6 | # modules are imported. 7 | 8 | 9 | try: 10 | import pywin32_system32 11 | except ImportError: # Python ≥3.6: replace ImportError with ModuleNotFoundError 12 | pass 13 | else: 14 | import os 15 | 16 | # We're guaranteed only that __path__: Iterable[str] 17 | # https://docs.python.org/3/reference/import.html#path-attributes-on-modules 18 | for path in pywin32_system32.__path__: 19 | if os.path.isdir(path): 20 | os.add_dll_directory(path) 21 | break 22 | -------------------------------------------------------------------------------- /win32/Lib/win2kras.py: -------------------------------------------------------------------------------- 1 | """\ 2 | win2kras used to be an extension module with wrapped the "new" RAS functions \ 3 | in Windows 2000, so win32ras could still be used on NT/etc. 4 | I think in 2021 we can be confident pywin32 is not used on earlier OSs, so \ 5 | that functionality is now in win32ras. 6 | 7 | This exists just to avoid breaking old scripts.\ 8 | """ 9 | 10 | import warnings 11 | 12 | from win32ras import * # nopycln: import 13 | 14 | warnings.warn(str(__doc__), category=DeprecationWarning) 15 | -------------------------------------------------------------------------------- /win32/Lib/winxptheme.py: -------------------------------------------------------------------------------- 1 | """A useful wrapper around the "_winxptheme" module. 2 | 3 | Originally used when we couldn't be sure Windows XP apis were going to 4 | be available. In 2022, it's safe to assume they are, so this is just a wrapper 5 | around _winxptheme. 6 | """ 7 | 8 | from _winxptheme import * # nopycln: import 9 | -------------------------------------------------------------------------------- /win32/src/PerfMon/PyPerfMonControl.h: -------------------------------------------------------------------------------- 1 | 2 | // This structure is at the very head of the mapped file, and contains 3 | // admin information that needs to be shared between the DLL and this module. 4 | // The perfmon data follows directly. This data is _always_: 5 | // A PERF_OBJECT_TYPE 6 | // A number of PERF_COUNTER_DEFINITIONs 7 | 8 | // don't manage these size better cos I can't be bothered! 9 | const int MMCD_SERVICE_SIZE = 25; 10 | const int MMCD_EVENTSOURCE_SIZE = 25; 11 | 12 | enum SupplierStatus { 13 | SupplierStatusStopped = 0, 14 | SupplierStatusRunning, 15 | }; 16 | 17 | struct MappingManagerControlData { 18 | DWORD ControlSize; // Size of this structure. 19 | DWORD TotalSize; // Total Size allocated in the mapped file. 20 | SupplierStatus supplierStatus; 21 | WCHAR ServiceName[MMCD_SERVICE_SIZE]; // The name of the service or application. 22 | WCHAR EventSourceName[MMCD_EVENTSOURCE_SIZE]; // Source Name that appears in Event Log for errors. 23 | }; 24 | -------------------------------------------------------------------------------- /win32/src/PerfMon/perfmondata.def: -------------------------------------------------------------------------------- 1 | EXPORTS 2 | OpenPerformanceData 3 | CollectPerformanceData 4 | ClosePerformanceData 5 | -------------------------------------------------------------------------------- /win32/src/PyOVERLAPPED.cpp: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/mhammond/pywin32/50777ab2e67c8b8d4ca429a598cc97ce33719963/win32/src/PyOVERLAPPED.cpp -------------------------------------------------------------------------------- /win32/src/PySoundObjects.h: -------------------------------------------------------------------------------- 1 | #ifndef __PYSOUNDOBJECTS_H__ 2 | #define __PYSOUNDOBJECTS_H__ 3 | 4 | #include 5 | #include 6 | 7 | class PYWINTYPES_EXPORT PyWAVEFORMATEX : public PyObject { 8 | public: 9 | PyWAVEFORMATEX(void); 10 | PyWAVEFORMATEX(const WAVEFORMATEX &); 11 | ~PyWAVEFORMATEX(); 12 | 13 | /* Python support */ 14 | static void deallocFunc(PyObject *ob); 15 | 16 | #ifdef _MSC_VER 17 | #pragma warning(disable : 4251) 18 | #endif // _MSC_VER 19 | static struct PyMemberDef members[]; 20 | #ifdef _MSC_VER 21 | #pragma warning(default : 4251) 22 | #endif // _MSC_VER 23 | WAVEFORMATEX m_wfx; 24 | }; 25 | 26 | #endif 27 | -------------------------------------------------------------------------------- /win32/src/PyWAVEFORMATEX.cpp: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/mhammond/pywin32/50777ab2e67c8b8d4ca429a598cc97ce33719963/win32/src/PyWAVEFORMATEX.cpp -------------------------------------------------------------------------------- /win32/src/PythonService.rc: -------------------------------------------------------------------------------- 1 | STRINGTABLE DISCARDABLE 2 | BEGIN 3 | 2000 "Dummy" // Needed to version branding works! 4 | END 5 | -------------------------------------------------------------------------------- /win32/test/test_win32net.py: -------------------------------------------------------------------------------- 1 | import unittest 2 | 3 | import win32net 4 | 5 | 6 | class TestCase(unittest.TestCase): 7 | def testGroupsGoodResume(self, server=None): 8 | res = 0 9 | level = 0 # setting it to 1 will provide more detailed info 10 | while True: 11 | (user_list, total, res) = win32net.NetGroupEnum(server, level, res) 12 | for i in user_list: 13 | pass 14 | if not res: 15 | break 16 | 17 | def testGroupsBadResume(self, server=None): 18 | res = 1 # Can't pass this first time round. 19 | self.assertRaises(win32net.error, win32net.NetGroupEnum, server, 0, res) 20 | 21 | 22 | if __name__ == "__main__": 23 | unittest.main() 24 | -------------------------------------------------------------------------------- /win32/test/test_win32print.py: -------------------------------------------------------------------------------- 1 | # Tests (scarce) for win32print module 2 | 3 | import unittest 4 | 5 | import win32print as wprn 6 | 7 | 8 | class Win32PrintTestCase(unittest.TestCase): 9 | def setUp(self): 10 | self.printer_idx = 0 11 | self.printer_levels_all = list(range(1, 10)) 12 | self.local_printers = wprn.EnumPrinters(wprn.PRINTER_ENUM_LOCAL, None, 1) 13 | 14 | def test_printer_levels_read_dummy(self): 15 | if not self.local_printers: 16 | print("Test didn't run (no local printers)!") 17 | return 18 | ph = wprn.OpenPrinter(self.local_printers[self.printer_idx][2]) 19 | for level in self.printer_levels_all: 20 | wprn.GetPrinter(ph, level) 21 | 22 | 23 | if __name__ == "__main__": 24 | unittest.main() 25 | -------------------------------------------------------------------------------- /win32/test/test_win32profile.py: -------------------------------------------------------------------------------- 1 | """Test win32profile""" 2 | 3 | import os 4 | import unittest 5 | 6 | import win32profile 7 | 8 | 9 | class Tester(unittest.TestCase): 10 | def test_environment(self): 11 | os.environ["FOO"] = "bar=baz" 12 | env = win32profile.GetEnvironmentStrings() 13 | self.assertIn("FOO", env) 14 | self.assertEqual(env["FOO"], "bar=baz") 15 | self.assertEqual(os.environ["FOO"], "bar=baz") 16 | 17 | 18 | if __name__ == "__main__": 19 | unittest.main() 20 | -------------------------------------------------------------------------------- /win32/test/test_win32timezone.py: -------------------------------------------------------------------------------- 1 | # Test module for win32timezone 2 | 3 | import doctest 4 | import unittest 5 | 6 | import win32timezone 7 | 8 | 9 | class Win32TimeZoneTest(unittest.TestCase): 10 | def testWin32TZ(self): 11 | failed, total = doctest.testmod(win32timezone, verbose=False) 12 | self.assertFalse(failed) 13 | 14 | 15 | if __name__ == "__main__": 16 | unittest.main() 17 | -------------------------------------------------------------------------------- /win32/test/test_win32ts.py: -------------------------------------------------------------------------------- 1 | # Tests for win32ts module 2 | 3 | import unittest 4 | 5 | import win32ts 6 | 7 | 8 | class Win32TsTestCase(unittest.TestCase): 9 | def test_is_remote_session(self): 10 | ret = win32ts.WTSQuerySessionInformation( 11 | win32ts.WTS_CURRENT_SERVER_HANDLE, 12 | win32ts.WTS_CURRENT_SESSION, 13 | win32ts.WTSIsRemoteSession, 14 | ) 15 | self.assertIsInstance(ret, bool) 16 | 17 | 18 | if __name__ == "__main__": 19 | unittest.main() 20 | -------------------------------------------------------------------------------- /win32/test/win32crypt_testcert_base64.cer: -------------------------------------------------------------------------------- 1 | MIIDKjCCAhKgAwIBAgIQaywn/6CWRlGT/OAEKRt05TANBgkqhkiG9w0BAQsFADASMRAwDgYDVQQDEwdicmFuZG9uMB4XDTIyMDQxMjE1MjQyOFoXDTIzMDQxMjE1MzQyOFowEjEQMA4GA1UEAxMHYnJhbmRvbjCCASIwDQYJKoZIhvcNAQEBBQADggEPADCCAQoCggEBAMTXRWxv/xyYMy7BIUj6obtQ9+prBV+6dgmvIXMV5OqirGb2ldA3lP2yO1VSnxchFSLuwGNsEc9R6MYwa+ftPuJMQETzCpQTDZqmu8LqZAxkqU6D4sqHWU3DhSTE0M1vBBTFN8vSvrhAAnH0EJ1sEfIHsxOMzksEMWxFVzR6yMwgTZe1akPq5AfthSdKmN+XI3nIliiJbeq1SpFvNrj5tpdp3xqr+G4wjuBzghgmMAE4C/xAQ9b43VAbQvQiw5JSFU9sAQeUvFdfDLg/tVN5aDmJUdVLQ9oXMAJv1ZfJGdpPwEsGGhnHx0Qrvpn1jh56Nq7tDhsalgkoJw2HhPfVwvUCAwEAAaN8MHowDgYDVR0PAQH/BAQDAgWgMAkGA1UdEwQCMAAwHQYDVR0lBBYwFAYIKwYBBQUHAwEGCCsGAQUFBwMCMB8GA1UdIwQYMBaAFPHRgQjh+QpSvNiXHdqWbSwIquZ7MB0GA1UdDgQWBBTx0YEI4fkKUrzYlx3alm0sCKrmezANBgkqhkiG9w0BAQsFAAOCAQEAIvLp6BqDiI9Hh40b1+EOIJetX0pf6gyi16N/s7d+fR3hHxerfLxJ4tB2FR1YCx+xf1h66ucaPEBHaokOyQ+UOuLcoc0KHOv+MIzZ5G8d7lv7AGpPn3F0OwwRuo4SxJNgxRYYynOfQf5QTs5rJkGBmMRehM6tSIlZWymFvsBxxCjI+SIiRa7/iL1TEUDMbMQI6MG0i8uLrOHGO7ioChk+rgXEH82gl6nPQx8pQrVTzv2NAJXVPWNhrGci/64b0OqJ4WFUrqbPXH7Vp27ROUD4PfB9CgVxBA+wjDwHeOAMmKxUvA1jGwyqf0VE11mJaSxH2luNv7/z+dGSUQDEXCqWlw== 2 | -------------------------------------------------------------------------------- /win32/test/win32crypt_testcert_bin.cer: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/mhammond/pywin32/50777ab2e67c8b8d4ca429a598cc97ce33719963/win32/test/win32crypt_testcert_bin.cer -------------------------------------------------------------------------------- /win32/test/win32rcparser/python.bmp: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/mhammond/pywin32/50777ab2e67c8b8d4ca429a598cc97ce33719963/win32/test/win32rcparser/python.bmp -------------------------------------------------------------------------------- /win32/test/win32rcparser/python.ico: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/mhammond/pywin32/50777ab2e67c8b8d4ca429a598cc97ce33719963/win32/test/win32rcparser/python.ico -------------------------------------------------------------------------------- /win32/winxpgui.py: -------------------------------------------------------------------------------- 1 | """\ 2 | The `winxpgui` module is obsolete and has been completely replaced \ 3 | by `win32gui` and `win32console.GetConsoleWindow`. Use those instead. \ 4 | """ 5 | 6 | import warnings 7 | 8 | from win32console import ( # nopycln: import 9 | GetConsoleWindow as GetConsoleWindow, # noqa: PLC0414 # Explicit re-export 10 | ) 11 | from win32gui import * # nopycln: import 12 | 13 | warnings.warn(str(__doc__), category=DeprecationWarning) 14 | --------------------------------------------------------------------------------