Results 1 to 3 of 3

Maximize external window when it's already open using the API.

Threaded View

  1. #1
    Registered User
    Join Date
    04-16-2013
    Location
    London, England
    MS-Off Ver
    Excel 2010
    Posts
    52

    Maximize external window when it's already open using the API.

    I have this code which opens a file in a maximized form with no problem, however I'd like to maximize an already open file without reopening it.
    Private Const SW_MAXIMIZE As Long = 3
    Private Declare Function ShellExecute Lib "shell32.dll" Alias "ShellExecuteA" (ByVal hwnd As Long, ByVal lpOperation As String, ByVal lpFile As String, ByVal lpParameters As String, ByVal lpDirectory As String, ByVal nShowCmd As Long) As Long
    
    Private Declare Function FindWindow Lib "user32.dll" Alias "FindWindowA" (ByVal lpClassName As String, ByVal lpWindowName As String) As Long
    Sub maximizewindow()
    Filename = FindWindow(vbNullString, "Untitled.txt - Notepad")
    start_doc = ShellExecute(Filename, "open", "C:\Untitled.txt", 0, 0, SW_MAXIMIZE)
    End Sub
    Many Thanks
    Last edited by Leith Ross; 05-19-2013 at 11:06 PM. Reason: Added Code Tags

Thread Information

Users Browsing this Thread

There are currently 1 users browsing this thread. (0 members and 1 guests)

Tags for this Thread

Bookmarks

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts

Search Engine Friendly URLs by vBSEO 3.6.0 RC 1