Questions tagged [pythoncom]

PythonCOM is a module, encapsulating the OLE automation API.

PythonCOM is a module, encapsulating the OLE automation API.

http://timgolden.me.uk/pywin32-docs/html/com/win32com/HTML/PythonCOM.html

108 questions
1
vote
1 answer

Win32Com python create global instance and use it in flask function

I am currently trying to run the following piece of code but I keep getting the error that pywintypes.com_error: (-2147417842, 'The application called an interface that was marshalled for a different thread.', None, None) Do i need to execute…
Prateek
  • 31
  • 3
1
vote
0 answers

How to edit task settings from pythoncom for windows 10 task scheduler

I am using the pythoncom library in order to programmatically create and control a windows task. There is a setting under the generated xml for the task under Settings, it is Stop the task if it runs longer than: .... I can not seem to find the…
aramnhammer
  • 135
  • 2
  • 9
1
vote
1 answer

pythoncom.PumpMessages() gives warning "no reference PumpMessages() in pythoncom"

I am making a keylogger, but every source I see needs that function and it is not working properly. I tried to update the library and it didn't fix the problem. all the code is working except the part below. I have no idea what the below means. pls,…
moe asal
  • 750
  • 8
  • 24
1
vote
1 answer

How to release PyIPropertyStore instance to allow os.rename

I am trying to get the media created datetime of a file using python, with reference to this question, Python - how to read Windows "Media Created" date (not file creation date), I have successfully gotten the media created datetime from the answer…
1
vote
1 answer

(Excel) VBA Crashes wihile accessing CodeModule

I'm trying to insert some code to VBA codemodule and excel crashes while reading CodeModule property. Here's an example code in python: excel = win32com.client.Dispatch("Excel.Application") excel.Visible = False workbook =…
bozo
  • 11
  • 1
1
vote
1 answer

How can I create multiple application instances in pythoncom?

I am attempting to use python to start up multiple processes using COM to asynchronously process several files (using concurrent.futures), but I can only manage to start up one process at a time. Here's an easy way to see the problem using…
1
vote
0 answers

Pythoncom - How to listen to Outlook Outgoing messages?

At the moment I am using the below code to listen to incoming messages in Outlook from Python. How can I do the same for Outgoing messages from my Outlook? import win32com.client import pythoncom class Handler_Class(object): senders =…
toniggg
  • 87
  • 8
1
vote
0 answers

Pythoncom interface cast

I would like to attach to a remote process with a running Visual Studio instance using pythoncom and COM objects provided by Microsoft Development Environment. So far I am able to acquire from DTE object a debugger object implementing Debugger…
Patrik Polakovic
  • 542
  • 1
  • 8
  • 20
1
vote
1 answer

Spyder is throwing "assert sys.modules[modname] is not old_mod" when running pythoncom code

Edited: If I run the following code two times via spyder, it gives me an error the second time I run it, the first time it always works: import pythoncom if __name__ == '__main__': print("hallo") This is the error: File…
Dan
  • 49
  • 1
  • 8
1
vote
0 answers

How can I use "pythoncom" with python 3.6 64bits

I have to use "pythoncom" to receive the variable from another application. I have downloaded "pywin32" from this website. https://sourceforge.net/projects/pywin32/files/pywin32/Build%20220/? Because my NB is win10 64bit and I use python 3.6 64bits…
Ricky Parker
  • 133
  • 2
  • 8
1
vote
0 answers

Python interfacing with c# COM dll - com_record not working as an [Out] parameter

I am running a python script to interface with a c# dll registered as a com application and having difficulty handling an output struct parameter. I create a COM record and successfully pass this into my COM function call but the data does not…
user5265160
  • 409
  • 1
  • 8
  • 19
1
vote
1 answer

Can I read Unicode values using pyHook?

I created a simple keylogging program. Everything that is typed on keyboard is sent to a log.txt file. The problem is that my code works only for ASCII code. When I type greek characters , they get treated as english. I want my code to: Accept…
Haki Terror
  • 343
  • 3
  • 15
1
vote
1 answer

pythoncom.CoCreateInstance can't create IZoneIdentifier; the interface is missing from registry too despite being documented in MSDN

I'm trying to implement Manipulating the zone identifier to specify where a file was download from – The Old New Thing - MSDN blogs in Python. At CoCreateInstance: pythoncom.CoCreateInstance( …
ivan_pozdeev
  • 33,874
  • 19
  • 107
  • 152
1
vote
1 answer

Tkinter withdraw oddness with pyHook

I have a Tkinter GUI application that I need to hide on a buttonpress. I cannot assume that the application will have focus, so I implemented pyHook, keylogger-style. However, whenever I call withdraw() from a function launched by pyHook, the window…
heidi
  • 655
  • 6
  • 20
1
vote
0 answers

Python COM Issues with OpenOPC when using a Threaded Timer

I am having an issue when trying to read OPC tags in a separate thread. Currently using windows and connecting to the Matrikon OPC Simuator using the DCOM mode. The code below works fine opc =…
rodp82
  • 275
  • 3
  • 12