Windowgrösse
Verfasst: 20.04.2008 13:16
Mal wieder ne Frage,
wie kann man die grösse eines Fensters nur anhand des Handels ermitteln
wie kann man die grösse eines Fensters nur anhand des Handels ermitteln
Das ist die Addresse zu einer RECT Variable:unix hat geschrieben:GetWindowRect(HWND hwnd, LPRECT lpRect);
und was ist "LPRECT lpRect"?
Code: Alles auswählen
Define var.RECT
GetWindowRect_(hWnd.l, @var)Bei mir in der Debugausgabe von var="1245020" das bei jeden Fenster ist das ein Pointer auf nen Speicher?? aber wenn ich peekl(var) mache bekomme ich 0milan1612 hat geschrieben:Das ist die Addresse zu einer RECT Variable:unix hat geschrieben:GetWindowRect(HWND hwnd, LPRECT lpRect);
und was ist "LPRECT lpRect"?Danach stehen die Werte in var.Code: Alles auswählen
Define var.RECT GetWindowRect_(hWnd.l, @var)
Code: Alles auswählen
flag = #PB_Window_SystemMenu|1
hwnd = OpenWindow(0,0,0,400,200,"Test",flag)
CreateGadgetList(hwnd)
id = ButtonGadget(1,10,20,80,25,"Tue nix")
;für das Window ab Screen oben links
GetWindowRect_(hwnd,r.rect)
Debug r\top
Debug r\left
Debug r\right
Debug r\bottom
Debug "---"
;Größe des Windows
GetClientRect_(hwnd,r.rect)
Debug r\top
Debug r\left
Debug r\right
Debug r\bottom
Debug "---"
;für den Button ab Screen oben links
GetWindowRect_(id,r.rect)
Debug r\top
Debug r\left
Debug r\right
Debug r\bottom
Debug "---"
;Größe des Gadgets
GetClientRect_(id,r.rect)
Debug r\top
Debug r\left
Debug r\right
Debug r\bottom
Debug "---"
Repeat: event = WaitWindowEvent()
Until event = #PB_Event_CloseWindow
End
MSDN?? ich hab nen API Guide aber da vernünftig was rauszulesen najahjbremer hat geschrieben:ja ja, die MSDN ist dein Freund,![]()
du findest nix und verstehst nix,![]()
![]()
geht mir auch meistens, ab und zu, immer, manchmal so
Code: Alles auswählen
Declare Function SetWindowPlacement Lib "user32" (ByVal hwnd As Long, lpwndpl As WINDOWPLACEMENT) As Long
· hWnd
[in] Handle to the window.
· lpwndpl
[in] Pointer to a WINDOWPLACEMENT structure that specifies the new show state and window positions.
Before calling SetWindowPlacement, set the length member of the WINDOWPLACEMENT structure to sizeof(WINDOWPLACEMENT). SetWindowPlacement fails if lpwndpl->length is not set correctly.