[x]
Posted via EE Mobile

Search, ask, and monitor your questions on the go with EE Mobile. Visit Experts Exchange from your mobile device and never be out of touch again.

Question
[x]
Attachment Details
[x]
The Solution Rating System

With so many solutions, how can you tell which solutions are most likely to help you and which ones are not? To provide you with a tool to use, we rate our solutions based on various elements that most accurately determine if a solution is a quality solution. To explain what factors affect the solution rating, here are the elements we take into consideration when formulating our solution rating.

  • The Grade of the Solution
  • The Zone Rank of the Expert Providing the Solution
  • The Number of Author and Expert Comments
  • The Number of Experts Contributing
  • The Feedback of the Community

Your Input Matters
Because of the way the system is set up, the most important variable in this equation is you. As a member of Experts Exchange, you are able to cast your vote on the quality of the solutions in regard to how complete, accurate, helpful and easy to understand each solution is. When you provide your feedback, each rating is adjusted accordingly. So, if you see a solution that has a poor rating that you think is a good solution, let us know by rating it. As you do, the rating will be adjusted and will become more accurate for other members of our site.

If you have any suggestions that you would like to make for our rating system, please ask a question in the Suggestions Zone of Community Support.

Thank you!

7.8

How to perform magic on this TEdit + TRegistry Issue?

Asked by PeterdeB in Delphi Programming

Hi my dear friends!

Here I come...to ask for the impossible!

I have a TEdit, which I fill with the string: 'This line is far too long we should shorten it a bit!'
Now the TEdit is too small to display the entire string, so I use MinimizeName and get something like >
 'This line ...a bit!'

Now I want to have some kind of mechanism which helps me to write and read to and from the registry so the TEdit displays 'This line ...a bit!' while the actual string that is written to the registry is: 'This line is far too long we should shorten it a bit!'
Moreover, when the TEdit reads from the registry it should also read: 'This line is far too long we should shorten it a bit!' but display > 'This line ...a bit!'

Is this abacadabra enough to you wizards? To me it is....if you need more info...please ask. What I'n trying to do here is configure the Open Dialog Places Bar. The 5 shortcuts located on the far left when you open a document in Notepad for example.

Currently my TEdit displays for example:'K:\ 06 xp iso\ 01 xp iso unattended instal'
While the actual contents is: 'K:\ 06 xp iso\ 01 xp iso unattended installs\xp sp2 pro nl 251006 working_iso\xp sp2 pro nl 251006 working.iso'

So I have no idea where it leads to....If I could simply display only the last foldername...it would be great..but then again...how to make sure that the correct path is stored in teh registry and not just simply only the foldername?

Get the idea?

Kind regards,

Paul

Ps workin samples do the trick....heres the code fragment that fills my TEdits with the paths to the folders I want shortcuts to:

procedure TMainfrm.ButtonClick(Sender: TObject);
var
  lpbi: TBrowseInfo;
  pidlStart: PItemIDList;
  Malloc: IMalloc;
  sFolder: string;
  pidlSelected: PItemIDList;
  Edit: TEdit;
begin
  SHGetSpecialFolderLocation(Handle, $11, pidlStart);
  SHGetMalloc(Malloc);
  with lpbi do
  begin
    hwndOwner := Handle;
    pidlRoot := pidlStart;
    GetMem(pszDisplayName, MAX_PATH);
    lpszTitle := PChar('Selecteer folder');
    ulFlags := $00000001;
    lpfn := nil;
  end;
  pidlSelected := SHBrowseForFolder(lpbi);
  if pidlSelected <> nil then
  begin
    if SHGetPathFromIDList(pidlSelected, lpbi.pszDisplayName) then
      sFolder := StrPas(lpbi.pszDisplayName);
    if (Sender is TsuiButton) then
    begin
      Edit := FindComponent('edt' + Copy((Sender as TsuiButton).Name, 4, 255)) as
        TEdit;
        Edit.Text := sFolder;
      Canvas.Font := Edit.Font;
       Edit.Text := MinimizeName(sFolder,Canvas,edit.Width); { this is great! but when this takes effect an invalid folder reference is saved to the registry...obviously. A work aroudn for this???}
      Malloc.Free(pidlSelected);
    end;
    if lblWarning.Visible = False then
 lblWarning.Visible := True;
 if imgWarning.Visible = False
 then imgWarning.Visible := True;
    FreeMem(lpbi.pszDisplayName);
    Malloc.Free(pidlStart);
  end;
end;

This is the code fragment which shows how I write the TEdits content to the registry (all credits go the RLibby for this tremendous piece of code!!)

procedure TMainfrm.btnOKClick(Sender: TObject);
begin
if (mrYes = MessageDlg('Alle wijzigingen worden opgeslagen. Doorgaan?', mtConfirmation, [mbYes, mbNo], 0)) then
begin
SetRegistryData(HKEY_CURRENT_USER, PlacesBar,'place0',rdString,edt1.Text);
SetRegistryData(HKEY_CURRENT_USER, PlacesBar,'place1',rdString,edt2.Text);
SetRegistryData(HKEY_CURRENT_USER, PlacesBar,'place2',rdString,edt3.Text);
SetRegistryData(HKEY_CURRENT_USER, PlacesBar,'place3',rdString,edt4.Text);
SetRegistryData(HKEY_CURRENT_USER, PlacesBar,'place4',rdString,edt5.Text);
Close;
end;
end;
 
Related Solutions
Keywords: How to perform magic on this TEdit + …
 
Loading Advertisement...
 
[+][-]11/08/06 12:15 PM, ID: 17901308Accepted Solution

View this solution now by starting your 30-day free trial. Setting up your free trial is quick, easy, and secure. We will return you to this solution, unlocked, when you're done.

About this solution

Zone: Delphi Programming
Sign Up Now!
Solution Provided By: rllibby
Participating Experts: 3
Solution Grade: A
 
[+][-]11/08/06 10:20 AM, ID: 17900269Expert Comment

At Experts Exchange, members can ask their questions to thousands of technology professionals, also known as Experts. Experts compete and collaborate to answer those questions by leaving comments like this one.

Start your 30-day free trial to view this Expert Comment or ask the Experts your question.

 
[+][-]11/08/06 10:25 AM, ID: 17900312Author Comment

Often, when Experts are collaborating with members who have asked questions, they will request additional information about the problem. Askers respond with an author comment like this one.

Start your 30-day free trial to view this Author Comment or ask the Experts your question.

 
[+][-]11/08/06 10:30 AM, ID: 17900344Expert Comment

At Experts Exchange, members can ask their questions to thousands of technology professionals, also known as Experts. Experts compete and collaborate to answer those questions by leaving comments like this one.

Start your 30-day free trial to view this Expert Comment or ask the Experts your question.

 
[+][-]11/08/06 11:12 AM, ID: 17900733Author Comment

Often, when Experts are collaborating with members who have asked questions, they will request additional information about the problem. Askers respond with an author comment like this one.

Start your 30-day free trial to view this Author Comment or ask the Experts your question.

 
[+][-]11/08/06 02:58 PM, ID: 17902544Author Comment

Often, when Experts are collaborating with members who have asked questions, they will request additional information about the problem. Askers respond with an author comment like this one.

Start your 30-day free trial to view this Author Comment or ask the Experts your question.

 
[+][-]11/08/06 03:27 PM, ID: 17902701Expert Comment

At Experts Exchange, members can ask their questions to thousands of technology professionals, also known as Experts. Experts compete and collaborate to answer those questions by leaving comments like this one.

Start your 30-day free trial to view this Expert Comment or ask the Experts your question.

 
[+][-]11/08/06 03:41 PM, ID: 17902773Author Comment

Often, when Experts are collaborating with members who have asked questions, they will request additional information about the problem. Askers respond with an author comment like this one.

Start your 30-day free trial to view this Author Comment or ask the Experts your question.

 
[+][-]11/08/06 04:25 PM, ID: 17902960Expert Comment

At Experts Exchange, members can ask their questions to thousands of technology professionals, also known as Experts. Experts compete and collaborate to answer those questions by leaving comments like this one.

Start your 30-day free trial to view this Expert Comment or ask the Experts your question.

 
[+][-]11/08/06 04:25 PM, ID: 17902963Expert Comment

At Experts Exchange, members can ask their questions to thousands of technology professionals, also known as Experts. Experts compete and collaborate to answer those questions by leaving comments like this one.

Start your 30-day free trial to view this Expert Comment or ask the Experts your question.

 
[+][-]11/08/06 09:48 PM, ID: 17904270Author Comment

Often, when Experts are collaborating with members who have asked questions, they will request additional information about the problem. Askers respond with an author comment like this one.

Start your 30-day free trial to view this Author Comment or ask the Experts your question.

 
[+][-]11/08/06 10:13 PM, ID: 17904352Expert Comment

At Experts Exchange, members can ask their questions to thousands of technology professionals, also known as Experts. Experts compete and collaborate to answer those questions by leaving comments like this one.

Start your 30-day free trial to view this Expert Comment or ask the Experts your question.

 
[+][-]11/08/06 11:59 PM, ID: 17904664Author Comment

Often, when Experts are collaborating with members who have asked questions, they will request additional information about the problem. Askers respond with an author comment like this one.

Start your 30-day free trial to view this Author Comment or ask the Experts your question.

 
[+][-]11/09/06 02:22 PM, ID: 17910113Expert Comment

At Experts Exchange, members can ask their questions to thousands of technology professionals, also known as Experts. Experts compete and collaborate to answer those questions by leaving comments like this one.

Start your 30-day free trial to view this Expert Comment or ask the Experts your question.

 
[+][-]11/09/06 03:24 PM, ID: 17910496Author Comment

Often, when Experts are collaborating with members who have asked questions, they will request additional information about the problem. Askers respond with an author comment like this one.

Start your 30-day free trial to view this Author Comment or ask the Experts your question.

 
[+][-]11/09/06 03:33 PM, ID: 17910540Author Comment

Often, when Experts are collaborating with members who have asked questions, they will request additional information about the problem. Askers respond with an author comment like this one.

Start your 30-day free trial to view this Author Comment or ask the Experts your question.

 
[+][-]11/09/06 05:47 PM, ID: 17911101Expert Comment

At Experts Exchange, members can ask their questions to thousands of technology professionals, also known as Experts. Experts compete and collaborate to answer those questions by leaving comments like this one.

Start your 30-day free trial to view this Expert Comment or ask the Experts your question.

 
[+][-]11/09/06 09:29 PM, ID: 17912045Author Comment

Often, when Experts are collaborating with members who have asked questions, they will request additional information about the problem. Askers respond with an author comment like this one.

Start your 30-day free trial to view this Author Comment or ask the Experts your question.

 
 
Loading Advertisement...
20091111-EE-VQP-92