🚀 go-pugleaf

RetroBBS NetNews Server

Inspired by RockSolid Light RIP Retro Guy

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

Re: "use" menu item in another app?

#6366
From: Segal
Date: Fri, 20 May 2005 02:34
43 lines
2607 bytes
Remy Lebeau (TeamB) wrote:
> "Segal" <none@none.spam.sucks.balls> wrote in message
> news:428cea2d@newsgroups.borland.com...
>
>>    SendMessage(EditHwnd, WM_SETTEXT, (WPARAM)50,
>>       (LPARAM)SingleLine->Text.c_str());
>
> As I suspected, you are not simulating any typing at all.
>
> Also, why are you specifying a value for the WPARAM of the message?
> WM_SETTEXT doesn't use the WPARAM at all.
>
>> I just tried both
>>
>>    SendMessage(hwnd, WM_COMMAND, 0, 0);
>
> Make sure that you are sending WM_COMMAND to the dialog itself, not
> the button.  Also, you are not specifying BN_CLICKED at all.
>
>    WORD wID = GetDlgCtrlID(EditHwnd);
>    SendMessage(hwnd, WM_COMMAND, MAKEWPARAM(wID, BN_CLICKED), (LPARAM)
> EditHwnd);
>
>>    SendMessage(hwnd, BN_CLICKED, 0, 0);
>
> BN_CLICKED is not a standalone message. You must send it via
> WM_COMMAND.
>
>> before both of those calls and it still doesn't submit the box (as if
>> "OK" is clicked.)
>
> You are not sending the messages correctly to begin with, so it won't
> matter whether you enable the button or not.

Thank you very much for pointing out my mistakes. I'm trying to get more 
used ot working with the winapi.

Your code,

   SendMessage(hwnd, WM_COMMAND, MAKEWPARAM(wID, BN_CLICKED),
      (LPARAM) EditHwnd);

works perfectly. Thank you again. 
Technical Details
Message-ID: <428d4ca6@newsgroups.borland.com>
Path: arc1-ca.pugleaf.net!g2news1.google.com!news1.google.com!news2.google.com!proxad.net!gatel-ffm!gatel-ffm!194.25.134.126.MISMATCH!newsfeed01.sul.t-online.de!t-online.de!newsgroups.borland.com!not-for-mail
References: <4289b235@newsgroups.borland.com> <v54k81lu0gb49sp76ri3ecjhb37gfbcatq@4ax.com> <428a1917$3@newsgroups.borland.com> <o2ck8151hqea0h667513g8lh0h8149n6aq@4ax.com> <428c2e72@newsgroups.borland.com> <428c6ef5$1@newsgroups.borland.com> <428ccca8@newsgroups.borland.com> <428cdbec@newsgroups.borland.com> <428cea2d@newsgroups.borland.com> <428cfc24$1@newsgroups.borland.com>

Show Full Headers
Complete Article Headers
X-Google-Thread: 10cc67,de4107a245e3b3a8
X-Google-Attributes: gid10cc67,public
X-Google-Language: ENGLISH,ASCII-7-bit
From: "Segal" <none@none.spam.sucks.balls>
Newsgroups: borland.public.cppbuilder.nativeapi
References: <4289b235@newsgroups.borland.com> <v54k81lu0gb49sp76ri3ecjhb37gfbcatq@4ax.com> <428a1917$3@newsgroups.borland.com> <o2ck8151hqea0h667513g8lh0h8149n6aq@4ax.com> <428c2e72@newsgroups.borland.com> <428c6ef5$1@newsgroups.borland.com> <428ccca8@newsgroups.borland.com> <428cdbec@newsgroups.borland.com> <428cea2d@newsgroups.borland.com> <428cfc24$1@newsgroups.borland.com>
Subject: Re: "use" menu item in another app?
Date: Thu, 19 May 2005 19:34:02 -0700
Lines: 45
X-Priority: 3
X-MSMail-Priority: Normal
X-Newsreader: Microsoft Outlook Express 6.00.2900.2180
X-MimeOLE: Produced By Microsoft MimeOLE V6.00.2900.2180
X-RFC2646: Format=Flowed; Original
NNTP-Posting-Host: 66.234.219.101
Message-ID: <428d4ca6@newsgroups.borland.com>
X-Trace: newsgroups.borland.com 1116556454 66.234.219.101 (19 May 2005 19:34:14 -0700)
Path: arc1-ca.pugleaf.net!g2news1.google.com!news1.google.com!news2.google.com!proxad.net!gatel-ffm!gatel-ffm!194.25.134.126.MISMATCH!newsfeed01.sul.t-online.de!t-online.de!newsgroups.borland.com!not-for-mail