Article View: borland.public.cppbuilder.nativeapi
Article #8447Re: Writing to Clipboard from a service
From: nicolasr
Date: Sun, 24 Oct 2004 01:36
Date: Sun, 24 Oct 2004 01:36
27 lines
2107 bytes
2107 bytes
> Your service is not running in the same workstation as the user. You need
> to attach to the user's workstation before you can manipulate it. Look at
> the OpenWindowStation(), OpenDesktop(), SetProcessWindowStation() and
> SetThreadDesktop() functions.
thanks for the hint. I connect to WinSta0/Default as documented in MSDN
and it works now.
However, I now have a different problem. Maybe you have an idea.
Since copying to the clipboard now works I tried to test this in my
"Mini"-LAN consisting of XP and Win98. Win98 writes the local clipboard
content to the XP services mailslot and the service puts it in its local
clipboard.
But opening the mailslot on Win98 does not work. I can call CreateFile with
any IP (even invalid) I want but it never returns an error, instead the
return value is always 16.
This is the call:
client = CreateFile("\\\\SomeInvalidIp\\mailslot\\MyMailslot",
GENERIC_WRITE,
FILE_SHARE_READ, NULL, OPEN_EXISTING,
FILE_ATTRIBUTE_NORMAL, NULL);
Do you know of any issues with Win98 and mailslots?
thanks for the help,
Nick
Technical Details
Message-ID:
<417b0728$1@newsgroups.borland.com>Path:
arc1-ca.pugleaf.net!g2news1.google.com!news2.google.com!proxad.net!news.tele.dk!news.tele.dk!small.news.tele.dk!newsfeed00.sul.t-online.de!newsfeed01.sul.t-online.de!t-online.de!newsgroups.borland.com!not-for-mailReferences:
<4179a85e$1@newsgroups.borland.com> <417ab43b$1@newsgroups.borland.com>Show Full Headers
Complete Article Headers
X-Google-Thread: 10cc67,f2ddb07f5aa054ba X-Google-Attributes: gid10cc67,public X-Google-Language: ENGLISH,ASCII-7-bit From: "nicolasr" <nicolasrNOSPAMATSIGNgmx.net> Newsgroups: borland.public.cppbuilder.nativeapi References: <4179a85e$1@newsgroups.borland.com> <417ab43b$1@newsgroups.borland.com> Subject: Re: Writing to Clipboard from a service Date: Sun, 24 Oct 2004 03:36:39 +0200 Lines: 29 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: 80.133.188.29 Message-ID: <417b0728$1@newsgroups.borland.com> X-Trace: newsgroups.borland.com 1098581800 80.133.188.29 (23 Oct 2004 18:36:40 -0700) Path: arc1-ca.pugleaf.net!g2news1.google.com!news2.google.com!proxad.net!news.tele.dk!news.tele.dk!small.news.tele.dk!newsfeed00.sul.t-online.de!newsfeed01.sul.t-online.de!t-online.de!newsgroups.borland.com!not-for-mail