🚀 go-pugleaf

RetroBBS NetNews Server

Inspired by RockSolid Light RIP Retro Guy

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

Re: How to use traditional Windows message and API function ?

#687
From: Asger Joergensen
Date: Sat, 23 Feb 2008 11:35
31 lines
2373 bytes
Hi Luka
 
 Luka Gabri says:
> SendMessage works from my application using it's handle, but HWND_BROADCAST 
> for handle doesn't work in application nor from other applications. When I 
> try to Send something from DLL it works only when application is in focus, 
> if not in focus send message is not working. When I use a timer in app to 
> send a message to itself it works even if focus is not set on a form. I 
> think everything would work fine if this SendMessage would work with 
> HWND_BROADCAST! What is the problem with code below?
> 

I dont think You can use SendMesssage width HWND_BROADCAST,
SendMesssage does not return untill the message is handled
it is kind of like calling a function.

You have to use PostMessage instead that one returns right
avay and let the applications deal with the message in their
own time.

You shoould have a look at this thread:
http://tinyurl.com/23wrpe

By the way You dont need the MESSAGE keyword it is defined
as nothing, so whether You use it or not doesn't matter.

P.s. please trim Your qoutes.

Kind regards
Asger
Technical Details
Message-ID: <MPG.222a236399a1d5c7989a7a@newsgroups.borland.com>
Path: arc1-ca.pugleaf.net!g2news1.google.com!news4.google.com!proxad.net!feeder1-2.proxad.net!213.200.89.82.MISMATCH!tiscali!newsfeed1.ip.tiscali.net!newsfeed00.sul.t-online.de!newsfeed01.sul.t-online.de!t-online.de!newsgroups.borland.com!not-for-mail
References: <47b02ecf$1@newsgroups.borland.com> <MPG.221a525c60a3d10c989a5f@newsgroups.borland.com> <47b0d385$1@newsgroups.borland.com> <47b0d5c9$1@newsgroups.borland.com> <47be2fa2$1@newsgroups.borland.com> <47be52e0$1@newsgroups.borland.com> <47bf296d@newsgroups.borland.com> <47bf6340$1@newsgroups.borland.com> <47bf7c96$1@newsgroups.borland.com>

Show Full Headers
Complete Article Headers
X-Google-Thread: 10cc67,985e142ee2266c4
X-Google-Attributes: gid10cc67,public,usenet
X-Google-Language: ENGLISH,ASCII-7-bit
From: Asger Joergensen <junk@Asger-P.dk>
Newsgroups: borland.public.cppbuilder.nativeapi
Subject: Re: How to use traditional Windows message and API function ?
Date: Sat, 23 Feb 2008 12:35:20 +0100
Message-ID: <MPG.222a236399a1d5c7989a7a@newsgroups.borland.com>
References: <47b02ecf$1@newsgroups.borland.com> <MPG.221a525c60a3d10c989a5f@newsgroups.borland.com> <47b0d385$1@newsgroups.borland.com> <47b0d5c9$1@newsgroups.borland.com> <47be2fa2$1@newsgroups.borland.com> <47be52e0$1@newsgroups.borland.com> <47bf296d@newsgroups.borland.com> <47bf6340$1@newsgroups.borland.com> <47bf7c96$1@newsgroups.borland.com>
Organization: Asger-P
MIME-Version: 1.0
Content-Type: text/plain; charset="utf-8"
Content-Transfer-Encoding: 7bit
User-Agent: MicroPlanet-Gravity/2.70.2067
NNTP-Posting-Host: 83.73.220.89
X-Trace: newsgroups.borland.com 1203766517 83.73.220.89 (23 Feb 2008 03:35:17 -0700)
Lines: 32
Path: arc1-ca.pugleaf.net!g2news1.google.com!news4.google.com!proxad.net!feeder1-2.proxad.net!213.200.89.82.MISMATCH!tiscali!newsfeed1.ip.tiscali.net!newsfeed00.sul.t-online.de!newsfeed01.sul.t-online.de!t-online.de!newsgroups.borland.com!not-for-mail