Delphi_Tips Issue No# 74 - 4th June 2003

James M Sandbrook <[email protected]> Wed, 04 Jun 2003 21:13:01 +1200
Newsgroups gmane.comp.lang.delphi.tips
Organization Sandbrook Software
Message-ID <[email protected]>
------------------------ Yahoo! Groups Sponsor ---------------------~-->
Get A Free Psychic Reading! Your Online Answer To Life's Important Questions.
http://us.click.yahoo.com/Lj3uPC/Me7FAA/ySSFAA/i7folB/TM
---------------------------------------------------------------------~->

*** DelphiCollection.Com ***
http://www.delphicollection.com

Tips For International Delphi Developers
You are receiving this newsletter because you have
requested to be in our Delphi Tips mailing list.

===========================================
Delphi_Tips Issue No# 74 - 4th June 2003
===========================================
===========================================
Special thanks to this weeks sponsor: Sunisoft.

TinyDB is a small, fast and very reliable database engine
for developers in Delphi and C++Builder applications.
Save time and money with this nimble database system.

This is a great product and worth checking out!

http://www.delphicollection.com/public/TinyDB.htm
===========================================
===========================================

Hello all!

We hope you are having a good week!

The winners of all those cool prizes
last month were:

SMLPack - MR S E LINDSAY-YULE - UK
SMLPack - Terry Long - US
TinyDB - Patrick Dohogne - US
SUIPack - Giles Evans - US.
The Sandbrook Software Suite -
Budi LEE - Australia

They got these prizes when they brought
The Delphi Collection
http://www.delphicollection.com

Browse down the page to view the tips and
examples, Delphi links, etc.

Send your Delphi Tips/Delphi links/Delphi Articles to:
[email protected]

We look forward to hearing from you.

All the best from
James M Sandbrook
http://www.delphicollection.com
====================================
Do you want your applications to have MacOS
or WinXP or other COOL themes (Skins)?

Now you can do it without writing a single line of code!
SUIPack is a suite of enhanced GUI components
for Delphi/BCB to help you to create applications with
cool themes.
Compatible with: Delphi 5/6/7, C++Builder 5/6.

http://www.delphicollection.com/public/SUIPack.htm
====================================
Today's Delphi Tips:

Copy:
[function Copy(S; Index, Count: Integer): string;]

Unit System - String Handling Routines

Copy returns a substring of a string or a
segment of a dynamic array.

procedure TForm1.Button3Click(Sender: TObject);
var TheWord : String;
begin
    TheWord := 'The Beatles Music';
    Label1.Caption := Copy(TheWord, 4, 17);
end;

The result is this string: Beatles Music

Copy(The string to be used, start position, the number of characters);
---
Loading Win.ini into a Memo:

procedure TForm1.Button1Click(Sender: TObject);
var WinName : String; WindowsDir : Array[0..Max_Path] of Char;
begin
  GetWindowsDirectory(WindowsDir, Max_Path);
  WinName := StrPas(WindowsDir);
  Memo1.Lines.LoadFromFile(WinName + '\win.ini');
  Label1.Caption := WinName + '\win.ini';
end;
===
Loading Win.ini into a Memo:

procedure TForm1.Button1Click(Sender: TObject);
var WinName : String; WindowsDir : Array[0..Max_Path] of Char;
begin
  GetWindowsDirectory(WindowsDir, Max_Path);
  WinName := StrPas(WindowsDir);
  Memo1.Lines.LoadFromFile(WinName + '\win.ini');
  Label1.Caption := WinName + '\win.ini';
end;
===
StrToDateTime:
[function StrToDateTime(const S: string): TDateTime;]

Unit SysUtils - Date/Time Routines.

The function StrToDateTime is used to convert a
string into a TDateTime format.

procedure TForm1.Button1Click(Sender: TObject);
var DT : TDateTime; S : String;
begin
  S := '10/10/02 12:03:34';
  DT := StrToDateTime(S);
  Label1.Caption := DateTimeToStr(DT);
end;
===========================================
DETECTING OTHER WINDOWS APPS AND PAUSING EXECUTION
Q. I need to know if two Windows apps are running,
and if so, pause the execution of my Delphi app
until they are finished.
I have tried the FindWindow API function and it
always reports 0 (i.e., window not found) even
when the apps are running. I am using this syntax:

FindWindow('0','App Title')

Am I doing it wrong?

http://www.delphicollection.com/public/GregLief/gl_q&a39.html
===
DYNAMICALLY CREATING COMPONENTS
Q. I am trying to create a listbox at run-time.
However, I keep getting an access violation.
What is wrong with my code?

procedure TForm1.Button1Click(Sender: TObject);
Var MyList:TListBox; {Herein lies the problem?}
begin
  ListBox1.Items.Add('new');
  {this is a listbox which I dropped on the form
  at design-time, and this statement works fine }
  MyList.Items.Add('new');   {this always causes a GPF }
end;

http://www.delphicollection.com/public/GregLief/gl_q&a38.html
===
Waiting till an application ends

http://www.delphicollection.com/public/Tips/Latium/delphi003.html
===
Accessing the Windows Registry

http://www.delphicollection.com/public/Tips/Latium/delphi004.html
===
Determining the associated application

http://www.delphicollection.com/public/Tips/Latium/delphi005.html
===
Delphi Tips 'n' Tricks:

http://www.delphicollection.com/public/Tips/PeterMorris/tips.htm
===========================================
Delphi Top Sites

http://www.sandbrooksoftware.com/TS/TS2/delphi.shtml
---
The BDE Support Page.
A helpful web site with lots of information
for developers who use the BDE.

http://www.bdesupport.com/index.html
---
Emiel Hollander's Delphi Tips

http://www.delphicollection.com/public/Tips/Emiel/index.shtml
===========================================
If this issue helped you then please vote for this mailing list here:
All it takes is a simple click and you can the look at links
and banners to many Delphi developer web sites.

http://www.sandbrooksoftware.com/cgi-bin/TopSite2/rankem.cgi?id=James
===========================================

If you have a Delphi tip that you would like to see here,
please email [email protected] with the tip.

If you know a Delphi developer who you think will
find these Delphi tips useful, then do them a
favour - let them know about this mailing list.

Thank you!

Mr Delphi Tips!
James M Sandbrook
Bringing you Delphi tips from all around the world!
The Delphi Collection Web Site.
http://www.delphicollection.com/public/index.shtml
===========================================
Advertising Information:
For information on advertising in the Delphi_Tips Issues and
the Delphi Collection web site please send an email to:
[email protected]
===========================================
Note: This email is never sent unsolicited.

You are receiving this email because you signed up for
free "Delphi_Tips" from The Delphi Collection.

If you do not wish to receive email from us please
follow the simple removal instructions below.

Subscribe:  [email protected]
Unsubscribe:  [email protected]

Other
List owner:  [email protected]

Our Chat
http://groups.yahoo.com/group/delphi_tips/chat
Our Links Page
http://groups.yahoo.com/group/delphi_tips/links
Our Polls Page
http://groups.yahoo.com/group/delphi_tips/polls
===========================================
These Delphi Tips newsletters are compiled with
SuperEd - Part of the Delphi Collection.
===========================================
© Copyright Sandbrook Software 1998 - 2003.



To Unsubscribe, send a blank message to: [email protected]
 

Your use of Yahoo! Groups is subject to http://docs.yahoo.com/info/terms/