Article View: borland.public.cppbuilder.nativeapi
Article #11998Re: Paste
From: Remy Lebeau (TeamB)
Date: Sat, 03 Jan 2004 21:02
Date: Sat, 03 Jan 2004 21:02
19 lines
1852 bytes
1852 bytes
"Todd Brylski" <tbrylski@yahoo.com> wrote in message news:3ff70083@newsgroups.borland.com... > The code _does_ work. Only by a fluke in Notepad's particular design. The technically correct way is what I explained earlier - locate the actual Edit window directly and send it a WM_PASTE message instead of WM_COMMAND. Also, while you are at it, it would be better to use CreateProcess() or ShellExecuteEx() instead of WinExec(). That way, you can obtain the handle for the spawned process and pass that handle to WaitForInputIdle() to ensure that Notepad is actually initialized in full and ready to go before you paste to it. With WinExec(), you are in a race condition, hoping Notepad is ready by the time PostMessage() is called, which may or may not be the actual case all the time. Gambit
Technical Details
Message-ID:
<3ff72ca8$1@newsgroups.borland.com>Path:
arc1-ca.pugleaf.net!archiver1.google.com!news2.google.com!news.maxwell.syr.edu!newsfeed00.sul.t-online.de!t-online.de!203.109.252.33.MISMATCH!newsfeeds.ihug.co.nz!ihug.co.nz!newsgroups.borland.com!not-for-mailReferences:
<3ff5f6bc$2@newsgroups.borland.com> <3ff61911$1@newsgroups.borland.com> <3ff625ac$2@newsgroups.borland.com> <3ff70083@newsgroups.borland.com>Show Full Headers
Complete Article Headers
X-Google-Language: ENGLISH,ASCII-7-bit X-Google-Thread: 10cc67,fdb8783d5e192556 X-Google-Attributes: gid10cc67,public X-Google-ArrivalTime: 2004-01-03 13:00:46 PST From: "Remy Lebeau \(TeamB\)" <gambit47.no.spam@no.spam.yahoo.com> Newsgroups: borland.public.cppbuilder.nativeapi References: <3ff5f6bc$2@newsgroups.borland.com> <3ff61911$1@newsgroups.borland.com> <3ff625ac$2@newsgroups.borland.com> <3ff70083@newsgroups.borland.com> Subject: Re: Paste Date: Sat, 3 Jan 2004 13:02:56 -0800 Lines: 21 X-Priority: 3 X-MSMail-Priority: Normal X-Newsreader: Microsoft Outlook Express 6.00.2800.1158 X-MimeOLE: Produced By Microsoft MimeOLE V6.00.2800.1165 NNTP-Posting-Host: 67.22.139.199 Message-ID: <3ff72ca8$1@newsgroups.borland.com> X-Trace: newsgroups.borland.com 1073163432 67.22.139.199 (3 Jan 2004 12:57:12 -0700) Path: arc1-ca.pugleaf.net!archiver1.google.com!news2.google.com!news.maxwell.syr.edu!newsfeed00.sul.t-online.de!t-online.de!203.109.252.33.MISMATCH!newsfeeds.ihug.co.nz!ihug.co.nz!newsgroups.borland.com!not-for-mail