none
API merkt sich Daten RRS feed

  • Frage

  • Hallo zusammen,

    ich habe eine Funktion die sehr schön ist.

    <Runtime.InteropServices.DllImport("user32.dll")> _
        Public Shared Function AnimateWindow(ByVal hwnd As IntPtr, ByVal time As Integer, ByVal flags As AnimateWindowFlags) As Boolean
        End Function
    
        Public Enum AnimateWindowFlags
            AW_HOR_POSITIVE = &H1
            AW_HOR_NEGATIVE = &H2
            AW_VER_POSITIVE = &H4
            AW_VER_NEGATIVE = &H8
            AW_CENTER = &H10
            AW_HIDE = &H10000
            AW_ACTIVATE = &H20000
            AW_SLIDE = &H40000
            AW_BLEND = &H80000
        End Enum

    Hier kann man die Form vergrößern verkleinern ... wie auch immer.

    Wenn ich mit dieser Funktion die Form verschwinden lasse oder einen Button kann ich beim zweiten Aufruf das Control wieder einblenden lassen.

    Aber woher weis die Funktion denn die Ursprungsgöße ?
    Wo und wie wird das weg gespeichert ?
    In der API ?

    lieben dank

    Bernd

    Mittwoch, 16. Mai 2012 11:46

Antworten

  • Hi,

    sorry for my response in English, my German is not good enough :-(

    No application can create windows by themselves; they are created by the operating system upon request, and the operating system returns a 'handle' in response. The handle is just a kind of pointer, to an internal structure, kept by the operating system, that keeps state information of the window. It is in that state that the restore-size is kept.


    Regards, Nico

    Mittwoch, 16. Mai 2012 12:11
  • Bernd,

    most of these values are encapsulated by the window properties in your programming language.

    These would be the width and height or size properties of the form.

    When the form is minimized or maximized, these values represent the 'normal' size.

    If you want to retrieve it through a handle, i think the

    GetWindowRect
    function can be used.


    Regards, Nico


    Mittwoch, 16. Mai 2012 13:12

Alle Antworten

  • Hi,

    sorry for my response in English, my German is not good enough :-(

    No application can create windows by themselves; they are created by the operating system upon request, and the operating system returns a 'handle' in response. The handle is just a kind of pointer, to an internal structure, kept by the operating system, that keeps state information of the window. It is in that state that the restore-size is kept.


    Regards, Nico

    Mittwoch, 16. Mai 2012 12:11
  • Hallo Nico,

    mein Englisch reicht grade mal zu lesen. Sorry. Beim schreiben geht da nicht so gut.

    Ok also das OS macht das.
    Könnte man die Daten auch abfragen ?

    über das Handle ?

    danke

    Bernd 

    Mittwoch, 16. Mai 2012 13:00
  • Bernd,

    most of these values are encapsulated by the window properties in your programming language.

    These would be the width and height or size properties of the form.

    When the form is minimized or maximized, these values represent the 'normal' size.

    If you want to retrieve it through a handle, i think the

    GetWindowRect
    function can be used.


    Regards, Nico


    Mittwoch, 16. Mai 2012 13:12
  • Hi,

    i test the GetWindowRect Funktion.
    This Funktion gives me the aktual position and anktual location.
    And not the values that the control has before. Like the AnimateWindow Funtion do it.

    So what i want to do is. Write some functions to animate Controls.
    What i want is, i want to save the old values. Position and Size.

    so first step. save old values then animate the Control.
    sekond step. restor the Control to old size and position.

    thanks

    Bernd

    Mittwoch, 16. Mai 2012 17:09
  • Hallo zusammen,

    ich habe es mittlerweile verstanden.

    Vielen dank an euch.

    Gibt es eigentlich noch mehr so schön verspielte API's wie die AnimateWindow() ?

    vielen dank

    Bernd 

    Donnerstag, 17. Mai 2012 08:11