[dba-Tech] Windows XP - Windows Picture and Fax Viewer-Nameand path of the exe file

Gustav Brock Gustav at cactus.dk
Sat Dec 4 08:34:49 CST 2004


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
--------------




More information about the dba-Tech mailing list