Hei weis jemand wie man ein Fenster von dem man die Fenster ID also das Handel hat auf Vollbild vergrössern kann
Ich will ein Windows Fenster zum Vollbild Fenster umschalten. Es handelt sich dabei um ein um kein Fenster das mit PB erstelt wurde. Ich habe nur das Handel vom Fenster. mit Alt + Enter gehts super aber ich will es lieber per Code machen. aber mann könte das auch mit simulierten tastendrucks machen oder ?
If OpenWindow(0,0,0,322,150,#PB_Window_SystemMenu|#PB_Window_ScreenCentered,"EditorGadget") And CreateGadgetList(WindowID(0))
EditorGadget (0,8,8,306,133,#PB_Container_Raised)
For a=0 To 5
AddGadgetItem(0,a,"Line "+Str(a))
Next
Repeat
EventID=WindowEvent()
Delay(100)
Debug EventID
Select EventID
Case 513 ;Ändern, wenn Klick in TextGadget
If state=0
ShowWindow_(WindowID(0),#SW_MAXIMIZE)
state=1
Else
ShowWindow_(WindowID(0),#SW_SHOWNORMAL)
state=0
EndIf
EndSelect
Until EventID=#PB_Event_CloseWindow
EndIf
The ShowWindow function sets the specified window's show state.
BOOL ShowWindow(
HWND hWnd, // handle of window
int nCmdShow // show state of window
);
Parameters
hWnd
Identifies the window.
nCmdShow
Specifies how the window is to be shown. This parameter is ignored the first time an application calls ShowWindow, if the program that launched the application provides a STARTUPINFO structure. Otherwise, the first time ShowWindow is called, the value should be the value obtained by the WinMain function in its nCmdShow parameter. In subsequent calls, this parameter can be one of the following values:
Value Meaning
SW_HIDE Hides the window and activates another window.
SW_MAXIMIZE Maximizes the specified window.
SW_MINIMIZE Minimizes the specified window and activates the next top-level window in the Z order.
SW_RESTORE Activates and displays the window. If the window is minimized or maximized, Windows restores it to its original size and position. An application should specify this flag when restoring a minimized window.
SW_SHOW Activates the window and displays it in its current size and position.
SW_SHOWDEFAULT Sets the show state based on the SW_ flag specified in the STARTUPINFO structure passed to the CreateProcess function by the program that started the application.
SW_SHOWMAXIMIZED Activates the window and displays it as a maximized window.
SW_SHOWMINIMIZED Activates the window and displays it as a minimized window.
SW_SHOWMINNOACTIVE Displays the window as a minimized window. The active window remains active.
SW_SHOWNA Displays the window in its current state. The active window remains active.
SW_SHOWNOACTIVATE Displays a window in its most recent size and position. The active window remains active.
SW_SHOWNORMAL Activates and displays a window. If the window is minimized or maximized, Windows restores it to its original size and position. An application should specify this flag when displaying the window for the first time.
Return Values
If the window was previously visible, the return value is nonzero.
If the window was previously hidden, the return value is zero.
Remarks
The first time a program calls ShowWindow, it uses the WinMain function's nCmdShow parameter as its nCmdShow parameter. Subsequent calls to ShowWindow must use one of the values in the given list, instead of the one specified by the WinMain function's nCmdShow parameter.
As noted in the discussion of the nCmdShow parameter, the nCmdShow value is ignored in the first call to ShowWindow if the program that launched the application specifies startup information in the STARTUPINFO structure. In this case, ShowWindow uses the information specified in the STARTUPINFO structure to show the window. On subsequent calls, the application must call ShowWindow with nCmdShow set to SW_SHOWDEFAULT to use the startup information provided by the program that launched the application. For example, Program Manager specifies that applications start with a minimized main window. This behavior is designed for the following situations:
· Applications create their main window by calling CreateWindow with the WS_VISIBLE flag set.
· Applications create their main window by calling CreateWindow with the WS_VISIBLE flag cleared, and later call ShowWindow with the SW_SHOW flag set to make it visible.
See Also
CreateProcess, CreateWindow, ShowOwnedPopups, STARTUPINFO, WinMain
Eigentlich schon aber ich will ja mein Fenster nicht Maximieren sondern in den Vollbild Modus von 640x480 Pixel versetzen Aber danke für die Antwort.
#WindowWidth = 640
#WindowHeight = 480
Global hWnd.l, Event
;Achte auf die Flags
If OpenWindow(0, 0, 0, #WindowWidth, #WindowHeight, #PB_Window_BorderLess | #WS_CLIPSIBLINGS, "Fullscreen")
;Hier musst du den Bildschirmmodus ändern
dmScreenSettings.DEVMODE
dmScreenSettings\dmSize = SizeOf(dmScreenSettings)
dmScreenSettings\dmPelsWidth = #WindowWidth
dmScreenSettings\dmPelsHeight = #WindowHeight
dmScreenSettings\dmBitsPerPel = 32
dmScreenSettings\dmFields = 262144 | 524288 | 1048576
If ChangeDisplaySettings_(@dmScreenSettings, 4) <> 0 : End : EndIf
;Damit auch alles glatt läuft wird einfach Maximiert
ShowWindow_(WindowID(), #SW_SHOWMAXIMIZED)
Repeat
Delay(10)
Until WindowEvent() = #WM_KEYDOWN And EventwParam() = #VK_ESCAPE
End
EndIf
Angenommen es gäbe einen Algorithmus mit imaginärer Laufzeit O(i * n), dann gilt O((i * n)^2) = O(-1 * n^2) d.h. wenn man diesen Algorithmus verschachtelt ist er fertig, bevor er angefangen hat.
keybd_event_(18, 0, 0 , 0) ;ALT Down
keybd_event_(13, 0, 0, 0) ;Enter Down
keybd_event_(13, 0, 2, 0) ;Enter UP
keybd_event_(18, 0, 2, 0) ;ALT UP
So einfach war es Warum schwer wenns auch einfach geht
keybd_event_(Tasten Code, 0, 0 für Down und 2 für UP, 0)
Die Tasten Code findet man in der WinAPI Help.
Eigentlich wollte ich ja das Fenster per Fenster Handel ansprechen aber so gehts ja auch. Ich erzeuge ja das Fenster ja selber. Aber es müsste auch fast genauso leicht sein das mit einer Fenster Handel zu machen.
Hammer, Danke. So kann ich wahrscheinlich auch endlich ein Program schreiben, das sich automatisch bei zB. Yahoo und Hotmail und so Einloggt *freu* Thx!