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 ?
Vom Fenster Modus zum Vollbild Modus weckseln (WIN)
-
Andreas21
- Beiträge: 390
- Registriert: 30.08.2004 09:05
- Computerausstattung: Desktop
Windows 10 Pro x64
CPU: AMD Ryzen 5 2600 3.40 GHz
Ram: 16GB RAM
Grafik: NVIDA Geforce 1060
PB: 5.72 X86/X64 - Wohnort: Heidelberg
Vom Fenster Modus zum Vollbild Modus weckseln (WIN)
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 ?
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 ?
- Falko
- Admin
- Beiträge: 3535
- Registriert: 29.08.2004 11:27
- Computerausstattung: PC: MSI-Z590-GC; 32GB-DDR4, ICore9; 2TB M2 + 2x3TB-SATA2 HDD; Intel ICore9 @ 3600MHZ (Win11 Pro. 64-Bit),
Acer Aspire E15 (Win11 Home X64). Purebasic LTS 6.11b1
HP255G8 Notebook @AMD Ryzen 5 5500U with Radeon Graphics 2.10 GHz 3.4GHz, 32GB_RAM, 3TB_SSD (Win11 Pro 64-Bit) - Kontaktdaten:
Suchst du etwa sowas in dieser Richtung mittels API
ShowWindow()?
ShowWindow()?
The ShowWindow function sets the specified window's show state.
BOOL ShowWindow(
HWND hWnd, // handle of window
int nCmdShow // show state of window
);
Code: Alles auswählen
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 -
Andreas21
- Beiträge: 390
- Registriert: 30.08.2004 09:05
- Computerausstattung: Desktop
Windows 10 Pro x64
CPU: AMD Ryzen 5 2600 3.40 GHz
Ram: 16GB RAM
Grafik: NVIDA Geforce 1060
PB: 5.72 X86/X64 - Wohnort: Heidelberg
Code: Alles auswählen
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 -
DarkDragon
- Beiträge: 6291
- Registriert: 29.08.2004 08:37
- Computerausstattung: Hoffentlich bald keine mehr
- Kontaktdaten:
Code: Alles auswählen
#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
EndIfAngenommen 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.
-
Andreas21
- Beiträge: 390
- Registriert: 30.08.2004 09:05
- Computerausstattung: Desktop
Windows 10 Pro x64
CPU: AMD Ryzen 5 2600 3.40 GHz
Ram: 16GB RAM
Grafik: NVIDA Geforce 1060
PB: 5.72 X86/X64 - Wohnort: Heidelberg
Danke führ eure Antworten. Ich habe die Lösung jetzt gefunden. Mitels WinAPI Help 
So einfach war es
Warum schwer wenns auch einfach geht 
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.
Code: Alles auswählen
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 UPDie Tasten Code findet man in der WinAPI Help.keybd_event_(Tasten Code, 0, 0 für Down und 2 für UP, 0)
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.
-
Andreas21
- Beiträge: 390
- Registriert: 30.08.2004 09:05
- Computerausstattung: Desktop
Windows 10 Pro x64
CPU: AMD Ryzen 5 2600 3.40 GHz
Ram: 16GB RAM
Grafik: NVIDA Geforce 1060
PB: 5.72 X86/X64 - Wohnort: Heidelberg
So wenn man die Windows ID also Handel hat kann man auch Fremd Fenster Steuern 
Z.b. Notepad (Nur einfacher Enter Druck
Code: Alles auswählen
RunProgram("c:\windows\notepad.exe","","",0)
Delay(1000)
handle=FindWindow_(0,"Unbenannt - Editor")
SetForegroundWindow_(handle)
keybd_event_(13,0,0,0)
keybd_event_(13,0,2,0)