// - Connect the code to the IE browser window
// connie.cpp: Defines the entry point for the console application.//
#include "stdafx.h"
#pragma Warning (Disable: 4049) #pragma Warning (Disable: 4146)
// # import "shdocvw.dll" exclude ( "tagREADYSTATE") # import "shdocvw.dll" // # import "shdocvw.dll" rename_namespace ( "SHELL_WINDOW") // using namespace SHELL_WINDOW; #define SHELL_WINDOW SHDocVw
#import
#include
INT Main (int Argc, char * argv []) {cout << "--- Test ---" << endl; // - COM COINITIALIZE (NULL); Do {cout << "--- list all IE window --- "<< endl;
SHELL_WINDOW :: IShellWindowsPtr msp_SHWinds = NULL; HRESULT hr = msp_SHWinds.CreateInstance (__ uuidof (SHELL_WINDOW :: ShellWindows)); ". FAILED" if (! S_OK = hr || NULL == msp_SHWinds) {cout << << endl; break } Int count = 0; int count = msp_shwinds-> getCount (); for (int i = 0; i
sp_browser.release ();}} msp_shwinds.release ();