Prev: Changing removable disk label
Next: FileName from HWND
From: J French on 21 Apr 2006 10:16 On Fri, 21 Apr 2006 13:39:42 GMT, "mayayana" <mayayanaXX1a(a)mindXXspring.com> wrote: He is new as hell - otherwise he would not be rude to old c*nts Mostly, I reckon he'll get an answer - we tend to chew on problems Oddly, I like miscreants who work out well They tend to get 'smart'
From: Grzegorz on 21 Apr 2006 14:13 J French wrote: > Have you waved my Window From Point sniffer over the Firefox URL > dropdown Edit > > I don't really want to install FireFox myself Frankly, I'm not burning with the desire to install Visual Basic for that. :) -- 677265676F727940346E6575726F6E732E636F6D
From: Grzegorz on 21 Apr 2006 16:48 mayayana wrote: > > The OP had already made clear that he wanted a Windows > approach, not a Mozilla approach. Maybe he hasn't thought it > through, but I didn't see any reason to assume that. It just > made sense to me that he's programming in Windows...he > wants a window property...he shouldn't have to get into some > 3rd-party API - and support files - to get that. This is your subjective perception, as you admited yourself. And I believe your perception misleads you here. The OP didn't say nor "made clear" in any way he want to use some specific approach. He wrote "He can't" use approach suggested by lallous, because he "can't install anything on the PC". That's entire difference. If he really said he didn't want to install anything because trashing a system with third party components is a bad idea (and he would be right) the discussion would be over. Alf simply questioned inability of installing anything on a PC. Such inability is quite unusual thing and the OP didn't provide any reason for that. The form he used perhaps wasn't very fortunate but I wouldn't take it as rude. Nor, presumably, would anyone at comp.os.ms-windows.programmer.win32 where Alf is well known and respected contributor. But I can try to imagine how it could be received by someone at comp.lang.basic.visual.misc who saw his post for the first time. Still it's not the reason for giving him more rude responces nor even starting this off-topic conversation I made the mistake getting involved into. But that's my last off-topic reply in this thread. >Signature or not, he put it into his post. I really don't know how to comment on this. I was certain you simply didn't notice it's a signature, otherwise you wouldn't comment it. -- 677265676F727940346E6575726F6E732E636F6D
From: mayayana on 22 Apr 2006 09:50 I got to playing around with the Active Accessibility approach. I don't know whether this is really a usable solution, but it's interesting. This is VB6 code. I guess it's about the same for VB5. This code would need some adjustments for your purpose, but this shows it can be done, at least. As for AA, it's in Windows at least as far back as Win98, but I'm not certain that it's always installed by default. ---------------------------------------------- Set the following code if a form named "F1": Private Sub bHook_Click() Hook End Sub Private Sub bUnhook_Click() UnHook End Sub Place 2 buttons, as named above, with captions "hook" and "unhook". Place a textbox named "Text1" ----------------------------------- In a module add this code (Reference to Accessibility needed in Project -> References. Lib. is oleacc.dll. Set "Show hidden Objects" in object browser if you want intellisense.) Public Const EVENT_MIN = 1& Private Const ROLE_COMBOBOX = &H2E& Private Const OB_ACCELERATORCHANGE = &H8012& Private Const SYS_ALERT = 2& Public Const WINEVENT_SKIPOWNPROCESS = 2& Public Const OB_REORDER = &H8004& Private Declare Function SetWinEventHook Lib "user32.dll" (ByVal eventMin As Long, ByVal eventMax As Long, ByVal hmodWinEventProc As Long, ByVal pfnWinEventProc As Long, ByVal idProcess As Long, ByVal idThread As Long, ByVal dwFlags As Long) As Long Private Declare Function UnhookWinEvent Lib "user32.dll" (ByVal lHandle As Long) As Long Private Declare Function AccessibleObjectFromEvent Lib "oleacc" (ByVal HWnd As Long, ByVal dwId As Long, ByVal dwChildId As Long, ppacc As IAccessible, pvarChild As Variant) As Long Private LHook As Long Public Sub Hook() Dim LRet As Long LHook = SetWinEventHook(SYS_ALERT, OB_ACCELERATORCHANGE, 0&, AddressOf WinEventFunc, 0, 0, WINEVENT_SKIPOWNPROCESS) End Sub Public Sub UnHook() Dim LRet As Long If LHook = 0 Then Exit Sub LRet = UnhookWinEvent(LHook) End Sub Public Function WinEventFunc(ByVal HookHandle As Long, ByVal LEvent As Long, ByVal HWnd As Long, ByVal idObject As Long, ByVal idChild As Long, ByVal idEventThread As Long, ByVal dwmsEventTime As Long) As Long Dim ObA As IAccessible Dim LRet As Long Dim V As Variant Dim s As String, s1 As String, sName As String On Error Resume Next Select Case LEvent Case OB_REORDER LRet = AccessibleObjectFromEvent(HWnd, idObject, idChild, ObA, V) If LRet = 0 Then F1.Text1.Text = "--" If CLng(ObA.accRole(V)) = 46 Then '-- combobox. If ObA.accName(V) = "Location" Then F1.Text1.Text = ObA.accValue(V) End If End If End If End Select WinEventFunc = 0 End Function ------------------------------- Open Firefox, run the project, click "Hook". Edit the Firefox location bar. You should see the text in Text1 keep up with any changes you make in Firefox's location bar.
From: Learner on 24 Apr 2006 23:30
"mayayana" <mayayanaXX1a(a)mindXXspring.com> wrote in message news:Mwq2g.7665$sq5.4305(a)newsread2.news.atl.earthlink.net... > I got to playing around with the Active Accessibility > approach. I don't know whether this is really a usable > solution, but it's interesting. This is VB6 code. I guess > it's about the same for VB5. > This code would need some adjustments for your > purpose, but this shows it can be done, at least. > > As for AA, it's in Windows at least as far back as > Win98, but I'm not certain that it's always installed > by default. > > ---------------------------------------------- > Set the following code if a form named "F1": > > Private Sub bHook_Click() > Hook > End Sub > > Private Sub bUnhook_Click() > UnHook > End Sub > > Place 2 buttons, as named above, with captions "hook" and > "unhook". > > Place a textbox named "Text1" > ----------------------------------- > > In a module add this code (Reference to Accessibility needed in > Project -> References. Lib. is oleacc.dll. Set "Show hidden > Objects" in object browser if you want intellisense.) > > Public Const EVENT_MIN = 1& > Private Const ROLE_COMBOBOX = &H2E& > Private Const OB_ACCELERATORCHANGE = &H8012& > Private Const SYS_ALERT = 2& > Public Const WINEVENT_SKIPOWNPROCESS = 2& > Public Const OB_REORDER = &H8004& > > Private Declare Function SetWinEventHook Lib "user32.dll" (ByVal eventMin As > Long, ByVal eventMax As Long, ByVal hmodWinEventProc As Long, ByVal > pfnWinEventProc As Long, ByVal idProcess As Long, ByVal idThread As Long, > ByVal dwFlags As Long) As Long > Private Declare Function UnhookWinEvent Lib "user32.dll" (ByVal lHandle As > Long) As Long > Private Declare Function AccessibleObjectFromEvent Lib "oleacc" (ByVal HWnd > As Long, ByVal dwId As Long, ByVal dwChildId As Long, ppacc As IAccessible, > pvarChild As Variant) As Long > > Private LHook As Long > > Public Sub Hook() > Dim LRet As Long > LHook = SetWinEventHook(SYS_ALERT, OB_ACCELERATORCHANGE, 0&, AddressOf > WinEventFunc, 0, 0, WINEVENT_SKIPOWNPROCESS) > End Sub > > Public Sub UnHook() > Dim LRet As Long > If LHook = 0 Then Exit Sub > LRet = UnhookWinEvent(LHook) > End Sub > > Public Function WinEventFunc(ByVal HookHandle As Long, ByVal LEvent As Long, > ByVal HWnd As Long, ByVal idObject As Long, ByVal idChild As Long, ByVal > idEventThread As Long, ByVal dwmsEventTime As Long) As Long > Dim ObA As IAccessible > Dim LRet As Long > Dim V As Variant > Dim s As String, s1 As String, sName As String > On Error Resume Next > > Select Case LEvent > > Case OB_REORDER > LRet = AccessibleObjectFromEvent(HWnd, idObject, idChild, ObA, V) > > If LRet = 0 Then > F1.Text1.Text = "--" > If CLng(ObA.accRole(V)) = 46 Then '-- combobox. > If ObA.accName(V) = "Location" Then > F1.Text1.Text = ObA.accValue(V) > End If > End If > End If > > End Select > WinEventFunc = 0 > End Function > > ------------------------------- > > Open Firefox, run the project, click "Hook". > Edit the Firefox location bar. > You should see the text in Text1 keep up > with any changes you make in Firefox's > location bar. Thanks, I'll give it a go. Looks like it may be what I'm after! :) |