Solved

List boxes in dialog boxes

Posted on 1998-12-07
3
153 Views
Last Modified: 2010-04-16
In TPW 1.5 I need to know how to put data (ie null strings) into list boxes which are in dialog boxes made in the resource workshop. I have tried setdlgitemtext with no luck, and the addstring command is a mystery. Thanks.
0
Comment
Question by:pobwest
  • 2
3 Comments
 
LVL 27

Expert Comment

by:BigRat
ID: 1216371
Hi, it's that Rat again.
The long way round is to send the control a message LB_ADDSTRING
with SendDlgItemMessage :-
    SendDlgItemMessage(hDlg,IDD_LISTBOX,LB_ADDSTRING,0,
                   LongInt(Pchar(@CharArray)));
and that for each string (which here is in CharArray). The Message is LB_ADDSTRING, the wParam is zero and the lParam is the address of the string.

The AddString method to which you refer is when you have a TListBox *object*. You can create one of these with New
in a TDialog derivitive :-
    ListBox : PListBox;
    ListBox:=New(PListBox,InitResource(@self,IDD_LISTBOX));

The InitResource constructor takes the TDialog object (here as self) and the ID of the box. You can now call the AddString method :-
    ListBox^.AddString(String);
OK? or do you want further details?
0
 

Author Comment

by:pobwest
ID: 1216372
Thanks, thats what i was looking for.
0
 
LVL 27

Accepted Solution

by:
BigRat earned 50 total points
ID: 1216373
Then I'll answer the other one then.
0

Featured Post

Free Tool: ZipGrep

ZipGrep is a utility that can list and search zip (.war, .ear, .jar, etc) archives for text patterns, without the need to extract the archive's contents.

One of a set of tools we're offering as a way to say thank you for being a part of the community.

Question has a verified solution.

If you are experiencing a similar issue, please ask a related question

Suggested Solutions

Title # Comments Views Activity
Convertion SDK Vc++ to Delphi - fingerprint reader 5 813
Extract text from webbrowser 5 1,401
Get pixel color of a jpg in a TImage 1 2,698
interacting with web form 4 149
Most MSPs worth their salt are already offering cybersecurity to their customers. But cybersecurity as a service is wide encompassing and can mean many things.  So where are MSPs falling in this spectrum?
Starting your own business is always a daunting process, and for most people it is brand new experience. Avoid the common pitfalls by following these tips to start on the road to success.
Nobody understands Phishing better than an anti-spam company. That’s why we are providing Phishing Awareness Training to our customers. According to a report by Verizon, only 3% of targeted users report malicious emails to management. With compan…
The Email Laundry PDF encryption service allows companies to send confidential encrypted  emails to anybody. The PDF document can also contain attachments that are embedded in the encrypted PDF. The password is randomly generated by The Email Laundr…

839 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