[lnkForumImage]
TotalShareware - Download Free Software

Confronta i prezzi di migliaia di prodotti.
Asp Forum
 Home | Login | Register | Search 


 

Forums >

microsoft.public.vb.general.discussion

How to find hWnd of "Find" edit field in Acrobat Reader 9?

(Mike Mitchell)

10/20/2011 6:19:00 AM

Acrobat Reader 9 has a Find field that initially contains the text
"Find". The class is named Edit.

I've tried using FindWindow to get the hwnd, but there are too many
windows of that class. The only way I can think of is
EnumerateWindows, then check whether the text = "Find", but this has
to be quite a costly process I should think, given the plethora of
windows?

OTOH does anyone know to what extent VB6 can "talk" to Reader 9 via
DDE?

MM
4 Answers

John

3/31/2010 11:15:00 AM

0

small update to Lock textboxes programatically

Private Sub ScrollBar1_Change()

Dim myrow As Long
Dim i As Integer

myrow = Me.ScrollBar1.Value

'textboxes
For i = 1 To 22

Select Case i

Case Is = 6, 7

With Me.Controls("TextBox" & i)

.Text = "P"

.Locked = True

End With

Case Is = 14, 18

With Me.Controls("TextBox" & i)

.Text = "C"

.Locked = True

End With

Case Else

With Me.Controls("TextBox" & i)

.Text = Dataws.Cells(myrow, i).Value

.Locked = False

End With

End Select

Next


End Sub
--
jb


"john" wrote:

> set the textbox properties to LOCKED for those you don't want users to edit.
>
> Then replace scrollbar code with this version. You will need to adjust the
> Case = code to the appropriate textbox number.
>
> Private Sub ScrollBar1_Change()
>
> Dim myrow As Long
> Dim i As Integer
>
> myrow = Me.ScrollBar1.Value
>
> 'textboxes
> For i = 1 To 22
>
> Select Case i
>
> Case Is = 6, 7
>
> Me.Controls("TextBox" & i).Text = "P"
>
> Case Is = 14, 18
>
> Me.Controls("TextBox" & i).Text = "C"
>
> Case Else
>
> Me.Controls("TextBox" & i).Text = _
> Dataws.Cells(myrow, i).Value
>
> End Select
>
> Next
>
>
> End Sub
> --
> jb
>
>
> "ajm1949" wrote:
>
> > Thanks John
> > It all seems to work well
> > Just one more question
> > I need to restrict data input in some cells to a "P" or a "C"
> > Any suggestions?
> > Cheers
> > Alan
> >
> >
> > "ajm1949" wrote:
> >
> > > I have 2 questions
> > > 1.How can I display the selected row (22 columns) in a user form so the data
> > > can be edited and then saved into the current row?
> > > 2.How can I scroll through the rows using a form? (Next and back buttons?)
> > > I already have the form created to enter the data-no problems there. Just
> > > not sure how to add the current row into a form
> > >
> > > Many Thanks in advance
> > >
> > > ajm1949

AJM1949

4/1/2010 3:01:00 AM

0

Thanks John That will be very useful

"john" wrote:

> small update to Lock textboxes programatically
>
> Private Sub ScrollBar1_Change()
>
> Dim myrow As Long
> Dim i As Integer
>
> myrow = Me.ScrollBar1.Value
>
> 'textboxes
> For i = 1 To 22
>
> Select Case i
>
> Case Is = 6, 7
>
> With Me.Controls("TextBox" & i)
>
> .Text = "P"
>
> .Locked = True
>
> End With
>
> Case Is = 14, 18
>
> With Me.Controls("TextBox" & i)
>
> .Text = "C"
>
> .Locked = True
>
> End With
>
> Case Else
>
> With Me.Controls("TextBox" & i)
>
> .Text = Dataws.Cells(myrow, i).Value
>
> .Locked = False
>
> End With
>
> End Select
>
> Next
>
>
> End Sub
> --
> jb
>
>
> "john" wrote:
>
> > set the textbox properties to LOCKED for those you don't want users to edit.
> >
> > Then replace scrollbar code with this version. You will need to adjust the
> > Case = code to the appropriate textbox number.
> >
> > Private Sub ScrollBar1_Change()
> >
> > Dim myrow As Long
> > Dim i As Integer
> >
> > myrow = Me.ScrollBar1.Value
> >
> > 'textboxes
> > For i = 1 To 22
> >
> > Select Case i
> >
> > Case Is = 6, 7
> >
> > Me.Controls("TextBox" & i).Text = "P"
> >
> > Case Is = 14, 18
> >
> > Me.Controls("TextBox" & i).Text = "C"
> >
> > Case Else
> >
> > Me.Controls("TextBox" & i).Text = _
> > Dataws.Cells(myrow, i).Value
> >
> > End Select
> >
> > Next
> >
> >
> > End Sub
> > --
> > jb
> >
> >
> > "ajm1949" wrote:
> >
> > > Thanks John
> > > It all seems to work well
> > > Just one more question
> > > I need to restrict data input in some cells to a "P" or a "C"
> > > Any suggestions?
> > > Cheers
> > > Alan
> > >
> > >
> > > "ajm1949" wrote:
> > >
> > > > I have 2 questions
> > > > 1.How can I display the selected row (22 columns) in a user form so the data
> > > > can be edited and then saved into the current row?
> > > > 2.How can I scroll through the rows using a form? (Next and back buttons?)
> > > > I already have the form created to enter the data-no problems there. Just
> > > > not sure how to add the current row into a form
> > > >
> > > > Many Thanks in advance
> > > >
> > > > ajm1949

Jimekus

10/20/2011 7:13:00 AM

0

On Oct 20, 7:19 pm, MM <kylix...@yahoo.co.uk> wrote:
> Acrobat Reader 9 has a Find field that initially contains the text
> "Find". The class is named Edit.
>
> I've tried using FindWindow to get the hwnd, but there are too many
> windows of that class. The only way I can think of is
> EnumerateWindows, then check whether the text = "Find", but this has
> to be quite a costly process I should think, given the plethora of
> windows?
>
> OTOH does anyone know to what extent VB6 can "talk" to Reader 9 via
> DDE?
>
> MM

I downloaded the M$ tool called SpyXX.exe and then contructed some
snakes and ladder type loops to get me to the edit field to later
allpw me set the current track in Winamp's Shoutcast DSP plugin. Much
easier than using Autoit.

-----------------------------------------

Dim lngHandle As Long
' Find the window based on SpyXX.exe
lngHandle = FindWindow(vbNullString, "Nullsoft SHOUTcast Source")
If lngHandle <> Zero Then
'get the first child-window...
lngHandle = GetWindow(lngHandle, GW_CHILD)
'loop through all of the child windows after the first...
Do Until WindowClass(lngHandle) = "#32770"
lngHandle = GetWindow(lngHandle, GW_HWNDNEXT)
Debug.Print WindowClass(lngHandle)
Loop
lngHandle = GetWindow(lngHandle, GW_HWNDNEXT)
Debug.Print WindowClass(lngHandle)
'loop through all of the child windows after the first...
lngHandle = GetWindow(lngHandle, GW_CHILD)
Do Until WindowClass(lngHandle) = "#32770"
lngHandle = GetWindow(lngHandle, GW_HWNDNEXT)
Debug.Print WindowClass(lngHandle)
Loop
lngHandle = GetWindow(lngHandle, GW_HWNDNEXT)
Debug.Print WindowClass(lngHandle)
lngHandle = GetWindow(lngHandle, GW_CHILD)
'loop through all of the child windows after the first...
Do Until WindowTextGet(lngHandle) = "Now"
lngHandle = GetWindow(lngHandle, GW_HWNDNEXT)
Debug.Print WindowClass(lngHandle)
Loop
lngHandle = GetWindow(lngHandle, GW_HWNDNEXT)
Debug.Print WindowTextGet(lngHandle) 's/b test7
lYellowPagesTrackTitle = lngHandle
lngHandle = GetWindow(lngHandle, GW_HWNDNEXT)
lngHandle = GetWindow(lngHandle, GW_HWNDNEXT)
lYellowPagesSendUpdate = GetWindow(lngHandle, GW_HWNDNEXT)
FilenameNowPlaying = NotString
If Not fHIDJ Is Nothing Then fHIDJ.TreeSync
End If


------------------------

Private Function WindowClass(ByVal hwnd As Long) As String
Const MAX_LEN As Byte = 255
Dim strBuff As String, intLen As Integer
strBuff = String(MAX_LEN, vbNullChar)
intLen = GetClassName(hwnd, strBuff, MAX_LEN)
WindowClass = Left(strBuff, intLen)
End Function
Public Function WindowTextGet(ByVal hwnd As Long) As String
Dim strBuff As String, lngLen As Long
lngLen = SendMessageAny(hwnd, WM_GETTEXTLENGTH, 0, 0)
If lngLen > 0 Then
lngLen = lngLen + 1
strBuff = String(lngLen, vbNullChar)
lngLen = SendMessageAny(hwnd, WM_GETTEXT, lngLen, ByVal
strBuff)
WindowTextGet = Left(strBuff, lngLen)
End If
End Function
Public Function WindowTextSet(ByVal hwnd As Long, ByVal strText As
String) As Boolean
WindowTextSet = (SendMessageAny(hwnd, WM_SETTEXT, Len(strText),
ByVal strText) <> 0)
End Function


mm

10/24/2011 3:43:00 AM

0

El 20/10/2011 03:19 a.m., MM escribió:
> The only way I can think of is
> EnumerateWindows, then check whether the text = "Find", but this has
> to be quite a costly process I should think, given the plethora of
> windows?

It's not too costly.

What happen if there are more than one instance of Adobe Reader open?