pywin32

PyWin32: Windows Classic theme

In the PyWin32 demos folder, the win32gui_dialog.py sample uses the classic windows controls. Can the Windows Vista themed buttons also be displayed using PyWin32, and if so, how? I'm using ActivePython 3.1, if that makes any difference. Sample: ...

Get the position of the windows start menu

I'm writing an app in Python that automatically moves stuff around. How do I get the position of the windows start menu bar, so I can account for it in my calculations? ...

registering python com server

Hi all, I have a problem when registering a Python com server, I got a message box that says : Invalid command line argument. This programs provides LocalServer com support for Python COM objects. It is typically run automatically by COM, passing passing as arguments The ProgID or CLSID of the Python server(s) to be ho...

Get memory usage of computer in Windows with Python

How can I tell what the computer's overall memory usage is from Python, running on Windows XP? ...

Get list of open windows in Python

Hi there, I'm writing and app in Python that must be able to send keys or text to other app. For example, If I have Firefox open, I should be able to send it an URL to open it. I've already have the SendKeys module, and I read about the win32 module too, but I don't know if there's a way to filter out process without open windows. Any ...

What's the correct way to use win32file.ReadFile to get the output from a pipe?

I'm using the pywin32 extensions to access the win32 API under Python. I'm new at doing Windows programming in Python -- I'm a POSIX guy -- so I may be doing things in a bone-headed manner. I'm trying to use the win32file.ReadFile function properly, and I'm having some trouble interpreting the possible result codes. I'm calling the fun...

Python win32 service

Hey guys, I am fairly new to python, and have no experience with writing services for windows. I have tried to hack together a windows service based on afew tutorials i have found out there. I need this service to constantly monitor a directory for changes and when it sees a change it runs a script. Here is what i have so far: import ...

Downloading a File Protected by NTLM/SSPI Without Prompting For Credentials Using Python on Win32?

The title says it all, even if it is a mouthful! I need to download a file on a corporate Sharepoint site using CPython. Existing codebase prevents me from using Ironpython without porting the code, so .NET's WebClient library is out. I also want to download the file without prompting the user to save and without prompting the user for ...

How do I watch a folder for changes and when changes are done using Python?

i need to watch a folder for incoming files. i did that with the following help: http://stackoverflow.com/questions/182197/how-do-i-watch-a-file-for-changes-using-python the problem is that the files that are being moved are pretty big (10gb) and i want to be notified when all files are done moving. i tried comparing the size of the fold...

how to get internet explorer address bar for python

hi; i need grab to internet explorer address bar. how to get address bar url for python ? (i need second part other browsers grabbing address bar but internet explorer is urgently). Thanks. ...

Making Noise with Python

I am trying to get python to make noise when certain things happen. Preferably, i would like to play music of some kind, however some kind of distinctive beeping would be sufficient, like an electronic timer going off. I have thus far only been able to make the system speaker chime using pywin32's Beep, however this simply does not have ...

Python Windows File Copy with Wildcard Support

I've been doing this all the time: result = subprocess.call(['copy', '123*.xml', 'out_folder\\.', '/y']) if result == 0: do_something() else: do_something_else() Until today I started to look into pywin32 modules, then I saw functions like win32file.CopyFiles(), but then I found it may not support copying files to a directo...

how to get firefox address bar url for python (pywin32)

hi; i need grab to firefox address bar. how to get address bar url for python ? (i need second part other browsers chrome and safari grabbing address bar but firefox is urgently). Thanks. ...

question about python COM programming

Hey, I am trying to get the Dispatch object of IHTMLDocument3, so I wrote the following code wo = pythoncom.New('InternetExplorer.Application') wo.QueryInterface('{3050F673-98B5-11CF-BB82-00AA00BDCE0B}') But got the following error: pywintypes.com_error: (-2147467262, 'No such interface supported', None, None) Any idea on how to ...

SMTP through Exchange using Integrated Windows Authentication (NTLM) using Python

I want to use the credentials of the logged-in Windows user to authenticate an SMTP connection to an Exchange server using NTLM. I'm aware of the python-ntlm module and the two patches that enable NTLM authentication for SMTP, however I want to use the current user's security token and not have to supply a username and password. Very s...

Setting criteria on an autofilter in pyWin32

I can set up an autofilter using pyWin32, but I wondered if it's possible to set a default filter and what the syntax would be. For example, I'd like to set a filter on a year column and set the default for the current year. xl = Dispatch("Excel.Application") xl.Workbooks.Open(file_path) xl.ActiveWorkbook.Worksheets(sheetname).Range...

Media Kind in iTunes COM for Windows SDK

I recently found out about the awesomeness of the iTunes COM for Windows SDK. I am using Python with win32com to talk to my iTunes library. Needless to say, my head is in the process of exploding. This API rocks. I have one issue though, how do I access the Media Kind attribute of the track? I looked through the help file provided in t...

Python win32api registry key change

Hi, I am trying to trigger an event every time a registry value is being modified. import win32api import win32event import win32con import _winreg key = _winreg.OpenKey(_winreg.HKEY_CURRENT_USER,'Control Panel\Desktop',0,_winreg.KEY_READ) sub_key = _winreg.CreateKey(key,'Wallpaper') evt = win32event.CreateEvent(None,0,0,None) win32api...

py2exe com dll problem

hi; i'm trying making a com dll in python. but i try register to compiled dll have a error message "run time error r6034" and "could not load python dll" what is the solution this problem ? mycode : setup.py: # This is the distutils script for creating a Python-based com dll # server using ctypes.com. This script should be run like...

Python [win32com/pywin32] using fireEvent to simulate keypress in flash object?

I am currently using pywin32 to create an Internet Explorer window and grab an object which I then store it into a variable called flashObject. I can then call methods on this such as fireEvent. However, what I want to do is basically call fireEvent("onkeypress"), but I want to specify an event to go along with that so it will basically ...