您的位置:首页 > 其它

pywin32记录备忘

2015-09-25 11:31 162 查看
项目地址:http://sourceforge.net/projects/pywin32/

文档地址:http://docs.activestate.com/activepython/2.7/pywin32/win32api.html

安装
下载系统对应的版本,全部next即可,无他。

常用功能

刚开始接触pywin32是为了批量复制覆盖文件夹,后在下载安装失败了,放弃使用pywin32。最近又看到,所以做了记录以备后用。

Module win32api

A module, encapsulating the Windows Win32 API.

Methods

AbortSystemShutdownAborts a system shutdown InitiateSystemShutdownInitiates a shutdown and optional restart of the specified computer. ApplyCalls a Python function, but traps Win32 exceptions. BeepGenerates a simple tone on the speaker. BeginUpdateResourceBegins an update cycle for a PE file. ChangeDisplaySettingsChanges video mode for default display ChangeDisplaySettingsExChanges video mode for specified display ClipCursorConfines the cursor to a rectangular area on the screen. CloseHandleCloses an open handle. CopyFileCopy a file. DebugBreakBreaks into the C debugger. DeleteFileDeletes the specified file. DragQueryFileRetrieve the file names for dropped files. DragFinishFree memory associated with dropped files. DuplicateHandleDuplicates a handle. EndUpdateResourceEnds a resource update cycle of a PE file. EnumDisplayDevicesObtain information about the display devices in a system EnumDisplayMonitorsLists monitors for a device context EnumDisplaySettingsLists available modes for specified device EnumDisplaySettingsExLists available modes for a display device, with optional flags EnumResourceLanguagesList languages for specified resource EnumResourceNamesEnumerates all the resources of the specified type from the nominated file. EnumResourceTypesReturn list of all resource types contained in module ExpandEnvironmentStringsExpands environment-variable strings and replaces them with their defined values. ExitWindowsLogs off the current user ExitWindowsExeither logs off the current user, shuts down the system, or shuts down and restarts the system. FindFilesFind files matching a file spec. FindFirstChangeNotificationCreates a change notification handle and sets up initial change notification filter conditions. FindNextChangeNotificationRequests that the operating system signal a change notification handle the next time it detects an appropriate change. FindCloseChangeNotificationCloses the change notification handle. FindExecutableFind an executable associated with a document. FormatMessageReturn an error message string. FormatMessageWReturn an error message string (as a Unicode object). FreeLibraryDecrements the reference count of the loaded dynamic-link library (DLL) module. GenerateConsoleCtrlEventSend a specified signal to a console process group that shares the console associated with the calling process. GetAsyncKeyStateRetrieves the asynch state of a virtual key code. GetCommandLineReturn the application's command line. GetComputerNameReturns the local computer name GetComputerNameExRetrieves a NetBIOS or DNS name associated with the local computer GetComputerObjectNameRetrieves the local computer's name in a specified format GetMonitorInfoRetrieves information for a monitor by handle GetUserNameReturns the current user name. GetUserNameExReturns the current user name in format specified by Name* constants GetCursorPosReturns the position of the cursor, in screen co-ordinates. GetCurrentThreadReturns a pseudohandle for the current thread. GetCurrentThreadIdReturns the thread ID for the current thread. GetCurrentProcessIdReturns the thread ID for the current thread. GetCurrentProcessReturns a pseudohandle for the current process. GetConsoleTitleReturn the application's console title. GetDateFormatFormats a date as a date string for a specified locale. GetDiskFreeSpaceRetrieves information about a disk. GetDiskFreeSpaceExRetrieves information about a disk. GetDllDirectoryRetrieves the DLL search path GetDomainNameReturns the current domain name GetEnvironmentVariableRetrieves the value of an environment variable. GetFileAttributesRetrieves the attributes for the named file. GetFileVersionInfoRetrieves string version info GetFocusRetrieves the handle of the keyboard focus window associated with the thread that called the method. GetFullPathNameReturns the full path of a (possibly relative) path GetHandleInformationRetrieves a handle's flags. GetKeyboardLayoutRetrieves the active input locale identifier GetKeyboardLayoutListReturns a sequence of all locale ids in the system GetKeyboardLayoutNameRetrieves the name of the active input locale identifier (formerly called the keyboard layout). GetKeyboardStateRetrieves the status of the 256 virtual keys on the keyboard. GetKeyStateRetrives the last known key state for a key. GetLastErrorRetrieves the last error code known by the system. GetLastInputInfoReturns time of last input event in tick count GetLocalTimeReturns the current local time. GetLongPathNameConverts the specified path to its long form. GetLongPathNameWConverts the specified path to its long form. GetLogicalDrivesReturns a bitmask representing the currently available disk drives. GetLogicalDriveStringsReturns a list of strings for all the drives. GetModuleFileNameRetrieves the filename of the specified module. GetModuleFileNameWRetrieves the unicode filename of the specified module. GetModuleHandleReturns the handle of an already loaded DLL. GetPwrCapabilitiesRetrieves system's power capabilities GetProfileSectionReturns a list of entries in an INI file. GetProcAddressReturns the address of the specified exported dynamic-link library (DLL) function. GetProfileValReturns a value from an INI file. GetShortPathNameReturns the 8.3 version of a pathname. GetStdHandleReturns a handle for the standard input, standard output, or standard error device GetSysColorReturns the system colors. GetSystemDefaultLangIDRetrieves the system default language identifier. GetSystemDefaultLCIDRetrieves the system default locale identifier. GetSystemDirectoryReturns the Windows system directory. GetSystemFileCacheSizeReturns the amount of memory reserved for file cache SetSystemFileCacheSizeSets the amount of memory reserved for file cache GetSystemInfoRetrieves information about the current system. GetNativeSystemInfoRetrieves information about the current system for a Wow64 process. GetSystemMetricsReturns the specified system metrics. GetSystemTimeReturns the current system time. GetTempFileNameCreates a temporary file. GetTempPathReturns the path designated as holding temporary files. GetThreadLocaleReturns the current thread's locale. GetTickCountReturns the milliseconds since windows started. GetTimeFormatFormats a time as a time string for a specified locale. GetTimeZoneInformationReturns the system time-zone information. GetVersionReturns Windows version information. GetVersionExReturns Windows version information as a tuple. GetVolumeInformationReturns information about a volume and file system attached to the system. GetWindowsDirectoryReturns the windows directory. GetWindowLongRetrieves a long value at the specified offset into the extra window memory of the given window. GetUserDefaultLangIDRetrieves the user default language identifier. GetUserDefaultLCIDRetrieves the user default locale identifier. GlobalMemoryStatusReturns systemwide memory usage GlobalMemoryStatusExReturns physical and virtual memory usage keybd_eventSimulate a keyboard event mouse_eventSimulate a mouse event LoadCursorLoads a cursor. LoadKeyboardLayoutLoads a new locale id LoadLibraryLoads the specified DLL, and returns the handle. LoadLibraryExLoads the specified DLL, and returns the handle. LoadResourceFinds and loads a resource from a PE file. LoadStringLoads a string from a resource file. MapVirtualKeyExTranslates (maps) a virtual-key code into a scan code or character value, or translates a scan code into a virtual-key code. MessageBeepPlays a predefined waveform sound. MessageBoxDisplay a message box. MonitorFromPointFinds monitor that contains a point MonitorFromRectFinds monitor that has largest intersection with a rectangle MonitorFromWindowFinds monitor that contains a window MoveFileMoves or renames a file. MoveFileExMoves or renames a file. OpenProcessRetrieves a handle to an existing process. OutputDebugStringWrites output to the Windows debugger. PostMessagePost a message to a window. PostQuitMessagePosts a quit message. PostThreadMessagePost a message to a thread. RegCloseKeyCloses a registry key. RegConnectRegistryEstablishes a connection to a predefined registry handle on another computer. RegCopyTreeCopies an entire registry key to another location RegCreateKeyCreates the specified key, or opens the key if it already exists. RegCreateKeyExExtended version of RegCreateKey RegDeleteKeyDeletes the specified key. RegDeleteKeyExDeletes a registry key from 32 or 64 bit registry view RegDeleteTreeRecursively deletes a key's subkeys and values RegDeleteValueRemoves a named value from the specified registry key. RegEnumKeyEnumerates subkeys of the specified open registry key. RegEnumKeyExEnumerates subkeys of the specified open registry key. RegEnumKeyExWUnicode version of RegEnumKeyEx RegEnumValueEnumerates values of the specified open registry key. RegFlushKeyWrites all the attributes of the specified key to the registry. RegGetKeySecurityRetrieves the security on the specified registry key. RegLoadKeyCreates a subkey under HKEY_USER or HKEY_LOCAL_MACHINE and stores registration information from a specified file into that subkey. RegOpenCurrentUserOpens HKEY_CURRENT_USER for impersonated user RegOpenKeyAlias for win32api::RegOpenKeyExRegOpenKeyExOpens the specified key. RegOpenKeyTransactedOpens a registry key as part of a transaction. RegOverridePredefKeyRedirects one of the predefined keys to different key. RegQueryValueRetrieves the value associated with the unnamed value for a specified key in the registry. RegQueryValueExRetrieves the type and data for a specified value name associated with an open registry key. RegQueryInfoKeyReturns information about the specified key. RegQueryInfoKeyWReturns information about an open registry key RegRestoreKeyRestores a key and subkeys from a saved registry file RegSaveKeySaves the specified key, and all its subkeys to the specified file. RegSaveKeyExExtended version of RegSaveKey RegSetKeySecuritySets the security on the specified registry key. RegSetValueAssociates a value with a specified key. Currently, only strings are supported. RegSetValueExStores data in the value field of an open registry key. RegUnLoadKeyUnloads the specified registry key and its subkeys from the registry. The keys must have been loaded previously by a call to RegLoadKey. RegisterWindowMessageGiven a string, return a system wide unique message ID. RegNotifyChangeKeyValueWatch for registry changes SearchPathSearches a path for a file. SendMessageSend a message to a window. SetConsoleCtrlHandlerAdds or removes an application-defined HandlerRoutine function from the list of handler functions for the calling process. SetConsoleTitleSets the title for the current console. SetCursorPosThe SetCursorPos function moves the cursor to the specified screen coordinates. SetDllDirectoryModifies the application-specific DLL search path SetErrorModeControls whether the system will handle the specified types of serious errors, or whether the process will handle them. SetFileAttributesSets the named file's attributes. SetLastErrorSets the last error code known for the current thread. SetSysColorsChanges color of various window elements SetLocalTimeChanges the system's local time. SetSystemTimeSets the system time. SetClassLongReplaces the specified 32-bit (long) value at the specified offset into the extra class memory for the window. SetClassWordReplaces the specified 32-bit (long) value at the specified offset into the extra class memory for the window. SetWindowWordSetCursorSet the cursor to the HCURSOR object. SetEnvironmentVariableCreates, deletes, or changes the value of an environment variable. SetHandleInformationSets a handles's flags SetStdHandleSets a handle for the standard input, standard output, or standard error device SetSystemPowerStatePowers machine down to a suspended state SetThreadLocaleSets the current thread's locale. SetTimeZoneInformationSets the system time-zone information. SetWindowLongPlaces a long value at the specified offset into the extra window memory of the given window. ShellExecuteExecutes an application. ShowCursorThe ShowCursor method displays or hides the cursor. SleepSuspends current application execution TerminateProcessTerminates a process. ToAsciiExTranslates the specified virtual-key code and keyboard state to the corresponding character or characters. UnicodeCreates a new PyUnicode object UpdateResourceUpdates a resource in a PE file. VkKeyScanTranslates a character to the corresponding virtual-key code and shift state. VkKeyScanTranslates a character to the corresponding virtual-key code and shift state. WinExecExecute a program. WinHelpInvokes the Windows Help engine. WriteProfileSectionWrites a complete section to an INI file or registry. WriteProfileValWrite a value to a Windows INI file. HIBYTEAn interface to the win32api HIBYTE macro. LOBYTEAn interface to the win32api LOBYTE macro. HIWORDAn interface to the win32api HIWORD macro. LOWORDAn interface to the win32api LOWORD macro. RGBAn interface to the win32api RGB macro. MAKELANGIDCreates a language identifier from a primary language identifier and a sublanguage identifier. MAKEWORDcreates a WORD value by concatenating the specified values. MAKELONGcreates a LONG value by concatenating the specified values.
内容来自用户分享和网络整理,不保证内容的准确性,如有侵权内容,可联系管理员处理 点击这里给我发消息
标签: