🚀 go-pugleaf

RetroBBS NetNews Server

Inspired by RockSolid Light RIP Retro Guy

Article View: comp.windows.misc
Article #1056

Re: MS Windows -- edit controls

#1056
From: Bill Turner
Date: Fri, 21 Oct 1988 17:03
24 lines
1414 bytes
> I have an edit-class window into which i am trying to open a file.
> So far, so good.  However, i would like to then open an additional
> file.  I can't seem to get it tacked on to the end of the current
> edit control without losing what's already there.

How are you getting the first file into the edit control?

I haven't done this myself, but I have two suggestions on how to
proceed:

1) When you are ready to append the second file, send a EM_GETHANDLE
message to the edit (which returns the local handle of its buffer),
then LocalReAlloc it to the required size and read the text onto
the end of the buffer.

2) Read the text into a block of memory, then EM_SETSEL to the end of
file (I believe that if you specify start and end as the same it moves
the cursor to that location), and EM_REPLACESEL to replace the (null)
selection with the text you've read.

(My preferences lean toward the first suggestion, since I'm not sure
if SETSEL works as I think it does...)

--Bill Turner
Technical Details
Message-ID: <102040004@hpcvlx.HP.COM>
Path: arc1-ca.pugleaf.net!utzoo!utgpu!attcan!uunet!lll-winken!lll-tis!helios.ee.lbl.gov!pasteur!ucbvax!hplabs!hp-pcd!hpcvlx!bturner
References: <4158@umd5.umd.edu>

Show Full Headers
Complete Article Headers
Path: arc1-ca.pugleaf.net!utzoo!utgpu!attcan!uunet!lll-winken!lll-tis!helios.ee.lbl.gov!pasteur!ucbvax!hplabs!hp-pcd!hpcvlx!bturner
From: bturner@hpcvlx.HP.COM (Bill Turner)
Newsgroups: comp.windows.misc
Subject: Re: MS Windows -- edit controls
Message-ID: <102040004@hpcvlx.HP.COM>
Date: 21 Oct 88 17:03:59 GMT
References: <4158@umd5.umd.edu>
Organization: Hewlett-Packard Co., Corvallis, OR, USA
Lines: 23