本文整理汇总了Python中win32api.LoadLibrary方法的典型用法代码示例。如果您正苦于以下问题:Python win32api.LoadLibrary方法的具体用法?Python win32api.LoadLibrary怎么用?Python win32api.LoadLibrary使用的例子?那么恭喜您, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类win32api
的用法示例。
在下文中一共展示了win32api.LoadLibrary方法的10个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的Python代码示例。
示例1: __init__
# 需要导入模块: import win32api [as 别名]
# 或者: from win32api import LoadLibrary [as 别名]
def __init__(self, shell):
win32gui.InitCommonControls()
self.hinst = win32gui.dllhandle
# win32api.LoadLibrary('MSFTEDIT.dll')
self.shell = shell
self.hicon = None
self.list_data = {}
self.className = "AvaConsole"
self.title = 'Ava Console'
self.hwnd = None
self.job_name = 'job-1'
self.script = ''
self.row = 1
self.col = 1
self.hidden = False
self.validator = ScriptValidator()
示例2: MyComputer
# 需要导入模块: import win32api [as 别名]
# 或者: from win32api import LoadLibrary [as 别名]
def MyComputer(self):
mc_reg = None
try:
mc_reg = _winreg.OpenKey(
_winreg.HKEY_CLASSES_ROOT,
"CLSID\\{20D04FE0-3AEA-1069-A2D8-08002B30309D}"
)
value, type = _winreg.QueryValueEx(mc_reg, "LocalizedString")
dll = os.path.split(value.split(",")[0][1:])[1]
index = -1*int(value.split(",")[1])
myComputer = LoadString(LoadLibrary(dll), index)
except:
myComputer = self.text.myComp
if mc_reg:
_winreg.CloseKey(mc_reg)
return myComputer
示例3: CreateViewWindow
# 需要导入模块: import win32api [as 别名]
# 或者: from win32api import LoadLibrary [as 别名]
def CreateViewWindow(self, prev, settings, browser, rect):
print "ScintillaShellView.CreateViewWindow", prev, settings, browser, rect
# Make sure scintilla.dll is loaded. If not, find it on sys.path
# (which it generally is for Pythonwin)
try:
win32api.GetModuleHandle("Scintilla.dll")
except win32api.error:
for p in sys.path:
fname = os.path.join(p, "Scintilla.dll")
if not os.path.isfile(fname):
fname = os.path.join(p, "Build", "Scintilla.dll")
if os.path.isfile(fname):
win32api.LoadLibrary(fname)
break
else:
raise RuntimeError("Can't find scintilla!")
style = win32con.WS_CHILD | win32con.WS_VSCROLL | \
win32con.WS_HSCROLL | win32con.WS_CLIPCHILDREN | \
win32con.WS_VISIBLE
self.hwnd = win32gui.CreateWindow("Scintilla", "Scintilla", style,
rect[0], rect[1], rect[2]-rect[0], rect[3]-rect[1],
self.hwnd_parent, 1000, 0, None)
message_map = {
win32con.WM_SIZE: self.OnSize,
}
# win32gui.SetWindowLong(self.hwnd, win32con.GWL_WNDPROC, message_map)
file_data = file(self.filename, "U").read()
self._SetupLexer()
self._SendSci(scintillacon.SCI_ADDTEXT, len(file_data), file_data)
if self.lineno != None:
self._SendSci(scintillacon.SCI_GOTOLINE, self.lineno)
print "Scintilla's hwnd is", self.hwnd
示例4: __getitem__
# 需要导入模块: import win32api [as 别名]
# 或者: from win32api import LoadLibrary [as 别名]
def __getitem__(self, filename):
key = filename.lower()
return self.__cache.setdefault(key, win32api.LoadLibrary(key))
示例5: __enter__
# 需要导入模块: import win32api [as 别名]
# 或者: from win32api import LoadLibrary [as 别名]
def __enter__(self):
self._handle = win32api.LoadLibrary(self._path)
return self._handle
示例6: extract_manifest
# 需要导入模块: import win32api [as 别名]
# 或者: from win32api import LoadLibrary [as 别名]
def extract_manifest(path, resource_name):
"""Reads manifest from |path| and returns it as a string.
Returns None is there is no such manifest."""
with LoadLibrary(path) as handle:
try:
return win32api.LoadResource(handle, RT_MANIFEST, resource_name)
except pywintypes.error as error:
if error.args[0] == winerror.ERROR_RESOURCE_DATA_NOT_FOUND:
return None
else:
raise
示例7: extract_manifest
# 需要导入模块: import win32api [as 别名]
# 或者: from win32api import LoadLibrary [as 别名]
def extract_manifest(path, resource_name):
"""Reads manifest from |path| and returns it as a string.
Returns None is there is no such manifest."""
with LoadLibrary(path) as handle:
try:
return win32api.LoadResource(
handle, RT_MANIFEST, resource_name).decode('utf-8', 'ignore')
except pywintypes.error as error:
if error.args[0] == winerror.ERROR_RESOURCE_DATA_NOT_FOUND:
return None
else:
raise
示例8: __enter__
# 需要导入模块: import win32api [as 别名]
# 或者: from win32api import LoadLibrary [as 别名]
def __enter__(self):
self._handle = win32api.LoadLibrary(self._path)
return self._handle
示例9: extract_manifest
# 需要导入模块: import win32api [as 别名]
# 或者: from win32api import LoadLibrary [as 别名]
def extract_manifest(path, resource_name):
"""Reads manifest from |path| and returns it as a string.
Returns None is there is no such manifest."""
with LoadLibrary(path) as handle:
try:
return win32api.LoadResource(handle, RT_MANIFEST, resource_name)
except pywintypes.error as error:
if error.args[0] == winerror.ERROR_RESOURCE_DATA_NOT_FOUND:
return None
else:
raise
示例10: extract_manifest
# 需要导入模块: import win32api [as 别名]
# 或者: from win32api import LoadLibrary [as 别名]
def extract_manifest(path, resource_name):
"""Reads manifest from |path| and returns it as a string.
Returns None is there is no such manifest."""
with LoadLibrary(path) as handle:
try:
return win32api.LoadResource(
handle, RT_MANIFEST, resource_name).decode('utf-8', 'ignore')
except pywintypes.error as error:
if error.args[0] == winerror.ERROR_RESOURCE_DATA_NOT_FOUND:
return None
else:
raise