Jump to content

Run a process on a different desktop possibel ?


FeReNGi
 Share

Recommended Posts

I was looking if it is possible to run a program on a different desktop like the winlogon runs in the winlogon-desktop, the screensaver in the screensaver-desktop and all other programs runs int the windows-desktop.

This way the user don't have access to the windows system until the program has finished.

Why i need this ? Because i have to run the program in admin content after a reboot.

in program code c++ it would something like this :

// Save original desktop
  hOriginalThread = GetThreadDesktop(GetCurrentThreadId());
  hOriginalInput = OpenInputDesktop(0, FALSE, DESKTOP_SWITCHDESKTOP);

  // Create a new Desktop and switch to it
  hNewDesktop = CreateDesktop("NewDesktopName", NULL, NULL, 0, GENERIC_ALL, NULL);
  SetThreadDesktop(hNewDesktop);
  SwitchDesktop(hNewDesktop);

  // Execute thread/process in the new desktop
  StartThread();
  StartProcess();

  // Restore original desktop
  SwitchDesktop(hOriginalInput);
  SetThreadDesktop(hOriginalThread);

  // Close the Desktop
  CloseDesktop(hNewDesktop);

Any help would be welcome...

Link to comment
Share on other sites

Not sure if I follow you there but can't you just lock it?

Edited by Uten
Link to comment
Share on other sites

@uten

No that is not what i am looking for.

When the programs run in admin content i don't want a user to mess arround with the system because an administrator is logged on for installation of the software. Therefore i have to disable some functionality of windows

i know i could block keyboard and mouse but then i have to reboot again

Link to comment
Share on other sites

Create an account or sign in to comment

You need to be a member in order to leave a comment

Create an account

Sign up for a new account in our community. It's easy!

Register a new account

Sign in

Already have an account? Sign in here.

Sign In Now
 Share

  • Recently Browsing   0 members

    • No registered users viewing this page.
×
×
  • Create New...