🚀 go-pugleaf

RetroBBS NetNews Server

Inspired by RockSolid Light RIP Retro Guy

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

Re: Switch App to new Desktop

#11478
From: Remy Lebeau (TeamB)
Date: Thu, 05 Feb 2004 18:38
27 lines
1794 bytes
"zegi" <zegi@morphochem.de> wrote in message
news:402227d5@newsgroups.borland.com...

> ThisWinStation=CreateWindowStation(WinStationName,NULL,dwAccessAll,NULL);

Is your program running under an admin account at the time?  Only admins are
allowed to specify a window station's name.  Otherwise, you must use NULL
instead to have the system generate a name based on the user's login
session.

> SetThreadDesktop(ThisDesktop);
> SwitchDesktop(ThisDesktop);
> SetProcessWindowStation(ThisWinStation);

You should be calling SetProcessWindowStation() before you call
SetThreadDesktop(), not afterwards.

    SetProcessWindowStation(ThisWinStation);
    SetThreadDesktop(ThisDesktop);
    SwitchDesktop(ThisDesktop);

You are also not checking any of the return values of any of the functions.
You need to do that so that you can detect errors.


Gambit
Technical Details
Message-ID: <40228bde$1@newsgroups.borland.com>
Path: arc1-ca.pugleaf.net!archiver1.google.com!news2.google.com!news.maxwell.syr.edu!newsfeed00.sul.t-online.de!newsfeed01.sul.t-online.de!t-online.de!newsgroups.borland.com!not-for-mail
References: <402227d5@newsgroups.borland.com>

Show Full Headers
Complete Article Headers
X-Google-Language: ENGLISH,ASCII-7-bit
X-Google-Thread: 10cc67,21fd6f1b829e761b
X-Google-Attributes: gid10cc67,public
X-Google-ArrivalTime: 2004-02-05 10:40:28 PST
From: "Remy Lebeau \(TeamB\)" <gambit47.no.spam@no.spam.yahoo.com>
Newsgroups: borland.public.cppbuilder.nativeapi
References: <402227d5@newsgroups.borland.com>
Subject: Re: Switch App to new Desktop
Date: Thu, 5 Feb 2004 10:38:12 -0800
Lines: 29
X-Priority: 3
X-MSMail-Priority: Normal
X-Newsreader: Microsoft Outlook Express 6.00.2800.1158
X-MimeOLE: Produced By Microsoft MimeOLE V6.00.2800.1165
NNTP-Posting-Host: 67.22.138.253
Message-ID: <40228bde$1@newsgroups.borland.com>
X-Trace: newsgroups.borland.com 1076005854 67.22.138.253 (5 Feb 2004 10:30:54 -0800)
Path: arc1-ca.pugleaf.net!archiver1.google.com!news2.google.com!news.maxwell.syr.edu!newsfeed00.sul.t-online.de!newsfeed01.sul.t-online.de!t-online.de!newsgroups.borland.com!not-for-mail