🚀 go-pugleaf

RetroBBS NetNews Server

Inspired by RockSolid Light RIP Retro Guy

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

Re: AttachThreadInput

#3372
From: Remy Lebeau (TeamB)
Date: Wed, 05 Jul 2006 17:52
33 lines
2682 bytes
"Mark Guerrieri" <mguerrieri@no_spam_verizon.net> wrote in message
news:44abc321@newsgroups.borland.com...

> I'm not dealing with other desktops.  My OOP server is just an EXE
> that runs in the context of the logged in user.  I only put that code in
there
> for error checking, since I have no control of who or what calls into the
> server, or from where.  I just have a method that shows a modal "login"
> form and needs to force its way to the forground, but which fails when
> called from within an Shell Namespace Extension.  As you said, the API
> states you should not AttachThreadInput to a thread in another desktop
> or to a system thread.  I put the test for other desktops in for the sake
of
> completeness, and now I am looking for a check for a "system thread."

There isn't any way to check for that (that I know of anyway - and you are
not the first person to ask for this).

The best I can recommend is to re-write your code to not rely on
AttachThreadInput at all (even better if you stop trying to force your
window to the front at all, which MS does not want programs to do anyway).
Otherwise, write a second version of your function that does not use
AttachThreadInput(), and then have the Shell Extension call that one instead
of the original version, which you leave for normal applications to call.

Alternatively, have the server trigger an event when it wants to display the
popup dialog, and have the application assign a handler to that event.  This
way, normal programs and Shell Extensions can assign different handlers that
are better tailored to their respective restrictions.


Gambit
Technical Details
Message-ID: <44abfcea$1@newsgroups.borland.com>
Path: arc1-ca.pugleaf.net!g2news2.google.com!news4.google.com!news3.google.com!border1.nntp.dca.giganews.com!nntp.giganews.com!newsfeed00.sul.t-online.de!newsfeed01.sul.t-online.de!t-online.de!newsgroups.borland.com!not-for-mail
References: <44a95f6d$1@newsgroups.borland.com> <44a97313$1@newsgroups.borland.com> <44a97c05$1@newsgroups.borland.com> <44a98345$1@newsgroups.borland.com> <44abc321@newsgroups.borland.com>

Show Full Headers
Complete Article Headers
X-Google-Thread: 10cc67,c5eaab2d607d9547
X-Google-Attributes: gid10cc67,public
X-Google-Language: ENGLISH,ASCII-7-bit
From: "Remy Lebeau \(TeamB\)" <no.spam@no.spam.com>
Newsgroups: borland.public.cppbuilder.nativeapi
References: <44a95f6d$1@newsgroups.borland.com> <44a97313$1@newsgroups.borland.com> <44a97c05$1@newsgroups.borland.com> <44a98345$1@newsgroups.borland.com> <44abc321@newsgroups.borland.com>
Subject: Re: AttachThreadInput
Date: Wed, 5 Jul 2006 10:52:45 -0700
Lines: 35
X-Priority: 3
X-MSMail-Priority: Normal
X-Newsreader: Microsoft Outlook Express 6.00.2800.1409
X-MimeOLE: Produced By Microsoft MimeOLE V6.00.2800.1409
NNTP-Posting-Host: 68.69.17.41
Message-ID: <44abfcea$1@newsgroups.borland.com>
X-Trace: newsgroups.borland.com 1152122090 68.69.17.41 (5 Jul 2006 10:54:50 -0700)
Path: arc1-ca.pugleaf.net!g2news2.google.com!news4.google.com!news3.google.com!border1.nntp.dca.giganews.com!nntp.giganews.com!newsfeed00.sul.t-online.de!newsfeed01.sul.t-online.de!t-online.de!newsgroups.borland.com!not-for-mail