Archives by Tag 'Windows API' - facebook posting twit
Window flashing 2007-09-25 05:30
Flashing a window means changing the appearance of its caption bar as if the window were changing from inactive to active status...
Posted in Delphi . Tags: FlashWindow, Windows API


How to use TTF Font Without Installing 2007-09-25 05:29
Here's how to use a TTF (true type font) in your Delphi application without having to install it in Windows:1. In the OnCreate e...
Posted in Delphi . Tags: AddFontResource, RemoveFontResource, TCloseAction, True Type Font Display, Windows API


How to show window contents while dragging 2007-09-25 05:27
Here's how to enable or disable the "Show window contents while dragging" Windows fature from Delphi code://To Show window conte...
Posted in Delphi . Tags: SystemParametersInfo, Window content drag, Windows API


How to save text from Clipboard to a file 2007-09-25 05:19
If you want to save the text data contained in the Clipboard to a text file on a disk, use the next code:{Usage:ClipboardTxtToFi...
Posted in Delphi . Tags: AssignFile, ClipboardTxtToFile, GetClipboardData, HasFormat, How to save clipboard, ReWrite, Windows API


How to send char as message to another application 2007-09-25 05:17
The following code is used to insert a character into another application - Notepad.procedure TForm1.Button1Click(Sender: TObjec...
Posted in Delphi . Tags: kbdevent, SendMessage, Windows API, Windows Message Example


How to restrict mouse movement 2007-09-25 05:16
Here's how to restrict the mouse movement to a form and release this restriction after a click on a form:procedure TForm1.FormCr...
Posted in Delphi . Tags: Disable Mouse, Mouse Restriction, Windows API


List Devices (LPT, COM ports, …) 2007-09-25 05:15
The following procedure will list all the devices on your computer. You can then extract the com ports and printer ports by look...
Posted in Delphi . Tags: How to list up the installed peripherials, QueryDosDevice, Windows API


How to know whether the font is TrueTypeFont or not 2007-09-25 05:13
Given a font's name (such as Arial,Verdana, Times New Roman, etc), function returns a boolean value indicating whether the font...
Posted in Delphi . Tags: True Type Font Detection, Windows API


How to track a user’s idle time 2007-09-25 05:12
Suppose you have a data-critical type of application where you would not want a non-authored user to work with the data. Such an...
Posted in Delphi . Tags: TLastInputInfo, TTimer Usage Example, Windows API


How to remove your application from TaskBar 2007-09-25 05:11
If you need to hide your application from the Windows TaskBar, you can use the following trick:procedure TForm1.FormCreate(Sende...
Posted in Delphi . Tags: Hide from Taskbar, SetWindowLong, ShowWindow, Windows API


How to play sounds on the PC Speaker ? 2007-09-19 23:39
Here's an example of how to play simple sounds on the PC speaker procedure SetPort(address, Value: Word) ; var   bValue:...
Posted in Delphi . Tags: GetPort, SetPort, Sound, Sound Play by PC Speaker, VER_PLATFORM_WIN32_NT, Windows API


How to install an INF file using Delphi ? 2007-09-19 23:36
If you need to install an "inf" file using Delphi, you could use the next code: { Usage:   InstallINF('C:\XYZ.inf', 0) ;...
Posted in Delphi . Tags: DefaultInstall, Device Driver Installation Method, How To Install Device Driver?, InstallHinfSection, InstallHinfSection DefaultInstall 132, InstallINF, setupapi, ShellAPI, ShellExecute, Windows API


How to determine the output of a console application ? 2007-09-19 23:33
When you write a console mode application (no GUI), the output by default goes to the screen, but this can be overridden by the...
Posted in Delphi . Tags: FILE_TYPE_CHAR, FILE_TYPE_DISK, FILE_TYPE_PIPE, FILE_TYPE_UNKNOWN, GetFileType, GetStdHandle, STD_OUTPUT_HANDLE, Windows API


Get text from the control at pos x,y on screen 2007-09-19 23:32
This form has 3 labels and a timer component:unit unit1; interface uses   Windows, Messages, SysUtils, Classes, Graphics...
Posted in Delphi . Tags: GetClassName, WindowFromPoint, Windows API, WM_GETTEXT


Get dimensions of usable space on monitor (work area) 2007-09-19 23:30
If you need to find the dimensions of user's screen in pixels, after subtracting any space occupied by the task bar and any tool...
Posted in Delphi . Tags: Windows API, WorkAreaHeight, WorkAreaWidth


Get system info (free memory, etc) 2007-09-19 23:29
Put a TMemo (Memo1) and a TButton (Button1) in your form. Put this code into OnClick of Button1:procedure TForm1.Button1Click(Se...
Posted in Delphi . Tags: Get Available System Memory Information, Get System Information, Get System Memory Status, TMemoryStatus, Windows API, 메모리 정보 가져오기, 시스템 메모리 상태 가져오기, 시스템 메모리 정보 가져오기


How to Get Filenames from Clipboard ? 2007-09-19 23:26
"If I use the Windows Explorer to copy a file, how can I use the paste function in my application?" This code retrieves the fil...
Posted in Delphi . Tags: Clipboard, DragQueryFile, Extract Filenames from Clipboard, Windows API


How to Get Windows OS Version ? 2007-09-19 23:25
Here's how to get the Windows version from Delphi code:type TWinVersion = (wvUnknown, wvWin95, wvWin98, wvWin98SE, wvWinNT, wvWi...
Posted in Delphi . Tags: dwOSVersionInfoSize, Get Windows OS Version, GetWinVersion, TOSVERSIONINFO, Windows API, WIndows OS Detection


Get Windows Temp directory 2007-09-19 23:23
thePath holds the Windows Temp directory:var   lng: DWORD;   thePath: string; begin   SetLength(thePath, MA...
Posted in Delphi . Tags: Get Temporary Directory, GetTempPath, Windows API


Disable ALT+TAB, CTRL+ESC, CTRL+ALT+DEL 2007-09-18 23:33
If you wish to disable those key combinations while your application is running call SystemKeys. When you call SystemKeys, if Di...
Posted in Delphi . Tags: Disable ALT+TAB, Disable CTRL+ALT+DEL, Disable CTRL+ESC, SPI_SCREENSAVERRUNNING, SystemKey, SystemParametersInfo, Windows API


Display Standard Windows Properties dialog 2007-09-18 23:31
Here's the code that will display the standard Windows Properties dialog for a specified file (object) name.Usage:ShowProperties...
Posted in Delphi . Tags: How to show application property dialog, SEE_MASK_FLAG_NO_UI, SEE_MASK_INVOKEIDLIST, SEE_MASK_NOCLOSEPROCESS, ShellExecuteEx, SHELLEXECUTEINFO, ShowProperties, Windows API


Disable Mouse and Keyboard from Delphi Code 2007-09-18 23:28
The BlockInput API function blocks keyboard and mouse input events from reaching applications. Place a Button (name: "Button1")...
Posted in Delphi . Tags: BlockInput, Disable Keyboard, Disable Mouse, GetModuleHandle, GetProcAddress, LoadLibrary, Windows API


Detecting Drive Types 2007-09-18 23:26
Here's how to get the types of drives on your computer: //Note: you will need one button and //one memo on your form, for this t...
Posted in Delphi . Tags: Drive Type Detection, DRIVE_CDROM, DRIVE_FIXED, DRIVE_RAMDISK, DRIVE_REMOTE, DRIVE_REMOVABLE, GetDriveType, Windows API


Detecting and preventing Windows shut down 2007-09-18 23:23
When Windows is about to shut down, it sends a WM_QueryEndSession to all open applications. To detect (and prevent shutdown) , w...
Posted in Delphi . Tags: Prevent Shutdown, Shut Down, Windows API, WMEndSession, WMQueryEndSession, WM_EndSession, WM_QueryEndSession


Create new program group in the Start menu 2007-09-18 23:20
Here's how to create a new program group inside the Start-Programs menu: uses shlobj; ... function CreateFolder(Foldername: s...
Posted in Delphi . Tags: CreateDirectory, CreateFolder, CSIDL_PROGRAMS, Shell Object, SHGetPathFromIDList, SHGetSpecialFolderLocation, ShlObj, Windows API


Copying Group of Files using Delphi with Standard Animation Dialog (SHFileOperation) 2007-09-18 23:17
The following example demonstrates using the SHFileOperation function to copy a group of files and display a progress dialog. Yo...
Posted in Delphi . Tags: Animation Dialog, fAnyOperationsAborted, File Copy, SHFileOperation, StrECopy, TSHFileOpStruct, Windows API


Controling sound volume from code 2007-09-18 23:13
Here's an example of controling the sound volume from Delphi: uses MMSystem; type   TVolumeRec = record    ...
Posted in Delphi . Tags: AuxGetVolume, AuxSetVolume, MMSystem, SetVolume, TVolumeRec, Volume Control, Windows API


How to Close Another Application by Windows Caption 2007-09-18 23:12
To programmatically close another application, send to the application a WM_QUIT message. "Window caption" is the caption of the...
Posted in Delphi . Tags: Close Application, FindWindow, Kill Application, PostMessage, Windows API, Windows Caption


How to Change the Windows Start button bitmap 2007-09-18 23:10
Here's how to chane the bitmap on the Windows Start button:{We'll need several global variables}var    Form1: TForm1;&...
Posted in Delphi . Tags: BM_SetImage, SendMessage, TPicture, Windows API, Windows Start Button


How to capture the output from a DOS (command/console) Window 2007-09-18 23:09
The example runs 'chkdsk.exe c:\' and displays the output to Memo1.Put a TMemo (Memo1) and a TButton (Button1) on your form. Put...
Posted in Delphi . Tags: chkdsk, Createpipe, CreateProcess, DOS Command Capture, TProcessInformation, TSecurityAttributes, TStartUpInfo, WaitForSingleObject, Windows API


1 2