Click here to Skip to main content
13,344,765 members (52,747 online)
Click here to Skip to main content
Add your own
alternative version


13 bookmarked
Posted 20 Aug 2007


, 20 Aug 2007
Rate this:
Please Sign up or sign in to vote.
Interacting with the service


This article describes about communicating with the service with elevating and without elevating on Vista.I have taken use of named events for creating the same.


Showing the UI through service is really a big task as sending messages across the sessions have been banned on vista.

Using the Demo Project

1. Copy the MessageBox folder to the c:\ drive

2. Copy all the binaries in one folder .Install the service using Vista_UAC_Service.exe install

3. Use Vista_XP_Compatible.exe for testing the UI which is a created process through the service.

Blocks of code should be set as style "Formatted" like this:

// Any source code blocks look like this
// Giving permissions for all users for the objects has been given at msdn
    <a href="">
    TCHAR</a> * szSD = TEXT("D:")       // Discretionary ACL
        TEXT("(A;OICI;GA;;;BG)")     // Allow access to 
                                     // built-in guests
        TEXT("(A;OICI;GA;;;AN)")     // Allow access to 
                                     // anonymous logon
        TEXT("(A;OICI;GRGWGX;;;AU)") // Allow 
                                     // read/write/execute 
                                     // to authenticated 
                                     // users
        TEXT("(A;OICI;GA;;;BA)");    // Allow full control 
                                     // to administrators
For getting the session ids in the session 0


for(int i=0;i<dwNos;i++)


if(wsi[i].State == WTSActive)


dwSessionId= wsi[i].SessionId;


Use createprocessasuser for creating the process

bool bRet = ::CreateProcessAsUser( Token, L"c:\\Messagebox\\MessageBox.exe", NULL, NULL, NULL, FALSE,


&startupInfo, &processInfo);


This article has no explicit license attached to it but may contain usage terms in the article text or the download files themselves. If in doubt please contact the author via the discussion board below.

A list of licenses authors might use can be found here


About the Author

Mahantesh Ganamukhi
Web Developer
India India
No Biography provided

You may also be interested in...

Comments and Discussions

GeneralSource Code Pin
SF12345-Sep-07 9:11
memberSF12345-Sep-07 9:11 

General General    News News    Suggestion Suggestion    Question Question    Bug Bug    Answer Answer    Joke Joke    Praise Praise    Rant Rant    Admin Admin   

Use Ctrl+Left/Right to switch messages, Ctrl+Up/Down to switch threads, Ctrl+Shift+Left/Right to switch pages.

Permalink | Advertise | Privacy | Terms of Use | Mobile
Web04 | 2.8.180111.1 | Last Updated 21 Aug 2007
Article Copyright 2007 by Mahantesh Ganamukhi
Everything else Copyright © CodeProject, 1999-2018
Layout: fixed | fluid