Article View: borland.public.cppbuilder.nativeapi
Article #9537Re: FindWindow in different session in XP
From: Alan Bellingham
Date: Wed, 30 Jun 2004 14:29
Date: Wed, 30 Jun 2004 14:29
35 lines
2786 bytes
2786 bytes
"Eugene Mayevski [SecureBlackbox]" <mayevski@eldos.org> wrote: >Not just easily, but extremely easily. Part of this shared block becomes >a common variable which is accessed and changed using >InterlockedIncrement() and similar APIs. The rest is used for data >exchange. And you don't need mutexes and WaitFor* to do the exchange. Ah, so you're layering something on top, and looking for it to change. An analogy. Let's suppose I have a friend, but he and I must never be seen together. (We're different processes running under Win32.) But we do both have the keys to a lock-up storage unit. (We both can see the same shared memory.) Now I want him to give me a steamer trunk full of stuff. I could go down to the storage unit every day, and see if he's put it there yet. If it's not there, I chalk a note inside the door, and hope he looks soon. (We both look at the common variable.) On the other hand, I could ring him on his mobile phone and get him to put it there at once. The communication side of things is akin to ringing his mobile. It would use something like a named pipe, and should be much more efficient, since the thread receiving the message wouldn't spend its entire time locking and unlocking the same variable just to see if it had changed. (I assume by the way that you meant InterlockedIncrementAcquire, since InterlockedIncrement itself doesn't not mention cross-process locking.) Alan Bellingham -- ACCU Conference 2005 - 20-23 April, Randolph Hotel, Oxford, UK
Technical Details
Message-ID:
<q9i5e0dvdu5glp9cn52mrfkdurjl74so4d@4ax.com>Path:
arc1-ca.pugleaf.net!g2news1.google.com!news1.google.com!news.glorb.com!logbridge.uoregon.edu!arclight.uoregon.edu!wn14feed!worldnet.att.net!204.71.34.3!newsfeed.cwix.com!newsfeed.frii.net!newsfeed.frii.net!news.compaq.com!newsfeeds.ihug.co.nz!ihug.co.nz!newsgroups.borland.com!not-for-mailReferences:
<40DC8965.698A31F6@tomtec.com> <40dc945c$2@newsgroups.borland.com> <40E01817.DAEBAD67@tomtec.com> <40e0519c@newsgroups.borland.com> <40E05E24.A503C53A@tomtec.com> <40e06df1@newsgroups.borland.com> <40e16448@newsgroups.borland.com> <40e1a5af$1@newsgroups.borland.com> <40e29d4b@newsgroups.borland.com>Show Full Headers
Complete Article Headers
X-Google-Thread: 10cc67,21a49dd150875d21 X-Google-Attributes: gid10cc67,public X-Google-Language: ENGLISH,ASCII-7-bit From: Alan Bellingham <alanb@episys.com> Newsgroups: borland.public.cppbuilder.nativeapi Subject: Re: FindWindow in different session in XP Date: Wed, 30 Jun 2004 15:29:02 +0100 Reply-To: alanb@episys.com Message-ID: <q9i5e0dvdu5glp9cn52mrfkdurjl74so4d@4ax.com> References: <40DC8965.698A31F6@tomtec.com> <40dc945c$2@newsgroups.borland.com> <40E01817.DAEBAD67@tomtec.com> <40e0519c@newsgroups.borland.com> <40E05E24.A503C53A@tomtec.com> <40e06df1@newsgroups.borland.com> <40e16448@newsgroups.borland.com> <40e1a5af$1@newsgroups.borland.com> <40e29d4b@newsgroups.borland.com> X-Newsreader: Forte Agent 2.0/32.646 MIME-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Transfer-Encoding: 7bit NNTP-Posting-Host: 193.129.251.130 X-Trace: newsgroups.borland.com 1088605741 193.129.251.130 (30 Jun 2004 07:29:01 -0700) Lines: 35 Path: arc1-ca.pugleaf.net!g2news1.google.com!news1.google.com!news.glorb.com!logbridge.uoregon.edu!arclight.uoregon.edu!wn14feed!worldnet.att.net!204.71.34.3!newsfeed.cwix.com!newsfeed.frii.net!newsfeed.frii.net!news.compaq.com!newsfeeds.ihug.co.nz!ihug.co.nz!newsgroups.borland.com!not-for-mail