Bonjours
Voici comment ouvrir Internet Explorer avec Ole
Code : Sélectionner tout - Visualiser dans une fenêtre à part
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
 
#include <utilcls.h> // <----- ne pas oublier
#include <ComObj.hpp> // <----- utile dans certains cas
// demarrer IE
 // Cree un objet unique non initialisé de la classe spécifiée
 // par le paramètre 'InternetExplorer.Application'
 try
  {
   vMSIEApp = Variant::GetActiveObject("InternetExplorer.Application");
  }
 catch(...)
  {
   vMSIEApp = Variant::CreateObject("InternetExplorer.Application");
  }
 //Rends l'application IE visible
 vMSIEApp.OlePropertySet("Visible", true);
 // permet d'attendre le chargement de la page
 while(vMSIEApp.OlePropertyGet("ReadyState") != READYSTATE_COMPLETE)
 
 //........ code
 
 //Fermer IE
 vMSIEApp.OleFunction("Quit");
 // on libere les Variants
 vMSIEApp = Unassigned;
Pour commencer voici comment appeler les proprietes:
Code : Sélectionner tout - Visualiser dans une fenêtre à part
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
 
- 31 - proprietes:
1 - AddressBar:
 vMSIEApp.OlePropertySet("AddressBar",true); 
 bool vEIValue = vMSIEApp.OlePropertyGet("AddressBar");
2 - Application:
 vMSIEApp = Variant::CreateObject("InternetExplorer.Application");
3 - Busy:
 bool vEIValue = vMSIEApp.OlePropertyGet("Busy");
4 - Container:
 Variant vEIValue = vMSIEApp.OlePropertyGet("Container");
5 - Document:
 Variant vEIValue = vMSIEApp.OlePropertyGet("Document");
6 - FullName:
 String vEIValue = vMSIEApp.OlePropertyGet("FullName");
7 - FullScreen:
 vMSIEApp.OlePropertySet("FullScreen","true"); 
 bool vEIValue = vMSIEApp.OlePropertyGet("FullScreen");
8 - Height:
 vMSIEApp.OlePropertySet("Height", 600); 
 int vEIValue = vMSIEApp.OlePropertyGet("Height");
9 - HWND:
 vEIValue = vMSIEApp.OlePropertyGet("HWND");
10 - Left:
 vMSIEApp.OlePropertySet("Left", 200); 
 int vEIValue = vMSIEApp.OlePropertyGet("Left");
11 - LocationName:
 String vEIValue = vMSIEApp.OlePropertyGet("LocationName");
12 - LocationURL:
 String vEIValue = vMSIEApp.OlePropertyGet("LocationURL");
13 - MenuBar:
 vMSIEApp.OlePropertySet("MenuBar", true); 
 bool vEIValue = vMSIEApp.OlePropertyGet("MenuBar");
14 - Name:
 String vEIValue = vMSIEApp.OlePropertyGet("Name");
15 - Offline:
 vMSIEApp.OlePropertySet("Offline", false);
  bool vEIValue = vMSIEApp.OlePropertyGet("Offline");
16 - Parent:
 String vEIValue = vMSIEApp.OlePropertyGet("Parent");
17 - Path:
 String vEIValue = vMSIEApp.OlePropertyGet("Path");
18 - ReadyState:
 bool vEIValue = vMSIEApp.OlePropertyGet("ReadyState", 0); // Values, 0, 1, 2, 3, 4
19 - RegisterAsBrowser:
 vMSIEApp.OlePropertySet("RegisterAsBrowser", true);
 bool vEIValue = vMSIEApp.OlePropertyGet("RegisterAsBrowser");
20 - RegisterAsDropTarget:
 vMSIEApp.OlePropertySet("RegisterAsDropTarget", true); 
 bool vEIValue = vMSIEApp.OlePropertyGet("RegisterAsDropTarget");
21 - Resizable:
 vMSIEApp.OlePropertySet("Resizable", true); 
 bool vEIValue = vMSIEApp.OlePropertyGet("Resizable");
22 - Silent:
 vMSIEApp.OlePropertySet("Silent", true); 
 bool vEIValue = vMSIEApp.OlePropertyGet("Silent");
23 - StatusBar:
 vMSIEApp.OlePropertySet("StatusBar", true);
 bool vEIValue = vMSIEApp.OlePropertyGet("StatusBar");
24 - StatusText:
 vMSIEApp.OlePropertySet("StatusText", true);
 bool vEIValue = vMSIEApp.OlePropertyGet("StatusText");
25 - TheaterMode:
 vMSIEApp.OlePropertySet("TheaterMode", true);
 bool vEIValue = vMSIEApp.OlePropertyGet("TheaterMode");
26 - ToolBar:
 vMSIEApp.OlePropertySet("ToolBar",false); 
 bool vEIValue = vMSIEApp.OlePropertyGet("ToolBar");
27 - Top:
 vMSIEApp.OlePropertySet("Top", 200); 
 int vEIValue = vMSIEApp.OlePropertyGet("Top");
28 - TopLevelContainer:
 bool vEIValue = vMSIEApp.OlePropertyGet("TopLevelContainer");
29 - Type:
 String vEIValue = vMSIEApp.OlePropertyGet("Type");
30 - Visible:
 vMSIEApp.OlePropertySet("Visible", false); 
 bool vEIValue = vMSIEApp.OlePropertyGet("Visible");
31 - Width:
 vMSIEApp.OlePropertySet("Width", 800);
 int vEIValue = vMSIEApp.OlePropertyGet("Width");
Pour plus de renseignement sur les proprietes voir l'aide en ligne BCB du " TCppWebBrowser "