🚀 go-pugleaf

RetroBBS NetNews Server

Inspired by RockSolid Light RIP Retro Guy

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

Re: Program lockup waiting for messages

#8196
From: Jeff
Date: Mon, 15 Nov 2004 16:20
41 lines
2407 bytes
Sure, here is one message being sent:
void __fastcall TfrmMain::btnStartClick(TObject *Sender)
{
    SendMessage(WinHandle, WM_STARTSCRIPT, 0, 0);
}

Here's how I get the handle:
void __fastcall TfrmMain::btnFindClick(TObject *Sender)
{
    WinHandle = FindWindow(0, lbeCaption->Text.c_str());

    if(!IsWindow(WinHandle))
        Application->MessageBox("Window not found","Error", MB_OK | 
MB_ICONERROR);
}

Here's the definition of the message:
#define WM_STARTSCRIPT          (WM_USER + 1000)

"Pete Fraser" <pete._no_spam_fraser@frasersoft.nospam.net> wrote in message 
news:4198d657@newsgroups.borland.com...
>I think we need some more information in order to help.
> A code snippet of the code doing the sending would be useful to start 
> with.
> Rgds Pete
>
> "Jeff" <Jeff@nospam.com> wrote in message 
> news:4198d4ba$1@newsgroups.borland.com...
>> I've got two programs, one that is a control program, and one that is the 
>> receiver program. In the control program I send user messages to the 
>> receiver. It then calls button click events.
>>
>> The problem I'm having is that the control program locks up after the 
>> first message is sent. Once the receiver program is done, the control 
>> program can continue. I've added calls to Application->ProcessMessages() 
>> in the receiver program, but that doesn't seem to help.
>>
>> Is the control program waiting for some kind of response message that I'm 
>> not handling?
>
> 
Technical Details
Message-ID: <4198d752$1@newsgroups.borland.com>
Path: arc1-ca.pugleaf.net!g2news1.google.com!news2.google.com!newsread.com!newsprint.newsread.com!logbridge.uoregon.edu!newsfeeds.ihug.co.nz!ihug.co.nz!newsgroups.borland.com!not-for-mail
References: <4198d4ba$1@newsgroups.borland.com> <4198d657@newsgroups.borland.com>

Show Full Headers
Complete Article Headers
X-Google-Thread: 10cc67,e97b309831fdfaaf
X-Google-Attributes: gid10cc67,public
X-Google-Language: ENGLISH,ASCII-7-bit
From: "Jeff" <Jeff@nospam.com>
Newsgroups: borland.public.cppbuilder.nativeapi
References: <4198d4ba$1@newsgroups.borland.com> <4198d657@newsgroups.borland.com>
Subject: Re: Program lockup waiting for messages
Date: Mon, 15 Nov 2004 09:20:43 -0700
Lines: 43
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; Response
NNTP-Posting-Host: 206.104.31.204
Message-ID: <4198d752$1@newsgroups.borland.com>
X-Trace: newsgroups.borland.com 1100535634 206.104.31.204 (15 Nov 2004 08:20:34 -0700)
Path: arc1-ca.pugleaf.net!g2news1.google.com!news2.google.com!newsread.com!newsprint.newsread.com!logbridge.uoregon.edu!newsfeeds.ihug.co.nz!ihug.co.nz!newsgroups.borland.com!not-for-mail