Home | Contact Us | FAQ | Search & Site Map | Link to Us
Sign In | Join | Other 45 Sites in Network
Home
Discussion GroupsVB SyntaxEnterprise DevelopmentDatabase AccessControlsCOMWin APICrystal ReportDeploymentGeneralGeneral 2
Related Topics
VB.NET / ASP.NETMS SQL ServerMS AccessOther Database ProductsMore Topics ...

VB Forum / Win API / May 2008



Tip: Looking for answers? Try searching our database.

CreateProcessAsUser for creating processes without Vista UAC pop-u

Thread view: 
Enable EMail Alerts  Start New Thread
Thread rating: 
Ashish - 18 Apr 2008 09:37 GMT
I have been using CreateProcessAsUser for creating processes (e.g. notepad,
etc)
which works all fine on all Windows OS except in Vista, which gives me a UAC
pop-up before it opens the actual application.

Can anyone suggest me how to avoid this UAC popup while using
CreateProcessAsUser() API.

Many thanks in advance,
Regards,
Ashish
Kevin Provance - 19 Apr 2008 06:50 GMT
Could you show us the actual code you are using?  It would be helpful if I
could try it on my end first, and then maybe I could offer up some
suggestions.

- Kev

|I have been using CreateProcessAsUser for creating processes (e.g. notepad,
| etc)
[quoted text clipped - 7 lines]
| Regards,
| Ashish
Ashish - 08 May 2008 09:06 GMT
Hi Kevin,

Here is the sample program that I want to run on Vista

#define UNICODE
#define _WIN32_WINNT 0x0500
#include <userenv.h>
#include <windows.h>

void wmain(int argc, WCHAR *argv[])
{
    DWORD dwFlags=0;
   PROCESS_INFORMATION pi={0};
    STARTUPINFOW         si={0};
    SecureZeroMemory(&si, sizeof(STARTUPINFO));
   si.cb = sizeof(STARTUPINFO);
    dwFlags = CREATE_UNICODE_ENVIRONMENT;
    if(!CreateProcessWithLogonW(L"administrator", L"UJMO6506-2KS-5",
L"Test0000", LOGON_WITH_PROFILE, NULL, argv[1], dwFlags, NULL, NULL, &si,
&pi))
        printf("\nExecuted CreateProcess with error code=[%d]", GetLastError());
    else
        printf("The pid of the process=[0x%x]", pi.dwProcessId);
}

/* The argv[1] denotes the application we want to create, eg: notepad, calc,
mspaint, explorer, etc) */

Please suggest how should I avoid the UAC popup when the application kicks
off using this API. Disabling the UAC at the OS level is not an option for me.

Regards,
Ashish

> Could you show us the actual code you are using?  It would be helpful if I
> could try it on my end first, and then maybe I could offer up some
[quoted text clipped - 14 lines]
> | Regards,
> | Ashish
mayayana - 08 May 2008 13:35 GMT
Did you notice the name of this newsgroup?
"vb.winapi" Did you realize that you're working
with C++?

> Here is the sample program that I want to run on Vista
>
[quoted text clipped - 46 lines]
> > | Regards,
> > | Ashish
Ashish - 09 May 2008 10:02 GMT
>   Did you notice the name of this newsgroup?
> "vb.winapi" Did you realize that you're working
[quoted text clipped - 58 lines]
>
> - Show quoted text -

I saw a few discussion on the API I am talking about. (http://
groups.google.com/group/microsoft.public.vb.winapi/browse_thread/
thread/8da1762c4978a89e#)
So thought of putting it. You are sounding as if I did a crime, and
that too against you!
expvb - 08 May 2008 13:45 GMT
Interesting password :-)
 
Sign In
Join
My Latest Posts
My Monitored Threads
My Blog
My Photo Gallery
My Profile
My Homepage

Start New Thread
Enable EMail Alerts
Rate this Thread



©2009 Advenet LLC   Privacy Policy - Terms of Use
This website includes both content owned or controlled by Advenet as well as content owned or controlled by third parties.