473,411 Members | 2,031 Online
Bytes | Software Development & Data Engineering Community
Post Job

Home Posts Topics Members FAQ

Join Bytes to post your question to a community of 473,411 software developers and data experts.

Newby - very simple program that don't work

I have a couple of lines of a program that are making me mad.

My intention is to run Internet Explorer in background.

#include <windows.h>
#include <stdio.h>
int main ()
{
char* strFunct = "c:\\Progra~1\\Intern~1\\iexplore.exe";
WinExec(strFunct,SW_HIDE);
return 1;
}
I can see the process iexplore.exe running with Task Manager, but after
5 -10 minutes the process is halted by the system apparently without any
reason. Same thing using CreateProcess instead of WinExec.

The problem seems to be the use of SW_HIDE with iexplore, because using
instead SW_SHOW the process never stops.

Is there somebody that can help me ?
The program is running under Windows 2000, the compiler is Visual C++ 4.0
and Explorer 6.0.

Thank you very much.

Stefano
Oct 26 '07 #1
4 2595
Stefano wrote:
My intention is to run Internet Explorer in background.

#include <windows.h>
#include <stdio.h>
int main ()
{
char* strFunct = "c:\\Progra~1\\Intern~1\\iexplore.exe";
WinExec(strFunct,SW_HIDE);
return 1;
}
I can see the process iexplore.exe running with Task Manager, but after
5 -10 minutes the process is halted by the system apparently without any
reason. Same thing using CreateProcess instead of WinExec.
How did you compile it? I got this:
w.cpp:1:21: error: windows.h: No such file or directory
w.cpp: In function 'int main()':
w.cpp:6: error: 'SW_HIDE' was not declared in this scope
w.cpp:6: error: 'WinExec' was not declared in this scope
>
The problem seems to be the use of SW_HIDE with iexplore, because using
instead SW_SHOW the process never stops.
I haven't seen those so far.
Is there somebody that can help me ?
Maybe.
Oct 26 '07 #2
Stefano wrote:
>My intention is to run Internet Explorer in background.

#include <windows.h>
#include <stdio.h>
int main ()
{
char* strFunct = "c:\\Progra~1\\Intern~1\\iexplore.exe";
WinExec(strFunct,SW_HIDE);
return 1;
}
I can see the process iexplore.exe running with Task Manager, but after
5 -10 minutes the process is halted by the system apparently without any
reason. Same thing using CreateProcess instead of WinExec.

How did you compile it? I got this:
w.cpp:1:21: error: windows.h: No such file or directory
w.cpp: In function 'int main()':
w.cpp:6: error: 'SW_HIDE' was not declared in this scope
w.cpp:6: error: 'WinExec' was not declared in this scope
1) Open Microsoft Developer Studio
2) File -New -Text File
3) Paste the code
4) Save as w.cpp
5) Build -Rebuild All
6) The message appers: "The build command requires an active workplace.
Would you like to create a default project workplace ?" Select yes.
7) w.exe is compiled with 0 errors and 0 warnings.

>
>>
The problem seems to be the use of SW_HIDE with iexplore, because using
instead SW_SHOW the process never stops.

I haven't seen those so far.
See WinExec function http://msdn2.microsoft.com/en-us/library/ms687393.aspx
and nCmdShow paameters:
http://msdn2.microsoft.com/en-us/library/ms633548.aspx

>
>Is there somebody that can help me ?

Maybe.
Thank you.
Oct 26 '07 #3
On 2007-10-26 10:52, Stefano wrote:
I have a couple of lines of a program that are making me mad.

My intention is to run Internet Explorer in background.

#include <windows.h>
#include <stdio.h>
int main ()
{
char* strFunct = "c:\\Progra~1\\Intern~1\\iexplore.exe";
WinExec(strFunct,SW_HIDE);
return 1;
}
Sorry, Windows programming is off-topic in this group, try a win32
programming group instead.
The program is running under Windows 2000, the compiler is Visual C++ 4.0
and Explorer 6.0.
Are you sure you are using VC++ 4? Every now and then someone is using
VC++ 6 and the advice to them is usually to get something newer since
VC++ 6 is very old and buggy. VC++ 4 must be ancient by now, and it is
questionable how good it is at compiling C++ programs.

--
Erik Wikström
Oct 26 '07 #4
Sorry, Windows programming is off-topic in this group, try a win32
programming group instead.
Ok, I didn't know. Thank you.
>
--
Erik Wikström
Stefano
Oct 26 '07 #5

This thread has been closed and replies have been disabled. Please start a new discussion.

Similar topics

7
by: WindAndWaves | last post by:
Hi Gurus I am keen to make a search page on a website, but I have absolutely zero experience with PHP. I am going to hire an expert, but I thought that it may pay to try it a bit first myself...
9
by: Damien | last post by:
I have just built a simple stopwatch application, but when i f5 to get things goings i get this message, An unhandled exception of type 'System.ArithmeticException' occurred in...
1
by: dit | last post by:
I want to start something small, like a learning program. I've been looking and learning python for about 4 months; and I think that I have the basics under my belt... is it worth trying my own...
20
by: Jack Schitt | last post by:
I thought I was starting to get a handle on Access, until I tried doing something useful...now I'm stuck. I have a DB with two tables - to keep it simple I'll say that one is an Employee File...
9
by: robbie.carlton | last post by:
Hello! I've programmed in c a bit, but nothing very complicated. I've just come back to it after a long sojourn in the lands of functional programming and am completely stumped on a very simple...
0
by: Pietje puk | last post by:
Hello, Since im quite new to ASP.NET i wanted to ask you folks what the best way is to create a WebForm for modifying 1 field from a record. The manipulation of this field can be done by using...
4
by: Fred Nelson | last post by:
I have an applicatioin that I'm writing that uses a "case" file that contains over 350 columns and more may be added in the future. I would like to create a dataset with all the column names and...
5
by: alexrixhardson | last post by:
Hi guys, I am a newby in the C/C++ world, and I am beginning to work on a rather simple TCP/IP proxy application which must be able to handle large volume of data as quickly as possible. ...
6
by: mmckean917 | last post by:
I'm doing an intro to programming course. Struggling, but enjoying it. I am not asking for anyone to do the work for me, but I have spent (Honest) about 5 hours this morning (I get up early to do...
0
BarryA
by: BarryA | last post by:
What are the essential steps and strategies outlined in the Data Structures and Algorithms (DSA) roadmap for aspiring data scientists? How can individuals effectively utilize this roadmap to progress...
1
by: nemocccc | last post by:
hello, everyone, I want to develop a software for my android phone for daily needs, any suggestions?
1
by: Sonnysonu | last post by:
This is the data of csv file 1 2 3 1 2 3 1 2 3 1 2 3 2 3 2 3 3 the lengths should be different i have to store the data by column-wise with in the specific length. suppose the i have to...
0
by: Hystou | last post by:
There are some requirements for setting up RAID: 1. The motherboard and BIOS support RAID configuration. 2. The motherboard has 2 or more available SATA protocol SSD/HDD slots (including MSATA, M.2...
0
by: Hystou | last post by:
Most computers default to English, but sometimes we require a different language, especially when relocating. Forgot to request a specific language before your computer shipped? No problem! You can...
0
tracyyun
by: tracyyun | last post by:
Dear forum friends, With the development of smart home technology, a variety of wireless communication protocols have appeared on the market, such as Zigbee, Z-Wave, Wi-Fi, Bluetooth, etc. Each...
0
agi2029
by: agi2029 | last post by:
Let's talk about the concept of autonomous AI software engineers and no-code agents. These AIs are designed to manage the entire lifecycle of a software development project—planning, coding, testing,...
0
isladogs
by: isladogs | last post by:
The next Access Europe User Group meeting will be on Wednesday 1 May 2024 starting at 18:00 UK time (6PM UTC+1) and finishing by 19:30 (7.30PM). In this session, we are pleased to welcome a new...
0
by: conductexam | last post by:
I have .net C# application in which I am extracting data from word file and save it in database particularly. To store word all data as it is I am converting the whole word file firstly in HTML and...

By using Bytes.com and it's services, you agree to our Privacy Policy and Terms of Use.

To disable or enable advertisements and analytics tracking please visit the manage ads & tracking page.