Source watts on the 15.07.2007 from the MMJ-Quellcodesammlung (Dietmar horn) in The Babyklappe on XProfan.Com stored:
Window: status- and Positionsinformationen one Fensters
Def @Getwindowplacement(2) !USER32,GetWindowPlacement
Def @Getlasterror(0) !KERNEL32,GetLastError
Declare Notepad_handle&,Statusinfos&,Fehler&,Windowplacement#,Activewindow&,Setstate&,Show$
Windowstyle 31
Windowtitle status and Positionsinformationen one Fensters
Window 0,0-640,440
Let Statusinfos&=@Createbutton(%Hwnd,Statusinfos read,20,100,200,30)
Let Setstate&=@Createbutton(%Hwnd,Fensterstatus settle,20,150,200,30)
Case @Findwindow(Untitled - editor)=0 : @Winexec(NOTEPAD.EXE,1)
Let Notepad_handle&=@Findwindow(Untitled - editor)
@Showwindow(%Hwnd,2)
@Showwindow(%Hwnd,1)
While 0=0
Let Activewindow&=@Getactivewindow()
Sleep 100
If @Getfocus(Statusinfos&)
@Setactivewindow(Activewindow&)
Clearlist
Addstring Fensterhandle=+@Str $(Notepad_handle&)
Dim Windowplacement#,44
Clear Windowplacement#
Long Windowplacement#,0=44
Addstring last API-Error=+@Str $(@Getlasterror())
Let Fehler&=@Getwindowplacement(Notepad_handle&,Windowplacement#)
Addstring Return of GetWindowPlacement=+@Str $(Fehler&)
Addstring last API-Error=+@Str $(@Getlasterror())
Addstring Fenstererzeugungsflags=+@Str $(@Long(Windowplacement#,4))
If @Long(Windowplacement#,4) | $2=@Long(Windowplacement#,4)
Addstring Window becomes with the Erzeugung always maximiert
Elseif @Long(Windowplacement#,4) | $1=@Long(Windowplacement#,4)
Addstring Fensterposition for The Minimierung is set
Endif
Addstring ShowCmd=+@Str $(@Long(Windowplacement#,8))
If @Long(Windowplacement#,8)=$1
Addstring status=normal Size
Elseif @Long(Windowplacement#,8)=$0
Addstring status=invisible
Elseif @Long(Windowplacement#,8)=$2
Addstring status=minimizes
Elseif @Long(Windowplacement#,8)=$3
Addstring status=Maximiert
Elseif @Long(Windowplacement#,8)=$4
Addstring status=normal Size
Elseif @Long(Windowplacement#,8)=$5
Addstring status=latest Fenstergröße
Elseif @Long(Windowplacement#,8)=$6
Addstring status=minimizes
Elseif @Long(Windowplacement#,8)=$7
Addstring status=minimizes
Elseif @Long(Windowplacement#,8)=$8
Addstring status=normal Size
Elseif @Long(Windowplacement#,8)=$9
Addstring status=status=normal Size
Endif
Addstring X-Koordinate,if Window minimizes is=+@Str $(@Long(Windowplacement#,12))
Addstring Y-Koordinate,if Window minimizes is=+@Str $(@Long(Windowplacement#,16))
Addstring X-Koordinate,if Window maximiert is=+@Str $(@Long(Windowplacement#,20))
Addstring Y-Koordinate,if Window maximiert is=+@Str $(@Long(Windowplacement#,24))
Addstring X-Koordinate supra left, if Window in Normalzustand is=+@Str $(@Long(Windowplacement#,28))
Addstring Y-Koordinate supra left, if Window in Normalzustand is=+@Str $(@Long(Windowplacement#,32))
Addstring X-Koordinate under right, if Window in Normalzustand is=+@Str $(@Long(Windowplacement#,36))
Addstring Y-Koordinate under right, if Window in Normalzustand is=+@Str $(@Long(Windowplacement#,40))
Dispose Windowplacement#
@Listbox$(status and Positionsinformat,1)
@Setfocus(Activewindow&)
Elseif @Getfocus(Setstate&)
Let Show$=@Input$(number of 0 To 9 prompt:,Fensterstatus settle,1)
If Show$<>
@Showwindow(Notepad_handle&,@Val(Show$))
Clearlist
Addstring Fensterhandle=+@Str $(Notepad_handle&)
Dim Windowplacement#,44
Long Windowplacement#,0=44
Addstring last API-Error=+@Str $(@Getlasterror())
Let Fehler&=@Getwindowplacement(Notepad_handle&,Windowplacement#)
Addstring Return of GetWindowPlacement=+@Str $(Fehler&)
Addstring last API-Error=+@Str $(@Getlasterror())
Addstring Fenstererzeugungsflags=+@Str $(@Long(Windowplacement#,4))
If @Long(Windowplacement#,4) | $2=@Long(Windowplacement#,4)
Addstring Window becomes with the Erzeugung always maximiert
Elseif @Long(Windowplacement#,4) | $1=@Long(Windowplacement#,4)
Addstring Fensterposition for The Minimierung is set
Endif
Addstring ShowCmd=+@Str $(@Long(Windowplacement#,8))
If @Long(Windowplacement#,8)=$1
Addstring status=normal Size
Elseif @Long(Windowplacement#,8)=$0
Addstring status=invisible
Elseif @Long(Windowplacement#,8)=$2
Addstring status=minimizes
Elseif @Long(Windowplacement#,8)=$3
Addstring status=Maximiert
Elseif @Long(Windowplacement#,8)=$4
Addstring status=normal Size
Elseif @Long(Windowplacement#,8)=$5
Addstring status=latest Fenstergröße
Elseif @Long(Windowplacement#,8)=$6
Addstring status=minimizes
Elseif @Long(Windowplacement#,8)=$7
Addstring status=minimizes
Elseif @Long(Windowplacement#,8)=$8
Addstring status=normal Size
Elseif @Long(Windowplacement#,8)=$9
Addstring status=status=normal Size
Endif
Addstring X-Koordinate,if Window minimizes is=+@Str $(@Long(Windowplacement#,12))
Addstring Y-Koordinate,if Window minimizes is=+@Str $(@Long(Windowplacement#,16))
Addstring X-Koordinate,if Window maximiert is=+@Str $(@Long(Windowplacement#,20))
Addstring Y-Koordinate,if Window maximiert is=+@Str $(@Long(Windowplacement#,24))
Addstring X-Koordinate supra left, if Window in Normalzustand is=+@Str $(@Long(Windowplacement#,28))
Addstring Y-Koordinate supra left, if Window in Normalzustand is=+@Str $(@Long(Windowplacement#,32))
Addstring X-Koordinate under right, if Window in Normalzustand is=+@Str $(@Long(Windowplacement#,36))
Addstring Y-Koordinate under right, if Window in Normalzustand is=+@Str $(@Long(Windowplacement#,40))
Dispose Windowplacement#
@Listbox$(status and Positionsinformat,1)
@Setfocus(Activewindow&)
Endif
Endif
Wend