Solved

Executing WinExec from a Win32 windows service

Posted on 2008-10-07
1
419 Views
Last Modified: 2013-11-20
I have been encountering a querky bug when executing WinExec from my win32 windows service. I am attempting to open IE Explorer 6 with the following command,

retCode = ::WinExec(command.c_str(), SW_SHOWNORMAL);
// The variable command contains the following value = "C:\\Program Files\\Internet Explorer\\iexplore" https:\\x.x.x.x

...but when I execute this, it starts iexplore in the task manager, but no browser opens up. Anyone have any thoughts on this? Very Urgent!!
T
0
Comment
Question by:rronec1
1 Comment
 
LVL 3

Accepted Solution

by:
Naveen_R earned 500 total points
ID: 22665695
This is because your service dosent have desktop interactivity permission. Right click on the service in the serive console window, take properties of your service-> Take Log on tab. In this tab, you can find a check box called "Allow service to interact with desktop". Enbale that option and try again.

One more thing I need to mention is that, you should not use WinExec function. It is provided only for compatibility with 16-bit Windows. Better use ShellExecute() function or CreateProcess() function.
0

Featured Post

Find Ransomware Secrets With All-Source Analysis

Ransomware has become a major concern for organizations; its prevalence has grown due to past successes achieved by threat actors. While each ransomware variant is different, we’ve seen some common tactics and trends used among the authors of the malware.

Join & Write a Comment

Here is how to use MFC's automatic Radio Button handling in your dialog boxes and forms.  Beginner programmers usually start with a OnClick handler for each radio button and that's just not the right way to go.  MFC has a very cool system for handli…
Have you tried to learn about Unicode, UTF-8, and multibyte text encoding and all the articles are just too "academic" or too technical? This article aims to make the whole topic easy for just about anyone to understand.
This video will show you how to get GIT to work in Eclipse.   It will walk you through how to install the EGit plugin in eclipse and how to checkout an existing repository.
When you create an app prototype with Adobe XD, you can insert system screens -- sharing or Control Center, for example -- with just a few clicks. This video shows you how. You can take the full course on Experts Exchange at http://bit.ly/XDcourse.

708 members asked questions and received personalized solutions in the past 7 days.

Join the community of 500,000 technology professionals and ask your questions.

Join & Ask a Question

Need Help in Real-Time?

Connect with top rated Experts

15 Experts available now in Live!

Get 1:1 Help Now