Api Function Snippets


We can use the Windows API function GetDriveType() to test if the drive is a CD-ROM drive then use the Windows API function GetVolumeInformation() to test if the VolumeName is 'Audio CD'.

We can use the Windows API function GetDriveType() to test if the drive is a CD-ROM drive then use the Windows API function GetVolumeInformation() to test if the VolumeName is 'Audio CD'.

You can use a url shortener with Twitter such as tinyurl.com

'The following code snippet displays the "Shut Down Windows" dialog. 'Is uses undocumented API function in shell32.dll

16 January, 2013   

Example for adding items into combo by using Win32 API. Written by Nir Sofer

A short and simple code snippet using voice output with Delphi

This is the whole HTML page with JS/CSS embeded, uses Google Maps API V3

22 October, 2012   

The following code snippet shows you how to create an alternative DoEvents function by using Win32 API calls. Be aware that accelerator keys won't work properly with this alternative function.

The pyperl dist provide an interface to the Perl DBI (dbi.py). This allow direct access to all the perl supported databases from python. Full documentation of the API from 'perldoc DBI' or the ORA "Programming the Perl DBI" book, by A. Descartes and T. Bunce.

28 March, 2011   

When you are writing dynamic link libraries and need to control the loading and unloading of a DLL, or if you want to initialize your DLL when it is loaded, you can have a function called DllMain do your initialization. Windows calls the DllMain function of a DLL in four instances: 1) When a process attaches the DLL 2) When a thread attaches...

24 August, 2011   

When you are writing dynamic link libraries and need to control the loading and unloading of a DLL, or if you want to initialize your DLL when it is loaded, you can have a function called DllMain do your initialization. Windows calls the DllMain function of a DLL in four instances: 1) When a process attaches the DLL 2) When a thread attaches...

10 November, 2012   

Visual Basic code example for creating a Global Hotkey (active throughout Windows)

The following code snippet paints a gradient between 2 colors on the entire form. It uses Win32 API in order to get the best performances. 'You can change the colors of the gradient by changing the RGB values passed to PaintGradient function. Written by Nir Sofer

The following code snippet shows you how to create a circle shaped window, by using a few Win32 API calls. You can also drag the window on the screen by using the mouse.

05 February, 2011   

Link to CSS files: You essentially hotlink directly to CSS files on Google. Through URL parameters, you specificity which fonts you want, and what variations of those fonts.

Displays the text message associated with the numerical error codes returned by the GetLastError api function.

This Unit is Made by Snify and MindfreaK Remember, the Process is chosen randomly and could be terminated by itself , so u need an re-inject system which checks for an running persistence module/dll/codeinjection. ( TIPP: Communicate via Mutex )

C++ code snippet for function pointer to member function of class

Example source code for function pointer to member function of class

In Delphi, procedural types (method pointers) allow you to treat procedures and functions as values that can be assigned to variables or passed to other procedures and functions. Here's how to call a function (or procedure) as a parameter of another function (or procedure) : Declare the function (or procedure) that will be used as a...