Class wwAPI

The API class provides a number of useful utility functions that access the Windows API or other external DLL interfaces. This class also houses the wwImaging wrapper functions that talk to the wwImaging.dll.

Note that some of the functionality in this class is implemented as plain functions, rather than methods of the class. This is to avoid having to declare a class. None of the wwAPI classes actually contain any sort of state and would be better served as plain functions, but due to legacy codebase requirements they are part of the class.

Tip:
In Web Connection Process methods, wwAPI is always available via Server.oAPI.

Class Members

MemberDescription
ActivateWindow Activates the Window specified by Window Title or Window Handle.
o.ActivateWindow(lvTitle,lnParentHandle)
aProfileSections Retrieves all sections of an INI File.
o.aProfileSections(@laSections, lcIniFile)
CharToBin Converts a binary 4 byte (Double Word) expression into VFP number.
CharToBin(lcBinString,llSigned)
CopyFile Copies File. Faster than Fox Copy and handles errors internally without throwing a Fox error.
o.CopyFile(lcSource, lcTarget,nFlag)
CopyImage Allows copying an image from one file format to another. Simply specify the name of the input file and a name of the output file. Based on the extension the new image format is created. Supported formats include gif,jpg,png,tif,bmp.
CopyImage(lcSource,lcTarget)
CreateGUID Creates either a string or binary GUID value.\
o.CreateGUID(llRaw)
CreateProcess Runs an external process using the CreateProcess API. CreateProcess has a number of advantages over using the RUN command including a much longer command line limit and the ability to understand long filenames correctly.
CreateProcess(lcExe,lcCommandLine,lnShowWindow,llWaitForCompletion)
CreateProcessEx Runs an external process using the CreateProcess API including the ability to redirect output to a file and Wait for completion.
CreateProcessEx(lcExe,lcCommandLine,lcStartDirectory,; lnShowWindow,llWaitForCompletion,lcStdOutputFilename)
CreateThumbnail Creates a thumbnail image from a normal sized image by specify source and thumbnail filenames and Width and Height values.
CreateThumbnail(lcSourceFile,lcThumbnailFile,lnWidth,lnHeight)
EnumKey Returns a registry value from a key name based on a numeric index.
o.EnumKey(tnHKey, tcSubKey, tnIndex)
GetCaptchaImage Creates a CAPTCHA image with the specified text. CAPTCHA images are meant to use for validation of users on a Web site to protect from spamming.
GetCaptchaImage(lcText,lcOutputFile,lcFont,lnFontSize)
GetClipboardText Gets special text like RTF or HTML from the clipboard rather than retrieving only text.
GetClipboardText(lcFormat)
GetComputerName Returns the name of the computer as a string.
o.GetComputerName()
GetImageInfo This function retrieves the height and width and resolution of an image.
GetImageInfo(lcImageFile,@lnWidth,@lnHeight,@lnResolution)
GetLastError Returns the last Windows API error code. Should be called immediately after an API function if an error occurred to retrieve the error code.
o.GetLastError()
GetProfileString Read Profile String information from a given text file using Windows INI formatting conventions
o.GetProfileString(pcFileName,pcSection,pcEntry, pnBufferSize)
GetSpecialFolder Returns a Windows Special Folder value by either a numeric value or as a special string value.
GetSpecialFolder(lnFolder)
GetSystemDir Returns the Windows System directory.
o.GetSystemDir(llWindowsDir)
GetSystemErrorMsg Returns the Message text for a Win32API error code.
o.GetSystemErrorMsg(lnErrorNo,lcDLL)
GetTempPath Returns the Windows OS temp file path.
o.GetTempPath()
GetTimeZone Returns the Timezone offset from GMT in minutes.
GetTimeZone()
GetUserName Returns the currently logged on user.
o.GetUserName()
GZipCompressString Compresses a string using the GZip protocol.
GZipCompressString(lcString,lnCompressionLevel)
GZipUncompressString Uncompresses a GZip encoded string into its original unencoded data.
GZipUncompressString(lcCompressed)
HashMD5 Creates an MD5 Hash from your data. MD5 is a one encryption hash that is frequently used for password authentication and storage of strings.
HashMD5(tcData)
InstallPrinterDriver The function allows installing of a printer driver from the Windows default printer list.
InstallPrinterDriver(lcDriverName, lcPrinterName)
LogonUser Allows checking whether a username and password are valid with Windows security.
o.LogonUser(lcUsername, lcPassword, lcServer)
MessageBeep Sounds the specified System sound.
o.MessageBeep(lnSound)
PlayWave Plays a WAV file synchronously or asynchronously.
o.PlayWave(pcWaveFile,pnPlayType)
ReadImage Reads the contents of an area from within an image into a new file. It allows for creating cropped images. Image formats can be read and saved in gif,jpg,png,bmp,tif depending on these extensions.
ReadImage(lcSource,lcTarget,lnLeft,lnTop,lnWidth,lnHeight)
ReadRegistryString Reads a string or integer value from the registry.
o.ReadRegistryString(tnHKey, tcSubkey, tcEntry, tlInteger)
ResizeImage Allows resizing of an image to a specified size.
ResizeImage(lcSource, lcTarget, lnWidth, lnHeight, lnCompression)
RotateImage Rotates an image in a file in place updating the original file.
RotateImage(lcImage,lnRotateType)
Sleep Puts the computer into idle state by putting the current thread to sleep.
o.Sleep(lnMilliSecs)
WriteImage This function writes an image into an existing image by overlaying it. This allows either merging of two images or if the new image has a tranparent background of overlaying.
WriteImage(lcSource,lcInsert,lnLeft,lnTop)
WriteProfileString Writes a value into an INI file.
o.WriteProfileString(pcFileName,pcSection,pcEntry,pcValue)
WriteRegistryString Writes a string value to the registry.
o.WriteRegistryString(tnHKey, tcSubkey, tcEntry, tcValue,tlCreate)

Requirements

Assembly: wwApi.prg


  Last Updated: 12/24/2008 | © West Wind Technologies, 2008