L
Ltexeira
Greetings,
After looking through the various psots, I was able to patch together the
required APIs to convert an 'instance' to a handle, then use the handle to
resize an applications screen using MoveWindow or SetWindowPos from the
"Users32" lib.
This is handy when I "Shell" the application and need to size the window.
This works great for notepad.exe ( as in the examples I found posted ), but
does not work with AcroRd32.exe ( The Adobe Acrobat reader ).
The routines appear to return the proper handle, but the resizing routines
mentioned above have no effect on the window.
The code is generic and straightforward, important bits below.
hInst = Shell("C:\Program Files\Adobe\Reader 8.0\Reader\AcroRd32.exe
""C:\test.pdf""", vbNormalFocus)
hWndApp = GetWinHandle(hInst)
cX = GetSystemMetrics(SM_CXSCREEN)
cY = GetSystemMetrics(SM_CYSCREEN)
cY = cY - 200
RetVal = MoveWindow(hWndApp, 0, 0, cX, cY, True)
RetVal = SetWindowPos(hWndApp, HWND_TOP, 0, 0, cX, cY, SWP_NOZORDER)
pick one of above, neither works with AcroRd32, either works with notepad.
the subroutine code is in other posts and is generic. If it would help I'll
post it, but I'm hoping this is something specific to the adobe product, or
there is a better way to tackle this.
Been reading here for a while, it's a great resource.
After looking through the various psots, I was able to patch together the
required APIs to convert an 'instance' to a handle, then use the handle to
resize an applications screen using MoveWindow or SetWindowPos from the
"Users32" lib.
This is handy when I "Shell" the application and need to size the window.
This works great for notepad.exe ( as in the examples I found posted ), but
does not work with AcroRd32.exe ( The Adobe Acrobat reader ).
The routines appear to return the proper handle, but the resizing routines
mentioned above have no effect on the window.
The code is generic and straightforward, important bits below.
hInst = Shell("C:\Program Files\Adobe\Reader 8.0\Reader\AcroRd32.exe
""C:\test.pdf""", vbNormalFocus)
hWndApp = GetWinHandle(hInst)
cX = GetSystemMetrics(SM_CXSCREEN)
cY = GetSystemMetrics(SM_CYSCREEN)
cY = cY - 200
RetVal = MoveWindow(hWndApp, 0, 0, cX, cY, True)
RetVal = SetWindowPos(hWndApp, HWND_TOP, 0, 0, cX, cY, SWP_NOZORDER)
pick one of above, neither works with AcroRd32, either works with notepad.
the subroutine code is in other posts and is generic. If it would help I'll
post it, but I'm hoping this is something specific to the adobe product, or
there is a better way to tackle this.
Been reading here for a while, it's a great resource.