wie stelle ich es sinnvoll an, auf Fenster anderer Anwendungen als Excel zuzugreifen?
Bsp.: Fenstergröße und -position einer Anwendung verändern.
Danke und Gruß
RALF
Function SetWindowPos Lib "user32" (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
Declare
Function FindWindow Lib "user32" Alias _
"FindWindowA" (ByVal lpClassName As String, ByVal _
lpWindowName As String) As Long
Sub test()
Const LEFT As Long = 100
Const TOP As Long = 200
Const HEIGTH As Long = 600
Const WIDTH As Long = 100
Dim hwnd As Long
'NotePad starten
Result = Shell("notepad.exe", vbNormalFocus)
'Handle von Notepad auslesen
hwnd = FindWindow(vbNullString, "Unbenannt - Editor")
Call SetWindowPos(hwnd, 0, LEFT, TOP, WIDTH, HEIGTH, 0&)
End Sub
Function KEINEN Zeilenumbruch, sondern nur ein Leerzeichen. Keine Ahnung, warum das hier bei der Eingabe immer abgeändert wird)
Viel Erfolg!