|
Prev: Is there a way to open a report in preview or report mode and have it be invisible?
Next: Pls Help on OLE Registration error
From: Stephen Lebans on 27 Jun 2008 23:20 Just glancing at your code, your check for validity of hWnd is incorrect. For NT or higher you follow this logic: If hWndChild <> 0 Then NT or higher you can get a negative value for the hWnd as it is now a full 32 bit value. -- HTH Stephen Lebans http://www.lebans.com Access Code, Tips and Tricks Please respond only to the newsgroups so everyone can benefit. "Salad" <oil(a)vinegar.com> wrote in message news:24ednSKmkLqKwvjVnZ2dnUVZ_rHinZ2d(a)earthlink.com... > Has IE gotten so complex you can't get the URL from IE? The code at > http://www.mvps.org/access/api/api0051.htm used to work. Now it returns > nothing. Is this due to having the IE/Yahoo/Google/WhateverElse toolbars? > > I've determined where it fails...at least for me....on the third If() > statement in function Refresh. Maybe MS has changed the value of > ComboBoxEx32 to some other value? > > Is there a way to get the URL from an IE window if you have the hWnd of > it? I've got the class and caption, no URL. > > Private Const mconIE_COMBOEx = "ComboBoxEx32" > > 'this works > If fIsNT() Then > hWndChild = apiFindWindowEx(hWnd, 0, _ > conIE_WORKERW, vbNullString) > Else > hWndChild = apiFindWindowEx(hWnd, 0, _ > mconIE_WORKERA, vbNullString) > End If > > 'this works > If hWndChild > 0 Then > ' Rebar is child of Worker window > hWndChild = apiFindWindowEx(hWndChild, 0, _ > mconIE_REBAR, vbNullString) > End If > > 'heres where it fails. It always returns 0 > If hWndChild > 0 Then > ' ComboboxEx is child of Rebar window > hWndChild = apiFindWindowEx(hWndChild, 0, _ > mconIE_COMBOEx, vbNullString) > End If > > 'since it's 0 now, it's ignored > If hWndChild > 0 Then > ' ComboBox is child of ComboBoxEx Window > hWndChild = apiFindWindowEx(hWndChild, 0, _ > mconIE_COMBO, vbNullString) > End If > > 'since it's 0 now, it's ignored > If hWndChild > 0 Then > ' Edit class is child of ComboBox window > hWndChild = apiFindWindowEx(hWndChild, 0, _ > mconIE_EDIT, vbNullString) > End If
From: Stephen Lebans on 29 Jun 2008 17:45
Check the Classnames for your version of Internet Explorer as they have probably changed in some fashion. Do you have Spy++ on your system? Or there is a WIndow Class viewer on the Access MVP site. -- HTH Stephen Lebans http://www.lebans.com Access Code, Tips and Tricks Please respond only to the newsgroups so everyone can benefit. "Salad" <oil(a)vinegar.com> wrote in message news:hOSdncE3K_xsbvrVnZ2dnUVZ_qDinZ2d(a)earthlink.com... > Stephen Lebans wrote: > >> Just glancing at your code, your check for validity of hWnd is incorrect. >> For NT or higher you follow this logic: >> >> If hWndChild <> 0 Then >> >> NT or higher you can get a negative value for the hWnd as it is now a >> full 32 bit value. > > Hi Stephen: > > The code at http://www.mvps.org/access/api/api0051.htm worked back in > 2005. It was part of my app. I noticed recently it no longer worked. > > I changed all references of "hWndChild > 0" to "hWndChild <> 0". That > didn't help because in the third if statement in procedure Refresh() > hWndChild gets set to zero. > > I'm thinking that perhaps MS has moved on and the code at the site hasn't > been upgraded and perhaps will never work without a major upgrade. > > I really would like to enumerate through open IE windows and present the > subject lines/Urls to the user to associate records with a specific URL. > |