[Dev-C++] Windows CreateObject("InternetExplorer.Application") using c or c++
Open Source C & C++ IDE for Windows
Brought to you by:
claplace
|
From: jose i. c. <ji...@fr...> - 2004-04-08 05:31:09
|
Greetings!
Please cut and paste this piece of code to a file call test.js and
double-click on it (don't worry, it's not a virus) :
// -- begin file --
function GetIEWindow()
{
var Title = "DAE Log Report Creator - Get Values"; // Title of IE window
var intCount = 0; // Counter used during AppActivate
//Create reference to objIE. This will be used for
//the user messages. Also set IE display attributes
var objIE = WScript.CreateObject("InternetExplorer.Application");
objIE.Navigate("about:blank");
objIE.ToolBar = 0;
objIE.Menubar = 0;
objIE.StatusBar = 0;
objIE.Width = 850;
objIE.Height = 710;
objIE.Left = 10;
objIE.Top = 10;
//Set some formating
objIE.document.writeln ("<!doctype html public>");
objIE.document.writeln ("<head>");
objIE.document.writeln ("<title>" + Title + "</title>");
objIE.document.writeln ("<style type=\"text/css\">");
objIE.document.writeln
("body {text-align: left; font-family: courier; font-size: 9pt}");
objIE.document.writeln ("</style>");
objIE.document.writeln ("</head>");
objIE.document.bgColor = "ddffdd";
//Wait for IE to finish
while (objIE.busy) { Wscript.Sleep( 200); }
//Show IE
objIE.Visible = 1;
//Make IE the active window
while (!objShell.AppActivate(Title)) { WScript.Sleep(50); }
return(objIE);
}
var objShell = WScript.CreateObject("WScript.Shell");
var objFS = WScript.CreateObject("Scripting.FileSystemObject");
var ie = GetIEWindow();
ie.document.writeln("Hello World");
//-- end file --
Yes, I know this is not c or c++ :-), but I would like the do something like
this using c or c++. Yes, I know, this is scripting language, but are there
any libraries out there (or hacks) that I could use from c or c++ that could
simulate and use these Windows libraries:
var objShell = WScript.CreateObject("WScript.Shell");
var objFS = WScript.CreateObject("Scripting.FileSystemObject");
var objIE = WScript.CreateObject("InternetExplorer.Application");
Any help would be greatly appreciated. I know how to work-around this, very
ugly, but I rather have local c or c++ calls that could do this.
thanks,
josé
|