[dba-Tech] Windows XP - Windows Picture and FaxViewer-Nameandpathof the exe file

A.D.Tejpal adtp at touchtelindia.net
Sun Dec 5 22:08:12 CST 2004


    Thanks again Marty! Great stuff. I shall try to digest it and explore the details.

A.D.Tejpal
--------------

  ----- Original Message ----- 
  From: MartyConnelly 
  To: Discussion of Hardware and Software issues 
  Sent: Sunday, December 05, 2004 23:17
  Subject: Re: [dba-Tech] Windows XP - Windows Picture and FaxViewer-Nameandpathof the exe file


  I was looking for something else at microsoft the other day and the help file for MODI  just caught my eye.
  I have a bunch of records mangers that are interested in this stuff.
  Here is another method I was testing to open pdfs at a specific page and tiff images.
  It just opens up IE at a blank page about:blank then uses IE document commands for placement of the image.
  You can set the IE windows size height and width and placement under code control
  The trouble is a tiff maybe opened up from IE via quicktime, depends on the extension file association on the PC
  I don't know if this is of any use to you.

  Sub testIEPDF()
  '------------------
  ' qfcheck.vbs   ver 1.0  3-Dec-2003
  ' Check Automatic Update Installation History

  '------------------
  'http://www.microsoft.com/technet/treeview/default.asp?url=/technet/scriptcenter/logs/scrlog08.asp
  'If you add a reference to "Microsoft Internet Controls"
  '(SHDOCVW.DLL) you should be able to do:


  '   Public IE As InternetExplorer
  '   Set IE = New InternetExplorer

  ' see wmi HotFix

  Dim objExplorer As Object
  Dim objDocument As Object
  Dim strComputer As String
  Dim objWMIService As Object
  Dim colLoggedEvents As Object
  Dim objEvent As Object
  Dim dtmDate As Variant
  Dim strReturn As String

  Set objExplorer = CreateObject("InternetExplorer.Application")
  'Set objDocument = objExplorer.Document
  objExplorer.Navigate "about:blank"
  objExplorer.Toolbar = False
  objExplorer.StatusBar = False
  objExplorer.MenuBar = True
  objExplorer.FullScreen = False
  objExplorer.AddressBar = False
  'here is where you can set the forms image size
  objExplorer.Width = 800
  objExplorer.Height = 570
  objExplorer.Left = 0
  objExplorer.Top = 0
  objExplorer.Visible = 1
  'objExplorer.Navigate "http://www.Viescas.com/"
  'objExplorer.Navigate "192.168.0.1/st_devic.html"
  'objExplorer.navigate "http://checkip.dyndns.org/"
  'objExplorer.navigate "http://www.adobe.com/prodlist.pdf#page=3"
  'objExplorer.navigate "C:\records management\aircanadacasestudy.pdf#page=4"
  'objExplorer.navigate "C:\records management\Copy of rim_guide_sarbanes.xls"
  'objExplorer.Navigate 
  "http://www.swimseattle.org/Forms/ScholorshipPolicy2003-2004.pdf"
  'objExplorer.Navigate "file://C:\records 
  management\aircanadacasestudy.pdf#page=3"
  'objExplorer.navigate "C:\records management\aircanadacasestudy.pdf#page=2"
  'objExplorer.Navigate 
  "http://www.adobe.com/products/server/pdfs/customer_FAQ.pdf#page=3&zoom=200,250,100"

  objExplorer.Navigate "C:\Documents and Settings\marty\My Documents\My 
  Pictures\VS.tif"

  'objExplorer.Navigate "res://msxml.dll/defaultss.xsl"
  Do While (objExplorer.Busy)
  Loop
  Dim webtx As String
  Dim strHTML As String
  Set objDocument = objExplorer.Document
  'objDocument.Open 'use this if you want to display your own html
  ' webtx = objExplorer.Document.body.innertext
  'webtx = objExplorer.Document.body
  'strHTML = objExplorer.Document.BODY.parentElement.outerHTML
  'Works ok for non-frames pages... like above checkip.dynds.org

  ' Debug.Print strHTML
  ' Debug.Print "*" & strHTML
  'objDocument.Writeln "<html><head><title>Automatic Updates Installation 
  History</title></head>"
  'objDocument.Writeln "<body bgcolor='white'>"
  'objDocument.Writeln "<table width='100%'>"
  'objDocument.Writeln "<tr>"
  'objDocument.Writeln "<td width='20%'><b>Computer Name</b></td>"
  'objDocument.Writeln "<td width='50%'><b>Installed Update(s)</b></td>"
  'objDocument.Writeln "<td width='50%'><b>Date and Time Installed</b></td>"
  'objDocument.Writeln "</tr>"
  ''objDocument.Writeln "<tr> <td " & _
  '
  'objDocument.Writeln "<tr>" & _
  ' "<a 
  href=""http://www.amazon.com/exec/obidos/ASIN/0735612846/viescaconsulinc/"">""Book 
  URL""</a>"
  'objDocument.Writeln "</td> </tr> "
  'strComputer = "."
  'Set objWMIService = GetObject("winmgmts:" _
  '    & "{impersonationLevel=impersonate}!\\" & strComputer & "\root\cimv2")
  '    'IE Event code=19 WinXP=4377
  'Set colLoggedEvents = objWMIService.ExecQuery _
  '        ("SELECT * FROM Win32_NTLogEvent WHERE Logfile = 'System' AND " _
  '            & "EventCode = '19' OR EventCode = '4377'")
  'Dim i As Long
  'For Each objEvent In colLoggedEvents
  '    dtmDate = objEvent.TimeWritten
  '    strReturn = WMIDateStringTodate(dtmDate)

   '   objDocument.Writeln "<tr>"
   '   objDocument.Writeln "<td width='20%'>" & objEvent.ComputerName & 
  "</td>"
   '   objDocument.Writeln "<td width='50%'>" & objEvent.Message & "</td>"
   '   objDocument.Writeln "<td width='50%'>" & strReturn & "</td>"
   '   objDocument.Writeln "</tr>"
   '   i = i + 1
  'Next
  'Debug.Print "no of events=" & i
  'objDocument.Writeln "</table>"
  'objDocument.Writeln "</body></html>"
  'objDocument.Write()
  objDocument.Close
  MsgBox "finished"
  Set objExplorer = Nothing
  Set objDocument = Nothing
  Set objWMIService = Nothing
  Set colLoggedEvents = Nothing
  Set objEvent = Nothing
  End Sub

  A.D.Tejpal wrote:

  >    My sincere thanks Marty! I must compliment your wonderful ability to provide such a wealth of relevant information, so consistently.
  >
  >     I would examine further on the lines indicated by you. Apparently, there is no magic bullet (universal API call) that could convert any currently active window into true full screen display - irrespective of the parent application to which such window might belong.
  >
  >Thanks again,
  >A.D.Tejpal
  >--------------    
  >
  >  ----- Original Message ----- 
  >  From: MartyConnelly 
  >  To: Discussion of Hardware and Software issues 
  >  Sent: Sunday, December 05, 2004 04:30
  >  Subject: Re: [dba-Tech] Windows XP - Windows Picture and FaxViewer-Nameand pathof the exe file
  >
  >
  >  Haven't had a chance to play around with this yet but with Office 2003 there is a new control called MODI
  >  Microsoft Office Document Imaging , it might have been available in Office XP but  without an exposed API.
  >  I believe it is a free license but then my legal advice is worth what you pay for it.
  >  It will display Tiff images and do OCR under mdivwctl.dll and mdivwctl.oca I haven't seen much documentation or code  on this.
  >
  >  The Microsoft Office Document Imaging 2003 (MODI) Viewer OCX Control can be used to display images and perform minor image editing functions. 
  >  Viewing functionality includes panning, scrolling, zooming and selecting both image data and text (OCR has to be performed first).
  >
  >  Referencing the MODI Viewer OCX Control in a Microsoft Visual Basic Project
  >
  >  To include the Microsoft Office Document Imaging 2003 (MODI) Viewer OCX Control into a Microsoft Visual Basic project, use the Project | Components menu item and select Microsoft Office Document Imaging 11.0 Type Library (mdivwctl.oca). By including the Viewer OCX Control into 
  >  the project, a reference is automatically added - making the entire Object Model available to the programmer. 
  >  Note that the Viewer OCX Control corresponds to the MiDocView Object in the Microsoft Office Document Imaging 2003 (MODI) Object Model.
  >
  >  For info on API
  >
  >  Office 2003 Editions: VBA Language Reference for the Document Imaging Object Model
  >  This download contains the Visual Basic® for Applications (VBA) Language Reference for the Microsoft® Office 2003 Document Imaging Object Model as a compiled Help file. Install chm file to the directory it selects, to preserve internal links but uncheck the overwrite box just in case.
  >
  >  http://www.microsoft.com/downloads/details.aspx?familyid=7b6d9193-a1c8-4934-8007-47089fde37de&displaylang=en
  >  by the way here is the download page for all the vba object reference help files if you want Office 2003 help offline
  >  http://msdn.microsoft.com/office/downloads/vba/default.aspx
  >
  >  or VB info
  >  http://www.ilixis.com/developer/modi.html
  >
  >
  >  A.D.Tejpal wrote:
  >
  >  >    Thanks Gustav! I greatly appreciate your help.
  >  >
  >  >A.D.Tejpal
  >  >--------------
  >  >
  >  >  ----- Original Message ----- 
  >  >  From: Gustav Brock 
  >  >  To: dba-tech at databaseadvisors.com 
  >  >  Sent: Saturday, December 04, 2004 20:04
  >  >  Subject: Re: [dba-Tech] Windows XP - Windows Picture and FaxViewer-Nameand path of the exe file
  >  >
  >  >
  >  >  Hi A.D.
  >  >
  >  >  I'm no API expert, but you can modify the code like this to maximize
  >  >  ..:
  >  >
  >  >  <code>
  >  >
  >  >  Public Function ShowImage( _
  >  >    ByVal strFile As String, _
  >  >    Optional ByVal booMaximized As Boolean) _
  >  >    As Long
  >  >    
  >  >  ' strFile must be either a directory or a file; wildcards are not
  >  >  accepted.
  >  >
  >  >    Const cstrCommand   As String = "rundll32.exe shimgvw.dll,
  >  >  ImageView_Fullscreen"
  >  >    
  >  >    Dim lngResult       As Long
  >  >    Dim intWindowStyle  As Long
  >  >    
  >  >    If booMaximized = True Then
  >  >      intWindowStyle = vbMaximizedFocus
  >  >    Else
  >  >      intWindowStyle = vbNormalFocus
  >  >    End If
  >  >
  >  >    lngResult = Shell(cstrCommand & " " & strFile & "", intWindowStyle)
  >  >
  >  >    ShowImage = lngResult
  >  >
  >  >  End Function
  >  >
  >  >  </code>
  >  >
  >  >  However, it only works one way. If you have opened a picture maximized, all subsequent calls of the function will open a maximized view. You have to manually restore the view before closing it.
  >  >  This behaviour is probably saved in the registry. You could reset that setting before calling the function.
  >  >
  >  >  /gustav
  >  >
  >  >  >>> adtp at touchtelindia.net 04-12-2004 05:14:57 >>>
  >  >
  >  >  Hello Gustav,
  >  >
  >  >      Thanks for the cross-check. 
  >  >
  >  >      Another question - could you possibly suggest any API call that could force the currently active display into full screen mode, irrespective of the parent application involved?
  >  >
  >  >      This can be useful in view of the fact that the combination of key strokes required to do it in different applications, is not always the
  >  >  same. 
  >  >
  >  >  A.D.Tejpal
  >  >  --------------
  >  >
  >  >_______________________________________________
  >  >dba-Tech mailing list
  >  >dba-Tech at databaseadvisors.com
  >  >http://databaseadvisors.com/mailman/listinfo/dba-tech
  >  >Website: http://www.databaseadvisors.com
  >  >
  >  >  
  >  >
  >
  >  -- 
  >  Marty Connelly
  >  Victoria, B.C.
  >  Canada




More information about the dba-Tech mailing list