Sign Up

Sign Up to our social questions and Answers Engine to ask questions, answer people’s questions, and connect with other people.

Have an account? Sign In

Have an account? Sign In Now

Sign In

Login to our social questions & Answers Engine to ask questions answer people’s questions & connect with other people.

Sign Up Here

Forgot Password?

Don't have account, Sign Up Here

Forgot Password

Lost your password? Please enter your email address. You will receive a link and will create a new password via email.

Have an account? Sign In Now

You must login to ask a question.

Forgot Password?

Need An Account, Sign Up Here

Please briefly explain why you feel this question should be reported.

Please briefly explain why you feel this answer should be reported.

Please briefly explain why you feel this user should be reported.

Sign InSign Up

The Archive Base

The Archive Base Logo The Archive Base Logo

The Archive Base Navigation

  • SEARCH
  • Home
  • About Us
  • Blog
  • Contact Us
Search
Ask A Question

Mobile menu

Close
Ask a Question
  • Home
  • Add group
  • Groups page
  • Feed
  • User Profile
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Buy Points
  • Users
  • Help
  • Buy Theme
  • SEARCH
Home/ Questions/Q 9164973
In Process

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: June 17, 20262026-06-17T14:48:31+00:00 2026-06-17T14:48:31+00:00

I am trying to launch an application on a hidden desktop but not getting

  • 0

I am trying to launch an application on a hidden desktop but not getting much progress and can’t find a detailed documentation on how what the desktops and window stations really are. Here’s my code with error handling removed (but beleive me it is there and is not catching any errors):

HWINSTA winSta = CreateWindowStation(_T("hiddenWinSta"), 0, 0, NULL);
SetProcessWindowStation(winSta);
HDESK desktop = CreateDesktop(_T("hiddenDesktop"), NULL, NULL, 0, DESKTOP_CREATEWINDOW, NULL);
OpenDesktop(_T("hiddenDesktop"), 0, TRUE, GENERIC_ALL);
SetThreadDesktop(desktop)

HWINSTA r = GetProcessWindowStation();
printf("winsta: %x %x\n", r, winSta);
HDESK curdesk = GetThreadDesktop(GetCurrentThreadId());
printf("desktop: %x %x\n", curdesk, desktop);

STARTUPINFO si;
PROCESS_INFORMATION pi;

ZeroMemory( &si, sizeof(si) );
si.cb = sizeof(si);
//si.lpDesktop = _T("hiddenDesktop");
ZeroMemory( &pi, sizeof(pi) );
TCHAR szCommand[MAX_PATH];
_sntprintf_s(szCommand, MAX_PATH, _T("%s"), _T("c:\\windows\\system32\\calc.exe"));
DWORD res = CreateProcess(NULL, szCommand, NULL, NULL, FALSE, 0, NULL, NULL, &si, &pi);

If I uncomment the si.lpDesktop line the process fails to start with the dreaded error 0x000142. If I comment si.lpDesktop process starts on the current desktop.
What am I doing wrong? Is it even possible to do what I want (i.e. launch a Windows GUI app completely invisible)?

  • 1 1 Answer
  • 0 Views
  • 0 Followers
  • 0
Share
  • Facebook
  • Report

Leave an answer
Cancel reply

You must login to add an answer.

Forgot Password?

Need An Account, Sign Up Here

1 Answer

  • Voted
  • Oldest
  • Recent
  • Random
  1. Editorial Team
    Editorial Team
    2026-06-17T14:48:32+00:00Added an answer on June 17, 2026 at 2:48 pm

    uncomment

    si.lpDesktop = _T("hiddenDesktop");
    

    comment

    // HWINSTA winSta = CreateWindowStation(_T("hiddenWinSta"), 0, 0, NULL);
    // SetProcessWindowStation(winSta);
    
    • 0
    • Reply
    • Share
      Share
      • Share on Facebook
      • Share on Twitter
      • Share on LinkedIn
      • Share on WhatsApp
      • Report

Sidebar

Related Questions

I'm trying to launch VB application from Java, but I'm getting runtime error: Exception
I am trying to launch my hello world application in emulator of android. But
I have signed every jar required by the application but when trying to launch,
I am trying to launch explorer programmatically from my .Net CF Window application. But
I'm trying to launch an application from c# code. Below is the code.. But
I'm trying to launch the Amazon Kindle app from my android application but based
Im trying to create an application launcher using vb.net. I'm trying to launch desktop
I'm trying to launch a JavaFx application from within a JavaFx application, but it
I am trying to launch an external application from within my Win32 application but
Here's the situation: I am trying to launch an application, but the location of

Explore

  • Home
  • Add group
  • Groups page
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Users
  • Help
  • SEARCH

Footer

© 2021 The Archive Base. All Rights Reserved
With Love by The Archive Base

Insert/edit link

Enter the destination URL

Or link to existing content

    No search term specified. Showing recent items. Search or use up and down arrow keys to select an item.