🚀 go-pugleaf

RetroBBS NetNews Server

Inspired by RockSolid Light RIP Retro Guy

Article View: borland.public.cppbuilder.nativeapi
Article #1459

Re: LB_DIR Troubles

#1459
From: Damon Chandler (TeamB)
Date: Sat, 04 Aug 2007 09:05
36 lines
2046 bytes
Hi DC,

Both approaches should work as long as the list box has already created 
it's underlying window handle.  If you call the Perform() method in your 
form's constructor, for example, the call will fail if you hadn't 
previously informed the list box to create its window handle (e.g., by 
querying its Handle property).  In other words, try...

   ListBox1->HandleNeeded();
   ListBox1->Perform(LB_DIR, DDL_EXCLUSIVE | DDL_ARCHIVE,
     (LPARAM)"*.*");

The reason the call to ListBox1->HandleNeeded() isn't needed when you 
use the SendMessage() function is because you're accessing 
ListBox1->Handle as your first parameter to SendMessage().  Querying 
ListBox1->Handle internally calls HandleNeeded().

Cheers,
--
Damon Chandler (TeamB)
C++Builder Developer's Journal
http://bcbjournal.com
http://bcbjournal.org


DreamChaser wrote:
> Can anyone tell me why:
> 
> SendMessage(ListBox1->Handle, LB_DIR, DDL_EXCLUSIVE | DDL_ARCHIVE, 
> (LPARAM)"*.*");
> 
> Works and
> 
> ListBox1->Perform(LB_DIR, DDL_EXCLUSIVE | DDL_ARCHIVE, (LPARAM)"*.*");
> 
> Doesn't?
Technical Details
Message-ID: <46b44161@newsgroups.borland.com>
Path: arc1-ca.pugleaf.net!g2news2.google.com!news1.google.com!border1.nntp.dca.giganews.com!nntp.giganews.com!newsfeed00.sul.t-online.de!newsfeed01.sul.t-online.de!t-online.de!newsgroups.borland.com!not-for-mail
References: <46a04f4d$1@newsgroups.borland.com>

Show Full Headers
Complete Article Headers
X-Google-Thread: 10cc67,d77d629b72e1304d
X-Google-Attributes: gid10cc67,public,usenet
X-Google-Language: ENGLISH,ASCII-7-bit
Date: Sat, 04 Aug 2007 04:05:38 -0500
From: "Damon Chandler (TeamB)" <editor@NOSPAM.bcbjournal.com>
User-Agent: Thunderbird 1.5.0.12 (Windows/20070509)
MIME-Version: 1.0
Newsgroups: borland.public.cppbuilder.nativeapi
Subject: Re: LB_DIR Troubles
References: <46a04f4d$1@newsgroups.borland.com>
In-Reply-To: <46a04f4d$1@newsgroups.borland.com>
Content-Type: text/plain; charset=ISO-8859-1; format=flowed
Content-Transfer-Encoding: 7bit
NNTP-Posting-Host: 139.78.77.231
Message-ID: <46b44161@newsgroups.borland.com>
X-Trace: newsgroups.borland.com 1186218337 139.78.77.231 (4 Aug 2007 02:05:37 -0700)
Lines: 36
Path: arc1-ca.pugleaf.net!g2news2.google.com!news1.google.com!border1.nntp.dca.giganews.com!nntp.giganews.com!newsfeed00.sul.t-online.de!newsfeed01.sul.t-online.de!t-online.de!newsgroups.borland.com!not-for-mail