Solved

Executing WinExec from a Win32 windows service

Posted on 2008-10-07
1
463 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

Free Tool: Port Scanner

Check which ports are open to the outside world. Helps make sure that your firewall rules are working as intended.

One of a set of tools we are providing to everyone as a way of saying thank you for being a part of the community.

Question has a verified solution.

If you are experiencing a similar issue, please ask a related question

Suggested Solutions

Introduction: Ownerdraw of the grid button.  A singleton class implentation and usage. Continuing from the fifth article about sudoku.   Open the project in visual studio. Go to the class view – CGridButton should be visible as a class.  R…
Introduction: The undo support, implementing a stack. Continuing from the eigth article about sudoku.   We need a mechanism to keep track of the digits entered so as to implement an undo mechanism.  This should be a ‘Last In First Out’ collec…
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.
Email security requires an ever evolving service that stays up to date with counter-evolving threats. The Email Laundry perform Research and Development to ensure their email security service evolves faster than cyber criminals. We apply our Threat…

685 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