Pour ceux qui ne connaissent pas encore, c'est un fourre tout, dont voici la liste des fonctions disponibles (les sources sont dispos dans l'archive) :
StringToOem(StringAddress) ; Translates a string into the OEM-defined character set.
OemToString(StringAddress) ; Translates a string from the OEM-defined character set into either an ANSI or a wide-character string
Hex2Dec(hex.s) ; Converts a Hex value ( as String ) to a Decimal value ( as Long )
Bin2Dec(BinaryStringNumber.s) ; Converts a Binary value ( as String ) to a Decimal value ( as Long )
ForegroundWindowGet() ; Returns The handle of The foreground window
ForegroundWindowSet(WindowsHandle) ; Sets the Foreground Window
NNot(Bool) ; Same as Not
Ansi2Unicode(string.s) ; Converts normal (Ansi) string To Unicode (L)
Unicode2Ansi(Pointer) ; Converts Unicode to normal (Ansi) string (M)
DroopyVersion() ; Return the library version
MakeSureDirectoryPathExists(Directory.s) ; Creates all directories in the specified path
GetSpecialFolderLocation(fid.l) ; Get Name / Folder of Windows Special Folders
GetFilePartWE(File.s) ; Return only file part without extension
GetProgramResultExitCode() ; Return the error code of the program lauched by GetProgramResult
GetProgramResult(File.s,Parameters.s) ; Retrieve the result of a command line
CiscoFormat(MacAddress.s) ; Return mac address as 'Cisco' format
GetMacAddress(Subnet.s) ; Return mac address of a specific subnet
WMI(WMICommand.s) ; Interrogate WMI Database
String2Hex(string.s) ; Convert string to hex
Hex2String(string.s) ; Convert hex to string
DocumentAndSettings() ; Return Document and Settings Folder
MonitorPower(State.b) ; Turn off / On / Standyby the monitor
Beep(Frequency,Duration) ; Generates simple tones on the speaker
MessageBeep(Sound) ; Play a windows sound
BlockInput(State.l) ; Inhibit keyboard & Mouse
GuidAPI() ; Return a GUID
ComputerSerialNumber() ; Retrieve the Computer Serial Number
NTCore() ; Returns 1 if OS has an NT Core ( NT/2K/XP/... ) / 0 if W95/98/ME
ReturnKeyToButtonClick(Window) ; Simulate a left click when you press ENTER over an activated Button
PureBasicPath() ; Return PureBasic Path
PureBasicVersion() ; Return Purebasic version
ScreenSaver() ; Runs the Screen-Saver immediately
GetLastError() ; Return the last Win32 API error as a string
GetLastErrorAsText(LastError.l) ; Used to get Last Win32 API Error
SelfEncryption(text.s,en.l) ; Encrypt a String (text) if en=#True / Decrypt if en=#False
RC4Api(string.s, Password.s) ; Encode / Decode a String with a key using Windows API ( RC4 algorithm )
LogInit(LogFile.s,DateFormat.s="%dd/%mm/%yy %hh:%ii:%ss " ; Creates a LogFile
LogWrite(text.s) ; Appends Date & Time + Text to the log file
LogInitAuto() ; Init log file to ProgramFiles\Disc\ExeName.log
MeasureIntervalStart() ; Defines the point where you want to start measuring your code
MeasureIntervalStop() ; Defines the point where you want to stop measuring your code
MeasureHiResIntervalStart() ; Defines the point where you want to start measuring your code
MeasureHiResIntervalStop() ; Defines the point where you want to stop measuring your code
SaveResourceAs(Name.s,File.s) ; Save the resource as a file ( Name is the first field of the RC file )
GetResourcePointer(Name.s) ; Returns a pointer of a resource ( Name is the first field of the RC file )
GetResourceSize(Name.s) ; Returns the size of a resource ( Name is the first field of the RC file )
RegSetValue(Key.s, ValueName.s, Value.s, Type, ComputerName.s) ; Sets a Value
RegGetValue(Key.s, ValueName.s, ComputerName.s) ; Gets a Value
RegGetType(Key.s, ValueName.s, ComputerName.s) ; Returns Key Type
RegListSubKey(Key.s, index, ComputerName.s) ; Lists all SubKeys
RegDeleteValue(Key.s, ValueName.s, ComputerName.s) ; Deletes a Value
RegCreateKey(Key.s, ComputerName.s) ; Creates a Key
RegDeleteKey(Key.s, ComputerName.s) ; Deletes a Key
RegListSubValue(Key.s, index, ComputerName.s) ; Lists all SubValues
RegKeyExists(Key.s, ComputerName.s) ; Tests if a Key exists
RegDeleteKeyWithAllSub(Key.s,ComputerName.s); Deletes a Key and all its SubKeys / Values
RegCreateKeyValue(Key.s,ValueName.s,Value.s,Type,ComputerName.s) ; Creates a Key and a Value in a Single Command
RegValueExists(Key.s, ValueName.s, ComputerName.s) ; Tests if a Value Name exists
UserLoggedOn() ; Return Logged on user (XP only)
UserGuid(Username.s) ; Return the GUID of the user
UserShellFolder(GUID.s,ShellFolder.s) ; Return shell folder of a user (XP only)
Bargraph(x,y,width,height,Direction,medium.f,hight.f,full.f,color1,color2,color3,BackgroundColor) ; Creates a bar graph gadget .
BargraphSet(Id,Value.f) ; Sets the value of the bar graph
BargraphGet(Id) ; Get the value of the bar graph
BargraphEvent(Id) ; Returns 1 if you click on a bar graph gadget
Graph(x,y,width,height,Segment,medium.f,hight.f,full.f,color1,color2,color3,LineColor) ; Creates a Graph gadget .
GraphSet(Id,Value.f) ; Sets the value of the Graph
GraphGet(Id) ; Get the value of the Graph
GraphEvent(Id) ; Returns 1 if you click on a Graph gadget
SignedBinaryToUnsigned(byte.b) ; Purebasic shows a Byte as signed, this function shows a Byte as unsigned
SignedWordToUnsigned(Word.w) ; Purebasic show Word as signed, this function show a Word as unsigned
Odd(Number.l) ; Returns 1 if the number is odd ( pair in french )
Even(Number.l) ; Returns 1 if the number is even ( impair in french )
FlagSet(Flag.s,Value.s) ; Set a Flag value
FlagGet(Flag.s) ; Get a Flag Value
FlagDelete(Flag.s) ; Deletes a Flag
FlagCreate(Flag.s) ; Creates a Flag ( value = OK )
FlagInit(Key.s) ; Initialize the Library
FlagExist(Flag.s) ; Returns 1 if Flag exists / 0 instead
FlagDontExist(Flag.s) ; Returns 1 if Flag doesn't exist / 0 Instead
FlagRAZ() ; Delete All Flags and the Key Specified in FlagInit
GetPowerStatus() ; Return 0 Offline / 1 Online / 255 unknown
GetBatteryChargeStatus() ; Return 1 High / 2 Low / 4 Critical / 8 Charging / 128 No system battery / 255 Unknown
GetBatteryLifePercent() ; Return Percentage of full battery charge remaining
GetBatteryLifeTime() ; Return Number of seconds of battery life remaining : -1 Unknown
GetBatteryFullLifeTime() ; Number of seconds of battery life when at full charge : -1 Unknown
Logoff() ; Forced Logoff
Reboot() ; Forced Reboot
ShutDownAndPowerOff() ; Forced ShutDown and Power Off
LockWorkStation() ; Lock the Workstation
RunProgramAtStartup(WichUser.l,RunOrRunOnce.l,Name.s,CommandLine.s) ; Add an entry to the Run or RunOnce Key
DelProgramAtStartup(WichUser.l,RunOrRunOnce.l,Name.s) ; Delete an Entry in the Run or RunOnce Key
IsProgramRunAtStartup(WichUser.l,RunOrRunOnce.l,Name.s) ; Tests if an entry is present and valid .
EnumProcessInit() ; Initialize the function for enumerating processes
EnumProcess() ; Each time this function is called a process is returned as a string, until an empty string ( All process is listed )
GetPidProcess(Name.s) ; Returns Pid of Process if it exists / 0 if it doesn't exist
KillProcess(Pid) ; Kill a process by specifying it's Pid
Runas(Username.s,Domain.s,Password.s,CommandLine.s,Argument.s) ; Runas function with Parameters / Password
SuperRunas(Username.s,Password.s,CommandLine.s,Parametre.s) ; Runas function with Parameters / Password
SearchProcess(Name.s) ; Search if a Process is Running ( Scans processes without Window(s) as well )
RunOnlyOneInstance() ; End the Program if another instance is found !!
HandleToFileName(hWnd.l) ; Returns the file Path and Name of the exe that owns the specified Window Handle
PidToFileName(Pid.l) ; Returns the file Path and Name to the exe that has specified Process Pid
WaitProgramInitialisation(Handle) ; Waits until the specified Process is waiting for user input with no input pending, or until the time-out interval has elapsed
AddRecentDocuments(File.s) ; Adds a file to the recent documents
ClearRecentDocuments() ; Clears the recent documents folder
PathGet() ; Returns the Path
PathSet(Path.s) ; Set the Path
PathAdd(StringToAdd.s) ; Add this string to the Path ( the ; is added automatically )
PathRefresh() ; Force Windows to refresh the Path value for new processes
GetSystemDirectory() ; This Function retrieves the path of the system directory
GetWindowsDirectory() ; This Function retrieves the path of the Windows directory
SetComputerName(NetbiosName.s) ; Sets the NetbiosName for the local computer
SetComputerNameEx(Name.s) ; Sets the NetbiosName & HostName for the local computer
OSVersionText() ; Returns OsVersion in Text Format
GetComputerName() ; Retrieves the NetBIOS name of the local computer
BootState() ; Return the system Boot state
CheckInternetConnection() ; Retrieves the connected state of the local system
CommandLineShell() ; Returns the Command Line Shell ( Cmd.exe or Command.com & it's path )
ShowTaskBar(State) ; Show (#True) or Hide (#False) the taskbar
XPFirewall(State.l) ; Enable if #True or Disable if #False the Windows FireWall
WNetAddConnection(ShareName.s,Password.s,DriveLetter.s) ; Map a Network Drive using a Password
WNetAddConnectionNT(Username.s,Password.s,ShareName.s,DriveLetter.s,Persistant.l) ; Map Network Drive with a UserName / Password
WNetCancelConnection(DriveLetter.s,force.l) ; Disconnect Network Map Drive
IsNetDrive(Drive.s) ; Tests if a Drive is a Network Drive
NovellClientVersion() ; Return the Novell Client Version ( + Revision ) like 491SP5
GlobalMemoryStatusMemoryLoad() ; Specifies a number between 0 And 100 that gives a general idea of current Memory utilization, in which 0 indicates no memory use And 100 indicates full Memory use.
GlobalMemoryStatusTotalPhys() ; Indicates the total number of Mbytes of physical Memory.
GlobalMemoryStatusAvailPhys() ; Indicates the number of Mbytes of physical Memory available.
GlobalMemoryStatusTotalPageFile() ; Indicates the total number of Mbytes that can be stored in the paging file. Note that this number does not represent the actual physical size of the paging file on disk.
GlobalMemoryStatusAvailPageFile() ; Indicates the number of Mbytes available in the paging file.
GlobalMemoryStatusTotalVirtual() ; Indicates the total number of Mbytes that can be described in the user mode portion of the virtual address space of the calling process.
GlobalMemoryStatusAvailVirtual() ; Indicates the number of Mbytes of unreserved And uncommitted Memory in the user mode portion of the virtual address space of the calling process.
ImpersonateUser(Username.s,Domain.s,Password.s) ; Impersonate the process as the specified user
ImpersonateUserDisable() ; Stop the Impersonation
IniWrite(INIFile.s,Section.s,Key.s,string.s) ; Writes a key to an Ini File
IniRead(INIFile.s,Section.s,Key.s) ; Returns the contents of a key from an Ini File
GetUserName() ; Returns the Name of the User logged onto the Workstation
IsUserAnAdmin() ; Returns 1 if current user is administrator / 0 instead
NetLocalGroupEnum() ; Retrieves LocalGroup names
NetLocalGroupAdd(GroupName.s) ; Adds(creates) the local group named "GroupName"
NetLocalGroupDel(GroupName.s) ; Deletes the local group named "GroupName"
NetLocalGroupAddMembers(GroupName.s,AccountName.s) ; Adds a member to the local group named "GroupName"
NetLocalGroupDelMembers(GroupName.s,AccountName.s) ; Deletes a member to the local group named "GroupName"
NetLocalGroupGetMembers(groupe.s) ; Retrieves the Members of a LocalGroup
NetUserAdd(Username.s,Password.s) ; Creates a local User
NetUserChangePassword(Username.s,Domain.s,OldPassword.s,NewPassword.s) ; Change the user's password
NetUserEnum() ; Retrieves all UserNames
UserExist(Username.s,Password.s) ; Returns 1 if User & Password correct (User exist)
NetUserDel(Name.s) ; Deletes a local User
SearchFilesInit(Path.s,Mask.s,Recurse.l) ; Searches Path for files that match the Mask
SearchFilesGet() ; Each time you call SearchFilesGet() it returns a FileName.
DeleteFileToRecycleBin(File.s) ; Deletes the file to the Recycle Bin without confirmation / ProgressBar
EmptyRecycleBin() ; Deletes all files in the RecycleBin on all drives without Sound / Progress Bar / Confirmation
FileGetTime(File.s,Which); Get the time of a File
FileSetTime(File.s,Date,Which); Set the time of a File
CheckForMedium(Drive.s) ; Checks if medium is a drive, without getting the requester "Please insert...."
GetDriveVolumeName(Drive.s) ; Returns the Volume name of the drive / Empty String if drive isn't available
GetDriveFileSystem(Drive.s) ; Returns the FileSystem of the drive : FAT / FAT32 / NTFS
GetDiskFreeSpaceEx(Drive.s) ; Returns available free Disk space ( in Mb ) or 0 if Drive is not available or full
RealDriveType(Drive.s) ; Returns the Real Drive Type
AssociateFileEx(ext$,ext_description$,programm$,Icon$,prgkey$,cmd_description$,cmd_key$) ; AssociateFileEx(Extension,Extension Description,FullProgramPath&Name,Icon,just programname,command Description,command)
AssociateFile(ext$,ext_description$,programm$,Icon$) ; AssociateFile(Extension,Extension Description,FullProgramPath&Name,Icon)
RemoveAssociateFile(ext$,prgkey$) ; Remove association
CreateShortcut(Path.s,Link.s,Argument.s,Description.s,WorkingDir.s,ShowCommand.l,HotKey.l,IconFile.s="|",IconIndex.l=0) ; Create shell links/shortcuts
CreateSizedFile(File.s,Block) ; Create a file with size you want
GetFileType(File.s) ; Returns as a string the type of the file
GetFileVersion(FileName.s,Which,FieldName) ; Gets exe/dll file information as a string
RenameDrive(drive$,name$) ; Renames the Drive to Name$
CountRemovableDrive() ; Returns the number of Removable Media drives with media present
FormatDisk(Drive.s,quick) ; Only invokes the format prompt (doesn't format automatically).
Timer(TimerId,Delay,ProcedureAdress) ; Create a Timer which calls a Procedure
TimerKill(TimerId) ; Kill the Timer specified by Timerid
GetUserLanguage() ; Retrieves the Language of the user
GetUserSubLanguage() ; Retrieves the Sub-Language of the user
GetLanguage(wich) ; Returns the default primary language identifier ( 0 system / 1 User )
EnableWindow(Handle,State) ; Set if the window is enabled For mouse And keyboard input
IsWindowEnabled(Handle) ; Determines whether The specified window is enabled For mouse And keyboard input
IconExtract(File.s,Icon.l) ; File specifies the File to extract the icon from
IconExtractEx(File.s,Size.l,Selected.l) ; Returns ImageId of an Icon embedded in a file (Exe Or Dll )
SetWindowIcon(Handle,IconHandle)
GetExtensionIcon(Extension.s, Size.l) ; Returns the imageid of the icon associated by the extension
ShellAboutWindow(ParentWindow.l,Title.s,FirstText.s,DialogText.s,Icon.l) ; Shows a Microsoft 'About Windows' window
GetHandle(WindowsName.s) ; Returns the Handle of the Windows specified by name
SetWindowsTransparency(Handle.l, Transparency_Level.l) ; Sets Window Transparency between 1 ( invisible ) and 255 ( visible )
WindowsEnum() ; List all open Windows by Title
CloseWindows(WindowsName.s) ; Close Windows specified by WindowsName
ShowDesktop() ; Hide all Windows, and Show the Desktop
InputPasswordRequester(Title.s) ; Same as InputRequester but for Passwords
GetPixelColor(x,y) ; Returns the RGB color of the pixel at the specified coordinates or #CLR_INVALID (-1) if coordinate is outside of the screen
WindowFx(Id,ms,fx) ; Cool window FX for your apps (fade in/out, slide,wipe) / For creating LaunchBar
ChangeDisplaySettings(width,height,Depth,Freq,Permanent) ; Changes the display resolution / Depth / frequency
EnumDisplay(display.s) ; Determines all the screen modes.
GetDesktopHandle() ; Returns the Desktop Window Handle, Useful for creating Systray Icon without opening a window or creating an invisible window
WindowsExit(WindowID,State) ; Enable the user to close the window if #True
WindowsMove(WindowID,State) ; You can move window if #True / with #False you can't
ShowWindow(Handle,State) ; Sets the specified window's show state
FlashWindow(hWnd,Delay,Time) ; Flash the Window specified by hwnd
GetWindowTitleEx(hWnd) ; Uses getwindowtext_() to get the title of the specified hwnd
ToolTipAdd(Type,MaxWidth,WindowID,Gadget,Text$,Title$,Icon,TextColor,BKColor,Font.s,FontSize) ; Type : 0 = Balloon Tip / 1 Square Tip
ToolTipRemove(Gadget.l,WindowID=0) ;Remove a ToolTip
ToolTipChange(Gadget.l, Text$,WindowID=0) ; Change the text of the ToolTip
ToolTipShow(Gadget.l,x,y,WindowID=0) ; Force Showing a ToolTip
ToolTipHide(Gadget.l,WindowID=0) ; Hide a ToolTip previously Show with ToolTipShow
Between(string.s, LString.s, RString.s) ; Returns the string between the two strings
GetMouseX() ; Get the X coordinate of the mouse pointer
GetMouseY() ; Get the Y coordinate of the mouse pointer
SetMouseXY(x,y) ; Set the Location of the mouse pointer
SetMouseClick(MouseEvent) ; Simulate a mouse click @ Mouse pointer location
SetMouseWheel(Direction) ; Simulate the Mouse Wheel
PushMousePosition() ; Store the Location of the mouse cursor
PopMousePosition() ; Place the Location of the mouse cursor @ the location stored by PushMousePosition
SetMouseCursor(Type,WindowID=0) ; Set(change) the Mouse cursor with these constants :
SimulateKeyPress(vk, Delay, control, alt, shift) ; This function simulates a keypress with optional control, alt, and shift
LocaleDate(Mask.s,Date.l,lang.l,sublang.l=0) ; Return Date as String
Week(Date.l) ; Return the week number of the year
CaptureScreenPart(Left.l,Top.l,width.l,height.l) ; CaptureScreenPart : Returns pointer to BMP SnapShot
CaptureFullScreen() ; ; CaptureFullScreen : Returns pointer to BMP SnapShot
CaptureWindow(Handle.l) ; CaptureWindow : Returns pointer to BMP SnapShot
SaveCapture(File.s, ImagePlugin , JpegCompression) ; Saves previous capture to file
UnMountVolume(Drive.s) ; Unmount a VolumeName
MountVol(Drive.s,MountPoint.s) ; Mount a drive letter with specified MountPoint ( \\?\{xxxx )
MountListInit() ; This function gets VolumeNames ( from memory )
MountList() ; Each time this function is called, a VolumeName ( \\?\{xxxx ) is returned, when there are no more volumes to return, it returns an empty string
GetMountVolName(MountPoint.s) ; Returns a Drive Letter when specifiyng a MountPoint ( \\?\{xxxx )
DDebug(text.s) ; Adds Text to the Debugger buffer
DDebugShow() ; Shows the Debugger Text
DDebugClear() ; Clears the Debugger Text
DDebugGet() ; Returns the Debugger Text
DDebugLine() ; Adds a line to the Debugger Buffer
LocalTextInit(LocalLanguageIdentifier) ; Initialise the LocalText function with a Primary language identifier
LocalText(Local.s,International.s) ; Returns the correct text for the user's language
PrinterDelete(PrinterName.s) ; Deletes the printer
PrinterClearJobQueue(PrinterName.s) ; Clears the job queue of the printer
PrinterEnum() ; Each time this function is called, it returns a name of a printer( "" = you are @ the end of the list )
PrinterEnumGetPort() ; Retrieves the port of the printer currently listed with PrinterEnum()
HotKeysInit() ; Hotkeysinit() - initializes the hotkeys lib
HotKeyAdd(Window,vk,function,Name.s,shiftstate,altstate,controlstate); hotkeycheck() - checks to see if a hotkey event has been fired, if so, runs the function attached to the hotkey
HotkeyCheck(message, wparam) ; checks if a hotkey message is waiting, and if it is, runs the function attached to the hotkey
HotkeyWaitWindowEvent() ; hotkeywaitwindowevent() - uses the waitwindowevent() function to check if a hotkeymsg is there - if it is, runs the associated function
HotkeyWindowEvent() ; hotkeywindowevent() - uses the windowevent() function to check if a hotkey message is there - if it is, it runs the associated function
HotKeyRemove(Name.s) ; hotkeyremove() - this function removes the hotkey specified by name
HotKeyChangeFunction(Name.s, newfunc) ; Changes the function associated with the hotkey to the one specified by newfunc
Ou
Télécharger la DroopyLib sur le FTP de DVP
Il s'agit d'un exécutable, qui permet soit d'installer directement la bibliothèque dans votre répertoire PureBasic (le chemin est demandé). Soit d'extraire l'archive.
L'archive contient la bibliothèque, un fichier résident, un fichier d'aide complet en anglais dans le format chm. Et les codes source !