当前位置: 首页>>代码示例>>Python>>正文


Python wintypes.byref函数代码示例

本文整理汇总了Python中wnd.wintypes.byref函数的典型用法代码示例。如果您正苦于以下问题:Python byref函数的具体用法?Python byref怎么用?Python byref使用的例子?那么恭喜您, 这里精选的函数代码示例或许可以为您提供帮助。


在下文中一共展示了byref函数的15个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的Python代码示例。

示例1: CreateExclusionName

def CreateExclusionName(name, flag):
	from wnd.api import winos
	if winos.IsNT():

		if flag=='desktop':
			## create a name exclusive to the current desktop
			#UOI_NAME     = 2
			hDesk= user32.GetThreadDesktop(kernel32.GetCurrentThreadId())
			
			dwLen= c_ulong()
			user32.GetUserObjectInformationA(hDesk, 2, None, 0, byref(dwLen))
			p = create_string_buffer('', size=dwLen.value)
			if user32.GetUserObjectInformationA(hDesk, 2, p, dwLen.value, byref(dwLen)):
				name = '%s-%s' % (name, p.value)
			user32.CloseDesktop(hDesk)
			return name

		elif flag== 'session':
			## create a name exclusive to the current session
			from wnd.api import privleges
			try:
				st= privleges.GetTokenStats(None)
				name = '%s-%s' % (name, st.AuthenticationId)
			except: pass
			return name
		
		elif flag == 'trustee':
			## create a name exclusive to the current, well trustee that is.  
			import os
			domain= os.getenv('USERDOMAIN')
			if domain:
				return '%s-%s' % (name, domain)
		
	# default
	return name	
开发者ID:Acidburn0zzz,项目名称:KomodoEdit,代码行数:35,代码来源:methods.py

示例2: __init__

	def __init__(self, size='small'):
	
		GPA = kernel32.GetProcAddress
		isNT= winos.IsNT()
		if isNT:
			## ?? check what happens on successive inits
			## should be the same handle returned, at least I hope so
			GPA.restype = WINFUNCTYPE(BOOL, BOOL) 
			try:
				IconInit = GPA(shell32._handle, 660)
				IconInit(1)
			except:
				raise RuntimeError, "could not retrieve IconInit api"
			
		GPA.restype = WINFUNCTYPE(INT, POINTER(HANDLE), POINTER(HANDLE))
		try:
			SH_GetImageLists = GPA(shell32._handle, 71) 
		except:
			raise RuntimeError, "could not retrieve shell_GetImageLists api"
		
			
		small = HANDLE()
		large = HANDLE()
		if not SH_GetImageLists(byref(large), byref(small)):
			raise RuntimeError, "could not retrieve system imagelist"
		
		if not (large.value and small.value):
			raise RuntimeError, "could not retrieve system imagelist"
		
		if size=='small':
			self.handle= small.value
		else:
			self.handle= large.value
开发者ID:Acidburn0zzz,项目名称:KomodoEdit,代码行数:33,代码来源:imagelist.py

示例3: SetParts

 def SetParts(self, *parts):
     if len(parts) > 255:
         raise RuntimeError("too many parts")
     n = len(parts)
     arr = (c_int * n)(*parts)
     if not self.SendMessage(self.Hwnd, self.Msg.SB_SETPARTS, n, byref(arr)):
         raise RuntimeError("could not set parts")
开发者ID:nagyist,项目名称:KomodoEdit,代码行数:7,代码来源:statusbar.py

示例4: GetMonthRange

	def GetMonthRange(self, visible=True):
		st1=SYSTEMTIME()
		st2=SYSTEMTIME()
		arrSt=(SYSTEMTIME*2)(st1, st2)
		result=self.SendMessage(self.Hwnd,
				self.Msg.MCM_GETMONTHRANGE, GMR_DAYSTATE, byref(arrSt))
		return result, st1, st2
开发者ID:Acidburn0zzz,项目名称:KomodoEdit,代码行数:7,代码来源:monthcal.py

示例5: SetBandWidth

	def SetBandWidth(self, ID, n):
		bi=REBARBANDINFO()
		bi.fMask =  RBBIM_SIZE
		bi.cx = n
		if not self.SendMessage(self.Hwnd, self.Msg.RB_SETBANDINFO,
															self.IDToIndex(ID), byref(bi)):
			raise "could set band width"
开发者ID:Acidburn0zzz,项目名称:KomodoEdit,代码行数:7,代码来源:rebar.py

示例6: GetBandChild

	def GetBandChild(self, ID):
		bi=REBARBANDINFO()
		bi.fMask = RBBIM_CHILD
		if not self.SendMessage(self.Hwnd, self.Msg.RB_GETBANDINFO,
															self.IDToIndex(ID), byref(bi)):
			raise "could retrieve band child"
		if bi.hwndChild: return bi.hwndChild
开发者ID:Acidburn0zzz,项目名称:KomodoEdit,代码行数:7,代码来源:rebar.py

示例7: GetBandHeaderSize

	def GetBandHeaderSize(self, ID):
		bi=REBARBANDINFO()
		bi.fMask |= RBBIM_HEADERSIZE
		if not self.SendMessage(self.Hwnd, self.Msg.RB_GETBANDINFO,
															self.IDToIndex(ID), byref(bi)):
			raise "could retrieve band header size"
		return bi.cxHeader 
开发者ID:Acidburn0zzz,项目名称:KomodoEdit,代码行数:7,代码来源:rebar.py

示例8: GetBandMaximizedWidth

	def GetBandMaximizedWidth(self, ID):
		bi=REBARBANDINFO()
		bi.fMask |= RBBIM_IDEALSIZE 
		if not self.SendMessage(self.Hwnd, self.Msg.RB_GETBANDINFO,
															self.IDToIndex(ID), byref(bi)):
			raise "could retrieve band maximized size"
		return bi.cxIdeal
开发者ID:Acidburn0zzz,项目名称:KomodoEdit,代码行数:7,代码来源:rebar.py

示例9: SetBandImage

	def SetBandImage(self, ID, i):
		bi=REBARBANDINFO()
		bi.fMask = RBBIM_IMAGE
		bi.iImage=i
		if not self.SendMessage(self.Hwnd, self.Msg.RB_SETBANDINFO,
															self.IDToIndex(ID), byref(bi)):
			raise "could set band image"
开发者ID:Acidburn0zzz,项目名称:KomodoEdit,代码行数:7,代码来源:rebar.py

示例10: SetItemImage

	def SetItemImage(self, i, iImage):
		hd = HDITEM()
		hd.mask = hd.HDI_IMAGE
		hd.iImage= iImage
		if self.SendMessage(self.Hwnd, self.Msg.HDM_SETITEM, i, byref(hd)):
			return hd.iImage
		raise RuntimeError("could not set irtem image")
开发者ID:Acidburn0zzz,项目名称:KomodoEdit,代码行数:7,代码来源:header.py

示例11: SetItemLparam

	def SetItemLparam(self, i, lp):
		hd = HDITEM()
		hd.mask = hd.HDI_LPARAM
		hd.lParam= lp
		if self.SendMessage(self.Hwnd, self.Msg.HDM_SETITEM, i, byref(hd)):
			return hd.lParam
		raise RuntimeError("could not set lParam")
开发者ID:Acidburn0zzz,项目名称:KomodoEdit,代码行数:7,代码来源:header.py

示例12: HitTest

	def HitTest(self):
		pt = POINT()
		if not user32.GetCursorPos(byref(pt)):
			raise WinError(GetLastError())
		hittest = self.DefWindowProc(self.Hwnd, self.Msg.WM_NCHITTEST, 0, MAKELONG(pt.x, pt.y))
		try: return HT_FLAGS[hittest]
		except: return 'unknown'
开发者ID:Acidburn0zzz,项目名称:KomodoEdit,代码行数:7,代码来源:methods.py

示例13: Write

	def Write(self):
		self.stream = IStreamImpl()
		result =comctl32.ImageList_Write(self.handle, byref(self.stream.IStream))
		del self.stream.IStream
		if not result: raise RuntimeError("could not write imagelist")
		#self.stream = None
		return self.stream.data
开发者ID:Acidburn0zzz,项目名称:KomodoEdit,代码行数:7,代码来源:imagelist.py

示例14: SetBandBackgroundImage

	def SetBandBackgroundImage(self, ID, Bitmap):
		bi=REBARBANDINFO()
		bi.fMask = RBBIM_BACKGROUND
		bi.hbmBack=Bitmap.handle
		if not self.SendMessage(self.Hwnd, self.Msg.RB_SETBANDINFO,
															self.IDToIndex(ID), byref(bi)):
			raise "could set band background image"
开发者ID:Acidburn0zzz,项目名称:KomodoEdit,代码行数:7,代码来源:rebar.py

示例15: SetItemWidth

	def SetItemWidth(self, i, n):
		hd = HDITEM()
		hd.mask = hd.HDI_WIDTH
		hd.cxy= n
		if self.SendMessage(self.Hwnd, self.Msg.HDM_SETITEM, i, byref(hd)):
			return hd.iImage
		raise RuntimeError("could not set item width")
开发者ID:Acidburn0zzz,项目名称:KomodoEdit,代码行数:7,代码来源:header.py


注:本文中的wnd.wintypes.byref函数示例由纯净天空整理自Github/MSDocs等开源代码及文档管理平台,相关代码片段筛选自各路编程大神贡献的开源项目,源码版权归原作者所有,传播和使用请参考对应项目的License;未经允许,请勿转载。