Bonjour je travaille avec Microsoft Visual C++ .Net 2003.
C'est un projet Win32.
J'ai besoin de savoir comment trouver l'adresse URL courante dans l'explorateur Windows (explorer.exe). Je sais comment trouver cet adresse URL courante avec Internet Explorer.

Je pense que l'explorateur Windows utilise Internet Explorer pour aller sur le Net?

J'ai essayer de remplacer "iexplore" par "explorer" dans la fonction DdeCreateStringHandle mais ça marche pas. Et j'ai rien trouvé à ce sujet sur internet.



Voici le code pour Internet Explorer.
Voici les 2 fonctions importantes. Oublier pas de mettre #include <ddeml.h>.

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
 
HDDEDATA WINAPI DdeCallBack (UINT type, UINT fmt,HCONV hconv, HSZ hsz1, HSZ hsz2, HDDEDATA hData, DWORD dwData1, DWORD dwData2)
{
   return (HDDEDATA) NULL;
}
 
 
// Pour obtenir l'adresse internet courante.
bool GetIEAddress(LPCTSTR HttpAddress)
{
   DWORD dwidInst = 0, Long;
 
   DdeInitialize (&dwidInst, DdeCallBack, APPCLASS_STANDARD | APPCMD_CLIENTONLY, 0ul);
 
   HSZ hszService = DdeCreateStringHandle (dwidInst, "iexplore", CP_WINANSI);	// pour internet explorer.
 
   HSZ hszTopic = DdeCreateStringHandle (dwidInst, "WWW_GetWindowInfo", CP_WINANSI);
   HSZ hszItem = DdeCreateStringHandle (dwidInst, "0xFFFFFFFF", CP_WINANSI);
   HCONV hConv = DdeConnect (dwidInst, hszService, hszTopic, NULL);
   DdeFreeStringHandle (dwidInst, hszService);
   DdeFreeStringHandle (dwidInst, hszTopic);
 
   HDDEDATA hRetVal = DdeClientTransaction (NULL, 0, hConv, hszItem, CF_TEXT, XTYP_REQUEST, 10000L, NULL);
 
   DdeFreeStringHandle(dwidInst, hszItem);
 
   if (hRetVal > 0)
   { 
      HttpAddress = (LPCTSTR) DdeAccessData(hRetVal, (LPDWORD)&Long);
      DdeUnaccessData(hRetVal); 
      DdeFreeDataHandle(hRetVal);
      DdeDisconnect(hConv);
      return true;
   }
 
   return false;
}
Merci pour votre aide.