Formless Application which needs to sort a TStrings variable

Posted on 2003-02-22
Medium Priority
Last Modified: 2010-04-04
I have written myself a wallpaper randomisation application, and this application currently uses a form with a TListBox component on it to sort the files alphabetically. I want to remove the form so it is quicker and smaller, but then I have the problem of sorting the filenames. How can I sort the contents of a TStrings variable, without using a form component?

The application doesnt take any user input, which is why I want it formless.
Question by:getajob20

Accepted Solution

svvada earned 150 total points
ID: 7999024
Try using the TStringList

Expert Comment

ID: 7999279
TStringList has a Sorted property
LVL 35

Expert Comment

ID: 7999638
hello getajob20, you can do code in your Program, .DPR file and have a TstringList and many other things, but if you do NOT have a window and a GetMessage Loop then you will have trouble keeping your program running, or do you need it to keep running?, If file size is your concern then you can do a API window and GetMessage loop Program, if not then just Hide your main form. Do you need code for an API window and GetMessage Loop program?

Author Comment

ID: 8000826
Slick182: The program closes as soon as it has changed the wallpaper.

Everyone else: I'll try that and report back as soon as I have tried it. I'll award points to swada if it works, as you were the first to respond. If not, i'll let you know

Author Comment

ID: 8001026
It wasn't a particularly in-depth solution to a general problem, so I awarded a C grade. If the problem warranted a more in-depth answer, and I was given the depth of answer I needed, I would increase the grade.

Featured Post

Keep up with what's happening at Experts Exchange!

Sign up to receive Decoded, a new monthly digest with product updates, feature release info, continuing education opportunities, and more.

Question has a verified solution.

Are you are experiencing a similar issue? Get a personalized answer when you ask a related question.

Have a better answer? Share it in a comment.

Join & Write a Comment

Creating an auto free TStringList The TStringList is a basic and frequently used object in Delphi. On many occasions, you may want to create a temporary list, process some items in the list and be done with the list. In such cases, you have to…
This is an update to some code that someone else posted on Experts Exchange. It is an alternate approach, I think a little easier to use, & makes sure that things like the Task Bar will update.
In this video I will demonstrate how to set up Nine, which I now consider the best alternative email app to Touchdown.
Watch the video of Kernel Migrator for SharePoint, which demonstrate the process easily of migration from SharePoint to SharePoint, OneDrive for Business & Google Drive servers, Public Folder to SharePoint, File Server to SharePoint. The tool has va…

607 members asked questions and received personalized solutions in the past 7 days.

Join the community of 500,000 technology professionals and ask your questions.

Join & Ask a Question