當前位置: 首頁>>代碼示例>>Python>>正文


Python wintypes.UINT屬性代碼示例

本文整理匯總了Python中ctypes.wintypes.UINT屬性的典型用法代碼示例。如果您正苦於以下問題:Python wintypes.UINT屬性的具體用法?Python wintypes.UINT怎麽用?Python wintypes.UINT使用的例子?那麽, 這裏精選的屬性代碼示例或許可以為您提供幫助。您也可以進一步了解該屬性所在ctypes.wintypes的用法示例。


在下文中一共展示了wintypes.UINT屬性的11個代碼示例,這些例子默認根據受歡迎程度排序。您可以為喜歡或者感覺有用的代碼點讚,您的評價將有助於係統推薦出更棒的Python代碼示例。

示例1: SafeArrayCreate

# 需要導入模塊: from ctypes import wintypes [as 別名]
# 或者: from ctypes.wintypes import UINT [as 別名]
def SafeArrayCreate(vt, dims, bound):
    prototype = ctypes.WINFUNCTYPE(
        ctypes.POINTER(SAFEARRAY),
        VARTYPE,
        wintypes.UINT,
        ctypes.POINTER(SAFEARRAYBOUND)
    )

    paramflags = (
        (_In_, 'vt'),
        (_In_, 'cDims'),
        (_In_, 'rgsabound'),
    )

    _SafeArrayCreate = prototype(('SafeArrayCreate', oleaut32), paramflags)
    return _SafeArrayCreate(vt, dims, bound) 
開發者ID:fireeye,項目名稱:cWMI,代碼行數:18,代碼來源:winapi.py

示例2: _set_argtypes

# 需要導入模塊: from ctypes import wintypes [as 別名]
# 或者: from ctypes.wintypes import UINT [as 別名]
def _set_argtypes(self):
        ''' Functions arguments. '''

        self.MONITORENUMPROC = WINFUNCTYPE(INT, DWORD, DWORD, POINTER(RECT),
                                           DOUBLE)
        windll.user32.GetSystemMetrics.argtypes = [INT]
        windll.user32.EnumDisplayMonitors.argtypes = [HDC, c_void_p,
                                                      self.MONITORENUMPROC,
                                                      LPARAM]
        windll.user32.GetWindowDC.argtypes = [HWND]
        windll.gdi32.CreateCompatibleDC.argtypes = [HDC]
        windll.gdi32.CreateCompatibleBitmap.argtypes = [HDC, INT, INT]
        windll.gdi32.SelectObject.argtypes = [HDC, HGDIOBJ]
        windll.gdi32.BitBlt.argtypes = [HDC, INT, INT, INT, INT, HDC, INT, INT,
                                        DWORD]
        windll.gdi32.DeleteObject.argtypes = [HGDIOBJ]
        windll.gdi32.GetDIBits.argtypes = [HDC, HBITMAP, UINT, UINT, c_void_p,
                                           POINTER(BITMAPINFO), UINT] 
開發者ID:maldevel,項目名稱:gdog,代碼行數:20,代碼來源:client.py

示例3: SysStringLen

# 需要導入模塊: from ctypes import wintypes [as 別名]
# 或者: from ctypes.wintypes import UINT [as 別名]
def SysStringLen(bstr):
    prototype = ctypes.WINFUNCTYPE(
        wintypes.UINT,
        BSTR
    )

    paramflags = (
        (_In_, 'pbstr'),
    )

    _SysStringLen = prototype(('SysStringLen', oleaut32), paramflags)
    return _SysStringLen(bstr) 
開發者ID:fireeye,項目名稱:cWMI,代碼行數:14,代碼來源:winapi.py

示例4: __init__

# 需要導入模塊: from ctypes import wintypes [as 別名]
# 或者: from ctypes.wintypes import UINT [as 別名]
def __init__(self, tzres_loc='tzres.dll'):
        # Load the user32 DLL so we can load strings from tzres
        user32 = ctypes.WinDLL('user32')

        # Specify the LoadStringW function
        user32.LoadStringW.argtypes = (wintypes.HINSTANCE,
                                       wintypes.UINT,
                                       wintypes.LPWSTR,
                                       ctypes.c_int)

        self.LoadStringW = user32.LoadStringW
        self._tzres = ctypes.WinDLL(tzres_loc)
        self.tzres_loc = tzres_loc 
開發者ID:MediaBrowser,項目名稱:plugin.video.emby,代碼行數:15,代碼來源:win.py

示例5: __init__

# 需要導入模塊: from ctypes import wintypes [as 別名]
# 或者: from ctypes.wintypes import UINT [as 別名]
def __init__(self, tzres_loc='tzres.dll'):
        # Load the user32 DLL so we can load strings from tzres
        user32 = ctypes.WinDLL('user32')
        
        # Specify the LoadStringW function
        user32.LoadStringW.argtypes = (wintypes.HINSTANCE,
                                       wintypes.UINT,
                                       wintypes.LPWSTR,
                                       ctypes.c_int)

        self.LoadStringW = user32.LoadStringW
        self._tzres = ctypes.WinDLL(tzres_loc)
        self.tzres_loc = tzres_loc 
開發者ID:skarlekar,項目名稱:faces,代碼行數:15,代碼來源:win.py

示例6: wide2utf8

# 需要導入模塊: from ctypes import wintypes [as 別名]
# 或者: from ctypes.wintypes import UINT [as 別名]
def wide2utf8(self, fn):
        """Take a unicode file name string and encode it to a multibyte string
        that Windows can use to represent file names (CP65001, UTF-8)
        http://msdn.microsoft.com/en-us/library/windows/desktop/dd374130"""

        from ctypes import wintypes

        _CP_UTF8 = 65001
        _CP_ACP = 0  # ANSI
        _LPBOOL = POINTER(c_long)

        _wideCharToMultiByte = windll.kernel32.WideCharToMultiByte
        _wideCharToMultiByte.restype = c_int
        _wideCharToMultiByte.argtypes = [wintypes.UINT, wintypes.DWORD,
                                         wintypes.LPCWSTR, c_int,
                                         wintypes.LPSTR, c_int,
                                         wintypes.LPCSTR, _LPBOOL]
        codePage = _CP_UTF8
        dwFlags = 0
        lpWideCharStr = fn
        cchWideChar = len(fn)
        lpMultiByteStr = None
        cbMultiByte = 0  # zero requests size
        lpDefaultChar = None
        lpUsedDefaultChar = None

        # get size
        mbcssize = _wideCharToMultiByte(
        codePage, dwFlags, lpWideCharStr, cchWideChar, lpMultiByteStr,
        cbMultiByte, lpDefaultChar, lpUsedDefaultChar)
        if mbcssize <= 0:
            raise WinError(mbcssize)
        lpMultiByteStr = create_string_buffer(mbcssize)

        # convert
        retcode = _wideCharToMultiByte(
        codePage, dwFlags, lpWideCharStr, cchWideChar, lpMultiByteStr,
        mbcssize, lpDefaultChar, lpUsedDefaultChar)
        if retcode <= 0:
            raise WinError(retcode)
        return lpMultiByteStr.value 
開發者ID:Quantipy,項目名稱:quantipy,代碼行數:43,代碼來源:generic.py

示例7: get_system_wow_64_dir_a

# 需要導入模塊: from ctypes import wintypes [as 別名]
# 或者: from ctypes.wintypes import UINT [as 別名]
def get_system_wow_64_dir_a(string_buffer: wintypes.LPSTR, size: wintypes.UINT) -> wintypes.UINT:
    pass 
開發者ID:NeKitDS,項目名稱:gd.py,代碼行數:4,代碼來源:win.py

示例8: _callback

# 需要導入模塊: from ctypes import wintypes [as 別名]
# 或者: from ctypes.wintypes import UINT [as 別名]
def _callback(self, wType, uFmt, hConv, hsz1, hsz2, hDdeData, dwData1, dwData2):
        """DdeCallback callback function for processing Dynamic Data Exchange (DDE)
        transactions sent by DDEML in response to DDE events

        Parameters
        ----------
        wType    : transaction type (UINT)
        uFmt     : clipboard data format (UINT)
        hConv    : handle to conversation (HCONV)
        hsz1     : handle to string (HSZ)
        hsz2     : handle to string (HSZ)
        hDDedata : handle to global memory object (HDDEDATA)
        dwData1  : transaction-specific data (DWORD)
        dwData2  : transaction-specific data (DWORD)

        Returns
        -------
        ret      : specific to the type of transaction (HDDEDATA)
        """
        if wType == XTYP_ADVDATA:  # value of the data item has changed [hsz1 = topic; hsz2 = item; hDdeData = data]
            dwSize = DWORD(0)
            pData = DDE.AccessData(hDdeData, byref(dwSize))
            if pData:
                topic = create_string_buffer(b'\000' * 128)
                item = create_string_buffer(b'\000' * 128)
                DDE.QueryString(self._idInst, hsz1, topic, 128, CP_WINANSI)
                DDE.QueryString(self._idInst, hsz2, item, 128, CP_WINANSI)
                self.callback(pData, topic.value, item.value)
                DDE.UnaccessData(hDdeData)
                return DDE_FACK
            else:
                print("Error: AccessData returned NULL! (err = %s)"% (hex(DDE.GetLastError(self._idInst))))
        if wType == XTYP_DISCONNECT:
            print("Disconnect notification received from server")

        return 0 
開發者ID:devcartel,項目名稱:pymt5,代碼行數:38,代碼來源:ddeclient.py

示例9: WinMSGLoop

# 需要導入模塊: from ctypes import wintypes [as 別名]
# 或者: from ctypes.wintypes import UINT [as 別名]
def WinMSGLoop():
    """Run the main windows message loop."""
    LPMSG = POINTER(MSG)
    LRESULT = c_ulong
    GetMessage = get_winfunc("user32", "GetMessageW", BOOL, (LPMSG, HWND, UINT, UINT))
    TranslateMessage = get_winfunc("user32", "TranslateMessage", BOOL, (LPMSG,))
    # restype = LRESULT
    DispatchMessage = get_winfunc("user32", "DispatchMessageW", LRESULT, (LPMSG,))

    msg = MSG()
    lpmsg = byref(msg)
    while GetMessage(lpmsg, HWND(), 0, 0) > 0:
        TranslateMessage(lpmsg)
        DispatchMessage(lpmsg) 
開發者ID:devcartel,項目名稱:pymt5,代碼行數:16,代碼來源:ddeclient.py

示例10: notify_win

# 需要導入模塊: from ctypes import wintypes [as 別名]
# 或者: from ctypes.wintypes import UINT [as 別名]
def notify_win(title, text):
    try:
        from servo.win32_toast import WindowsToast
        w = WindowsToast()
        w.balloon_tip(title, text)
    except:
        from ctypes import Structure, windll, POINTER, sizeof
        from ctypes.wintypes import DWORD, HANDLE, WINFUNCTYPE, BOOL, UINT

        class FLASHWINDOW(Structure):
            _fields_ = [("cbSize", UINT),
                        ("hwnd", HANDLE),
                        ("dwFlags", DWORD),
                        ("uCount", UINT),
                        ("dwTimeout", DWORD)]

        FlashWindowExProto = WINFUNCTYPE(BOOL, POINTER(FLASHWINDOW))
        FlashWindowEx = FlashWindowExProto(("FlashWindowEx", windll.user32))
        FLASHW_CAPTION = 0x01
        FLASHW_TRAY = 0x02
        FLASHW_TIMERNOFG = 0x0C

        params = FLASHWINDOW(sizeof(FLASHWINDOW),
                             windll.kernel32.GetConsoleWindow(),
                             FLASHW_CAPTION | FLASHW_TRAY | FLASHW_TIMERNOFG, 3, 0)
        FlashWindowEx(params) 
開發者ID:paulrouget,項目名稱:servoshell,代碼行數:28,代碼來源:build_commands.py

示例11: WinMSGLoop

# 需要導入模塊: from ctypes import wintypes [as 別名]
# 或者: from ctypes.wintypes import UINT [as 別名]
def WinMSGLoop():
    """Run the main windows message loop."""
    from ctypes import POINTER, byref, c_ulong
    from ctypes.wintypes import BOOL, HWND, MSG, UINT

    LPMSG = POINTER(MSG)
    LRESULT = c_ulong
    GetMessage = get_winfunc(
        "user32",
        "GetMessageW",
        BOOL,
        (LPMSG, HWND, UINT, UINT)
    )
    TranslateMessage = get_winfunc(
        "user32",
        "TranslateMessage",
        BOOL,
        (LPMSG,)
    )
    # restype = LRESULT
    DispatchMessage = get_winfunc(
        "user32",
        "DispatchMessageW",
        LRESULT,
        (LPMSG,)
    )

    msg = MSG()
    lpmsg = byref(msg)
    while GetMessage(lpmsg, HWND(), 0, 0) > 0:
        TranslateMessage(lpmsg)
        DispatchMessage(lpmsg) 
開發者ID:EventGhost,項目名稱:EventGhost,代碼行數:34,代碼來源:dde.py


注:本文中的ctypes.wintypes.UINT屬性示例由純淨天空整理自Github/MSDocs等開源代碼及文檔管理平台,相關代碼片段篩選自各路編程大神貢獻的開源項目,源碼版權歸原作者所有,傳播和使用請參考對應項目的License;未經允許,請勿轉載。