🚀 go-pugleaf

RetroBBS NetNews Server

Inspired by RockSolid Light RIP Retro Guy

Article View: comp.windows.ms.programmer
Article #493

Re: Question about Listbox 64K barrier

#493
From: Tom W. Brown
Date: Wed, 26 Aug 1992 18:14
43 lines
2489 bytes
In article <k+bn2wq.sam@netcom.com>, sam@netcom.com (Samuelson S. Rehman) writes:
|> 
|> I'm a M2 UNIX programmer and programming in MS Windows is pretty new to me.
|> 
|> I'm writing a program that can allow a user to select a record from
|> a listbox. Now this list of record can easily exceed the 64K barrier.
|> So my questions are:
|> 
|> 	1. How can I interrupt the user when he's trying to scroll down/up,
|> 	so I can load the next/prev 64K segment from the file ?
|> 
|> 	2. And even if that can be done, how do I maintain the scrollbar to
|> 	show the position of the bar within the whole database, but not
|> 	just within the 64K segment ??
|> 

Both of these concerns can be addressed by using an "OWNERDRAW" listbox.  Check
the documentation for CreateWindow with regard to the LBS_OWNERDRAWFIXED or
LBS_OWNERDRAWVARIABLE styles.

In a nutshell, these styles allow you to have a listbox where Windows does
not need to store strings for each item in the list, rather a message is
sent back to your application whenever a list item needs to be displayed (c.f.
WM_DRAWITEM) allowing you to perform whatever file/memory buffering you
desire.

|> 	3. If that is totally impossible, can anyone tell me where can
|> 	I find information (books maybe) about writing a widget ( or
|> 	whatever it's called in MS Windows ) ?

The definitive documentation is probably the SDK (Software Developer's Kit)
manual set from Microsoft Press, but there are plenty of books available that 
do a better job of "teaching" windows programming -- one of my favorites has
always been Charles Petzold's book.

Good luck,


----------------------------------------------------------------------------
Tom Brown               |  "Strange women, lying in ponds, distributing
PE Nelson Systems       |   swords is no basis for a system of government."
twbrown@pe-nelson.com   |                    Monty Python and the Holy Grail
----------------------------------------------------------------------------
Technical Details
Message-ID: <598@lax.lax.pe-nelson.com>
Path: arc1-ca.pugleaf.net!sparky!uunet!lax.pe-nelson.com!lax!twbrown
References: <k+bn2wq.sam@netcom.com>

Show Full Headers
Complete Article Headers
Path: arc1-ca.pugleaf.net!sparky!uunet!lax.pe-nelson.com!lax!twbrown
From: twbrown@PE-Nelson.COM (Tom W. Brown)
Newsgroups: comp.windows.ms.programmer,comp.os.ms-windows.programmer.misc
Subject: Re: Question about Listbox 64K barrier
Message-ID: <598@lax.lax.pe-nelson.com>
Date: 26 Aug 92 18:14:31 GMT
References: <k+bn2wq.sam@netcom.com>
Sender: news@lax.pe-nelson.com
Followup-To: comp.windows.ms.programmer
Distribution: usa
Organization: PE-Nelson
Lines: 43