🚀 go-pugleaf

RetroBBS NetNews Server

Inspired by RockSolid Light RIP Retro Guy

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

Re: using WTSGetActiveConsoleSessionId()

#456
From: Ed Mulroy [TeamB]
Date: Thu, 17 Apr 2008 15:50
42 lines
2381 bytes
From MSDN, http://msdn2.microsoft.com/en-us/library/aa383840.aspx, 
WTSQueryUserToken is in wtsapi32.dll  You need an import library for that 
dll.  BCB verision 6 is old and I think the wtsapi32.lib in the compiler's 
LIB\PSDK directory is out of date.

Screen capture:

=========================
C:\Program Files\Borland\CBuilder6\Lib
>implib -c wtsapi32.LIB  \windows\system32\wtsapi32.dll

Borland Implib Version 3.0.22 Copyright (c) 1991, 2000 Inprise Corporation

C:\Program Files\Borland\CBuilder6\Lib
>tlib /C wtsapi32.LIB , wtsapi32.LST
TLIB 4.5 Copyright (c) 1987, 1999 Inprise Corporation

C:\Program Files\Borland\CBuilder6\Lib
>grep WTSQueryUserToken wtsapi32.lst
File wtsapi32.lst:
WTSQueryUserToken       size = 0
        WTSQueryUserToken

C:\Program Files\Borland\CBuilder6\Lib
>
=========================

So make the import library and add it to the project.  Do not be reluctant 
to do this.  When you do this you are not adding something odd and not 
maintainable.  You are adding an item which is from Windows itself.  Heck, 
even the MSDN docs say to use that import library.

.  Ed

> Mike Collins wrote in message
> news:48074fc0@newsgroups.borland.com...
>
> Just to follow up, I can't use WTSQueryUserToken either.  I've included 
> the WtsApi32 header but now it's complaining about unresolved external 
> WTSQueryUserToken.
>
> Again, any ideas or pointers would be helpful...
Technical Details
Message-ID: <480771c5$1@newsgroups.borland.com>
Path: arc1-ca.pugleaf.net!g2news1.google.com!news3.google.com!feeder.news-service.com!news.isoc.lu!newsgroups.borland.com!not-for-mail
References: <48074a72@newsgroups.borland.com> <48074fc0@newsgroups.borland.com>

Show Full Headers
Complete Article Headers
X-Google-Thread: 10cc67,61b1edc79d66af39
X-Google-Attributes: gid10cc67,domainid0,public,usenet
X-Google-Language: ENGLISH,ASCII-7-bit
From: "Ed Mulroy [TeamB]" <dont_email_me@bitbuc.ket>
Newsgroups: borland.public.cppbuilder.nativeapi
References: <48074a72@newsgroups.borland.com> <48074fc0@newsgroups.borland.com>
Subject: Re: using WTSGetActiveConsoleSessionId()
Date: Thu, 17 Apr 2008 11:50:26 -0400
Lines: 44
X-Priority: 3
X-MSMail-Priority: Normal
X-Newsreader: Microsoft Outlook Express 6.00.2900.3138
X-MimeOLE: Produced By Microsoft MimeOLE V6.00.2900.3198
X-RFC2646: Format=Flowed; Response
NNTP-Posting-Host: 71.77.48.179
Message-ID: <480771c5$1@newsgroups.borland.com>
X-Trace: newsgroups.borland.com 1208447429 71.77.48.179 (17 Apr 2008 08:50:29 -0700)
X-Authenticated-User: edmulroy
Path: arc1-ca.pugleaf.net!g2news1.google.com!news3.google.com!feeder.news-service.com!news.isoc.lu!newsgroups.borland.com!not-for-mail