Delphi Print File I/O Status Check ShellExecute Delphi Networking GetModuleHandle Delphi Intranet SMTP CreateFile SendMail BMP to JPG SW_HIDE GetDriveType SW_SHOW TOSVERSIONINFO Print Dialog idURI InetIsOffline GetVolumeInformation SHELL32.DLL EmailDomain GetProcAddress Transparent Text Out TPrintDialog Is Audio CD TidURI Delphi Folder Navigation Dialog ShowWindow TidHTTP Hide Taskbar Hide Caption Bar Gradient Filled Form GetWindowsVersion How to get Network Drive Class_HTMLDOcument GetVersionEx GetSystemDefaultLangID available memory size GetPrivateProfileString Animated Icon GetImageLinks BrowseInfo GENERIC_WRITE Animated Application Icon COMObj Delphi File System Control Delhi Internet Desktop Wallpaper DISP_CHANGE_FAILED 켜져있는시간 CSIDL_FAVORITES CreateEllipticRgn CreateComObject Caption Bar File Delete with UNDO Comma Separator File is in use Comma Focus free memory

GETMODULEHANDLE.ZIP

Are we connected to the Internet?   (created at Sep 17, 2007)   30  

Here's how to check whether you are connected to the Internet procedure TForm1.Button1Click(Sender: TObject) ;   function FuncAvail(_dllname, _funcname: string; var _p: pointer): boolean;   {return True if _funcname exists in _dllname}   var...

Download a file from the Internet with progress indicator   (created at Sep 17, 2007)   43  

If you need to save the contents of a specified URL to a file - and be able to track the download progress, use the TDownLoadURL Delphi action While TDownLoadURL is writing to the specified file, it periodically generates an OnDownloadProgress event, so th...

Extracting the domain (host) name from an e-mail address   (created at Sep 17, 2007)   31  

If you have an email as a string value and want to extract only the domain (host) name from it, like in: "delphi.guide@about.com" - domain name = "about.com", you can use the next function:

How to get get IE favorites   (created at Sep 17, 2007)   26  

The GetIEFavourites function called from the OnClick event of a button returns a list of all the favorites from your Internet Explorer in a ListBox. function GetIEFavourites (const favpath: string):TStrings; var   searchrec:TSearchrec;   str:TStr...

How to set the "home page" for the Internet Explorer from Delphi code   (created at Sep 17, 2007)   46  

Here's how to change the home page for the IE from Delphi code (IE-Tools-Internet options...) uses Registry; ... function SetIEHomePage(PageName: string): Boolean; begin   with TRegistry.Create do   try     RootKey := HKEY_CURRENT_USER;...

List All Network Drives   (created at Sep 17, 2007)   47  

To show a list of all mapped network drives, use the GetNetworkDriveMappings function. Example usage: GetNetworkDriveMappings(Memo1.Lines) ; function GetNetworkDriveMappings (SList: TStrings): integer; var   c: Char;   ThePath: string;   Max...

Retrieving all image links from an HTML document   (created at Sep 17, 2007)   31  

Here's how to obtain all image links from an HTML document. The GetImageLinks procedure fills a TStrings object with the value of the SRC property of the IMG HTML element. Note: if the images have relative links, you will have to parse the document url and...

Does my CD-ROM drive contain an audio CD?   (created at Sep 10, 2007)   26  

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'.function IsAudioCD(Drive : char) : bool;var   DrivePath : s...

Convert a mapped drive to a full UNC path   (created at Sep 10, 2007)   64  

Universal/Uniform Naming Convention. A UNC path describes the location of a volume, directory, or file.The format for a UNC path is \servervolumedirectoryfile and is not case-sensitive. For example:    \Shared1_svrShared1WGroupsNetworkOrders.xlsR...

Checking If File Is In Use   (created at Sep 10, 2007)   42  

IsFileInUse will return true if the file is locked for exclusive access. It would fail if the file doesn't exist at all. function IsFileInUse(fName : string) : boolean;var    HFileRes : HFILE;begin    Result := false;    if no...

Browse for Computers, Folders, Files and Printers   (created at Sep 10, 2007)   39  

By using the SHBrowseForFolder Windows API function and Delphi we can invoke a Windows system dialog used to browse for files and folders on users hard drive as well as network computers and printers. First, let's look at what SHBrowseForFolder needs. Here...

How to draw Transparent Text on bitmap   (created at Sep 01, 2007)   40  

You can set transparent mode by calling SetBkMode function.procedure TForm1.Button1Click(Sender: TObject);begin  with Image1.Picture.Bitmap.Canvas do  begin    Font.Color  := clBlue;    Brush.Style := bsclear;   ...

How Do I Remove The Application Icon From The Taskbar?   (created at Aug 25, 2007)   32  

To remove the icon from the taskbar, you need to call a Windows API call:BOOL ShowWindow(HWND hwnd,int nCmdShow);Delphi makes it very easy to use this command. All you need to do is supply the Application.handle and SW_HIDE to remove the icon from the task...

How To Show The Print Dialog And Print Text Files   (created at Aug 25, 2007)   50  

This code show an example of how to print a text of a RichEdit component.unit Unit1; interface uses   Windows, Messages, SysUtils, Classes, Graphics, Controls, Forms, Dialogs,   StdCtrls, ComCtrls; type   TForm1 = class(TForm)     ...

How To Make An Animated Application Icon   (created at Aug 25, 2007)   52  

Show how to create an animated icon in your programvar  icon1:Boolean; ... procedure TForm1.Timer1Timer(Sender: TObject); begin   if icon1=false then   begin     Application.icon:=Image1.Picture.Icon;      icon1:=tru...

How To Pass The Focus To The Next/prior Control   (created at Aug 25, 2007)   54  

Shows how to activate the next or prior control in a formnext control: SendMessage(Form1.Handle, WM_NEXTDLGCTL, 0, 0); prior control: SendMessage(Handle, WM_NEXTDLGCTL, 1, 0);

How To Make Rounded Windows   (created at Aug 25, 2007)   34  

Create a different form in your application...procedure TForm1.FormCreate(Sender:TObject);  var    region: HRgn;  begin    region:=CreateEllipticRgn(1,1,200,200);    SetWindowRgn(handle, region, true);  end;

How To Get Windows Uptime   (created at Aug 25, 2007)   37  

Find how long Windows has been working...function UpTime: string; const ticksperday : integer = 1000 * 60 * 60 * 24; ticksperhour : integer = 1000 * 60 * 60; ticksperminute : integer = 1000 * 60; tickspersecond : integer = 1000; var  t : longword; &nb...

How To Find Out Total And Available Memory   (created at Aug 25, 2007)   33  

Get the total and available memory in your system. (Total free memory space in your system)procedure TForm1.Button1Click(Sender: TObject); var   memory:TMemoryStatus; begin   memory.dwLength:=sizeof(memory);   GlobalMemoryStatus(memory); &nb...

How To Change The System Time   (created at Aug 25, 2007)   33  

This code shows how to set the system time to another value.procedure TForm1.Button1Click(Sender: TObject); var    systemtime : TSystemTime;    NewTime:string; begin    NewTime:='13:58:00';    DateTimeToSystemTime( D...

How To Get The Windows OS Version   (created at Aug 25, 2007)   47  

 Identify the Windows version of your systemfunction GetWindowsVersion : string;  var    OsVinfo   : TOSVERSIONINFO;    HelpStr   : array[0..50] of char;  begin    ZeroMemory(@OsVinfo,sizeOf(OsVinfo));...

How To Change The Desktop Wallpaper   (created at Aug 25, 2007)   35  

Change the wallpaper of your system by codeuses    Registry, WinProcs;  procedure SetWallpaper(               sWallpaperBMPPath : String;               bTile : boolean );&...

How To Get The Windows Language   (created at Aug 25, 2007)   32  

Obtains the language that Windows is using.function Language:string;  var    sLangID:LangID;    sLanguage: array [0..100] of char;  begin    sLangID:=GetSystemDefaultLangID;    VerLanguageName(sLangID,sLang...

How To Make A Gradient Filled Form   (created at Aug 25, 2007)   29  

Show how to paint a form in a different way...procedure TForm1.FormPaint(Sender: TObject); var   Row, Ht: Word;   IX: Integer; begin   iX :=200 ;   Ht:=(ClientHeight + 512) div 256;   for Row := 0 to 512 do   begin   &nbs...

How can I hide the caption bar on a form?   (created at Aug 25, 2007)   31  

To hide the caption bar you need to override on of the default form methods CreateParams (this also exists for other objects).The CreateParams method initializes a window-creation parameter record passed in the Params parameter (ref:Delphi Help).Go to the ...

How To Send An E-mail By Code   (created at Aug 25, 2007)   29  

Use this function to send an e-mail through your program. You must have the component TNMSMTP from FastNet tools. This component is included in Delphi 4-5 Professional and Enterpriseprocedure TForm1.Button1Click(Sender: TObject); begin   NMSMTP1.Host ...

How To Open Url In Default Webbrowser   (created at Aug 25, 2007)   32  

Use this function to open your browser with a given URL.uses    shellapi;  ....  procedure TForm1.Label1Click(Sender:TObject);  begin    shellexecute(handle,'open','http://www.swissdelphicenter.ch', nil,nil,sw_show); ...

How To Check If A Soundcard Is Installed   (created at Aug 25, 2007)   42  

Use this code to verify if a soundcard is installed in your systemuses mmsystem;  ...  function Soundkarte:Boolean;  begin    Result := WaveOutGetNumDevs >0;  end;

How To Change Screen Resolution   (created at Aug 25, 2007)   57  

Change the resolution of your screen.Actually I've ever used this function for TV-based software development, because of TV-resolution.{ The function NewRes can have the following result: DISP_CHANGE_SUCCESSFUL The settings change was successful. DISP_CHAN...

How To Force The Correct Decimal Separator   (created at Aug 25, 2007)   30  

Some English speaking countries use the "point" as decimal separator, while the rest of the world is using the "comma". How can you make sure that the user will press the correct key when entering a number with a decimal fraction? With the code in this exa...


Page: 1  2