Article View: adobe.acrobat.reader.pocketpc
Article #25Re: parameter for acrobat reader 1.0
From: Alberto_Cricca
Date: Thu, 29 Jul 2004 14:01
Date: Thu, 29 Jul 2004 14:01
86 lines
3463 bytes
3463 bytes
Dave,
I've tested this code on Qtek 2020 and it works for both Pocket Word and ClearVue PDF Reader.
------------------------------------------------------------------
API DECLARATION
------------------------------------------------------------------
Public Const GW_HWNDFIRST = 0
Public Const GW_HWNDLAST = 1
Public Const GW_HWNDNEXT = 2
Public Const SWP_NOSIZE As Long = &H1
Public Const SWP_NOMOVE As Long = &H2
Public Const SWP_HIDEWINDOW As Long = &H80
Public Declare Function GetWindow Lib "Coredll" ( _
ByVal hWnd As Long, _
ByVal wCmd As Long) As Long
Public Declare Function GetWindowText Lib "Coredll" _
Alias "GetWindowTextW" ( _
ByVal hWnd As Long, _
ByVal lpString As String, _
ByVal cch As Long) As Long
Public Declare Function SetWindowPos Lib "Coredll" ( _
ByVal hWnd As Long, _
ByVal hWndInsertAfter As Long, _
ByVal X As Long, _
ByVal Y As Long, _
ByVal cx As Long, _
ByVal cy As Long, _
ByVal wFlags As Long) As Long
------------------------------------------------------------------
CODE (partial)
------------------------------------------------------------------
Dim lngHandle As Long
Dim hFirst As Long
Dim hLast As Long
Dim strTitle As String
Dim lclAttPathName As String
...
'Create absolute path name from user choice
lclAttPathName = _
"\My Documents\Novita\" & OPNLLView.SelectedItem.SubItems(2)
If CreateProcess("\Windows\fexplore.exe", lclAttPathName,
0, 0, 0, 0, 0, 0, 0, 0) = 0 Then
MsgBox "CreateProcess failure"
Exit Sub
End If
hFirst = GetWindow(OPNLForm.hWnd, GW_HWNDFIRST)
hLast = GetWindow(OPNLForm.hWnd, GW_HWNDLAST)
'Initialize the title string
strTitle = Space(255)
'Get the window title
GetWindowText hFirst, strTitle, Len(strTitle)
'Iterate on all windows
lngHandle = hFirst
Do While Not lngHandle = hLast
i = i + 1
'Don't manage "blank" window titles
If Asc(Left(strTitle, 1)) <> 0 Then
'Compare window title with expected title
If UCase(Mid(strTitle, 1, Len("ESPLORA FILE"))) = _
"ESPLORA FILE" Then
'Tell explorer window to follow Me.hWnd in z-order
'THIS IS THE ONLY WAY I GOT IT TO WORK
Call SetWindowPos(lngHandle, Me.hWnd, 0, 0, 0, 0,
SWP_NOMOVE Or SWP_NOSIZE Or SWP_HIDEWINDOW)
Exit Do
End If
End If
'Get the next window
lngHandle = GetWindow(lngHandle, GW_HWNDNEXT)
'Initialize the title string
strTitle = Space(255)
'Get the window title
GetWindowText lngHandle, strTitle, Len(strTitle)
Loop
------------------------------------------------------------------
Hope this helps.
Alberto
Technical Details
Message-ID:
<3bb3d8ff.14@webx.la2eafNXanI>Path:
arc1-ca.pugleaf.net!g2news1.google.com!news2.google.com!proxad.net!news.tele.dk!news.tele.dk!small.news.tele.dk!lnewsoutpeer00.lnd.ops.eu.uu.net!lnewsinpeer01.lnd.ops.eu.uu.net!emea.uu.net!newsfeed01.sul.t-online.de!t-online.de!webxReferences:
<3bb3d8ff.-1@webx.la2eafNXanI>Show Full Headers
Complete Article Headers
X-Google-Thread: 1012e1,387386798ad293dd X-Google-Attributes: gid1012e1,public X-Google-Language: ENGLISH,ASCII-7-bit From: Alberto_Cricca@adobeforums.com Path: arc1-ca.pugleaf.net!g2news1.google.com!news2.google.com!proxad.net!news.tele.dk!news.tele.dk!small.news.tele.dk!lnewsoutpeer00.lnd.ops.eu.uu.net!lnewsinpeer01.lnd.ops.eu.uu.net!emea.uu.net!newsfeed01.sul.t-online.de!t-online.de!webx Newsgroups: adobe.acrobat.reader.pocketpc Subject: Re: parameter for acrobat reader 1.0 Message-ID: <3bb3d8ff.14@webx.la2eafNXanI> Date: Thu, 29 Jul 2004 07:01:53 -0700 References: <3bb3d8ff.-1@webx.la2eafNXanI> Lines: 87 MIME-Version: 1.0 Content-Type: text/plain; charset="ISO-8859-1" Content-Transfer-Encoding: 8bit