pywin32

How can I set up a dedicated screen area for an application in Python?

孤者浪人 提交于 2019-12-03 16:40:26
A good example is MS OneNote. It has the option to be fixed to one side of the screen and pushes all other windows to the side. When maximizing or resizing other windows, they can only expand up to the edge of OneNote. Does Python have this capability using Tkinter or another module? Thank you for any assistance. The win32 feature you're looking for is called Application Desktop Toolbars - it allows your application to cooperate with the shell and reserve space along the side, similar to the taskbar. If you want to implement this yourself, you'll likely need to use Win32 somehow. It looks like

py2exe com dll problem

China☆狼群 提交于 2019-12-03 16:35:30
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 this: # # % python setup.py py2exe # # After you run this (from this directory) you will find two directories here: # "build" and "dist". The .dll file in dist is what you are looking for. ##############################################################################

Send key combination with python

纵然是瞬间 提交于 2019-12-03 16:24:43
I want to be able to send the key combination SHIFT + CTRL + . (dot) using the following code: import win32com.client as comclt wsh= comclt.Dispatch("WScript.Shell") wsh.SendKeys() So far I was able to send CTRL + . (dot) like this : wsh.SendKeys(^.) How do I add the SHIFT key there ? Thanks to anyone who answers :) For Shift use + Complete list is available here: SendKeys ... To specify that a combination of SHIFT, CTRL, and ALT should be held down while several other keys are pressed, create a compound string argument with the modified keystrokes enclosed in parentheses. For example, to send

PIP (Python) : ImportError: cannot import name _remove_dead_weakref

别来无恙 提交于 2019-12-03 13:25:37
I am getting below error, I have search lot around but haven't been able to find a good fix- Please anyone who was getting this kind of error and resolved. please help. File "c:\python27\lib\runpy.py", line 174, in _run_module_as_main "__main__", fname, loader, pkg_name) File "c:\python27\lib\runpy.py", line 72, in _run_code exec code in run_globals File "C:\python27\Tools\Scripts\pip.exe\__main__.py", line 5, in <module> File "c:\python27\lib\site-packages\pip\__init__.py", line 5, in <module> import logging File "c:\python27\lib\logging\__init__.py", line 26, in <module> import sys, os, time

Using pywin32, what is the difference between Dispatch and DispatchEx?

旧城冷巷雨未停 提交于 2019-12-03 13:25:15
问题 When opening e.g. a spreadsheet with pywin32, I found two options to do so: excel1 = win32com.client.DispatchEx('Excel.Application') wb = excel1.Workbooks.Open('myxls.xls') or I could do excel2 = win32com.client.Dispatch('Excel.Application') wb = excel2.Workbooks.Open('myxls.xls') and I'm wondering if this makes any difference. The docstrings don't help me much either: >>> w32.Dispatch.__doc__ 'Creates a Dispatch based COM object.\n ' >>> w32.DispatchEx.__doc__ 'Creates a Dispatch based COM

How to extract 128x128 icon bitmap data from EXE in python

被刻印的时光 ゝ 提交于 2019-12-03 12:59:58
问题 I'm trying to extract icons from .exe files in windows using win32gui. I found the functionalities ExtractIconEx() and ExtractIcon(). I am able to get Icons of size 32x32 or 16x16 only from the above functionalities. the following link only answers way to extract 32x32 images. How to extract 32x32 icon bitmap data from EXE and convert it into a PIL Image object? I need to extract icons of size either 128x128 or greater than that.Any ideas on how to extract the largersize icons from exe files?

win32com.client.Dispatch(“Outlook.Application”) error pywintypes.com_error: (-2147221005, 'Invalid class string', None, None)

泪湿孤枕 提交于 2019-12-03 07:34:12
I am on windows 7 and I have windows live installed. Now when I am trying to run following code import win32com.client win32com.client.Dispatch("Outlook.Application") I am getting following error Traceback (most recent call last): File "<stdin>", line 1, in <module> File "C:\Python27\lib\site-packages\win32com\client\__init__.py", line 95, in Dispatch dispatch, userName = dynamic._GetGoodDispatchAndUserName(dispatch,userName,c lsctx) File "C:\Python27\lib\site-packages\win32com\client\dynamic.py", line 108, in _GetGoodDispatchAndUserName return (_GetGoodDispatch(IDispatch, clsctx), userName)

How do I get started with PyWin32 [closed]

為{幸葍}努か 提交于 2019-12-03 06:57:40
问题 As it currently stands, this question is not a good fit for our Q&A format. We expect answers to be supported by facts, references, or expertise, but this question will likely solicit debate, arguments, polling, or extended discussion. If you feel that this question can be improved and possibly reopened, visit the help center for guidance. Closed 6 years ago . I am looking for good resources to get started with pywin32. I haven’t found much in the way of tutorials, books or blogs that talk

Creating pivot table in Excel using python

岁酱吖の 提交于 2019-12-03 03:21:40
问题 I adapted the following code found here to create a pivot table in my existing excel sheet: import win32com.client as win32 win32c = win32.constants import sys import itertools tablecount = itertools.count(1) def addpivot(wb,sourcedata,title,filters=(),columns=(), rows=(),sumvalue=(),sortfield=""): newsheet = wb.Sheets.Add() newsheet.Cells(1,1).Value = title newsheet.Cells(1,1).Font.Size = 16 tname = "PivotTable%d"%tablecount.next() pc = wb.PivotCaches().Add(SourceType=win32c.xlDatabase,

SetCursorPos fail with “the parameter is incorrect” after rdp session terminated

此生再无相见时 提交于 2019-12-03 00:16:26
问题 I have application running on win 2008 server. It is using win32 api and it works just fine when i connected to the server with RDP. When i disconnect every call to SetCursorPos end with this failure. Coordinates (arguments) are same for both cases. Any thoughts ? 回答1: If RDP is disconnected, it's impossible to do anything with GUI (no screen, no mouse). There are few workarounds though. Keep RDP open (not in a full screen) and switch to another window on local machine (RDP must not be