Author |
Topic: Full-screen (Read 631 times) |
|
Usama Amin
New Member
member is offline


Gender: 
Posts: 18
|
 |
Full-screen
« Thread started on: Oct 9th, 2013, 4:42pm » |
|
Hi guys, I am currently working on a game in which a certain key is pressed to toggle full screen, to enter full screen I am using the following code: GWL_STYLE = -16 HWND_TOPMOST = -1 WS_VISIBLE = &10000000 WS_CLIPCHILDREN = &2000000 WS_CLIPSIBLINGS = &4000000 SYS "GetSystemMetrics", 0 TO xscreen% SYS "GetSystemMetrics", 1 TO yscreen% SYS "SetWindowLong", @hwnd%, GWL_STYLE, WS_VISIBLE + \ \ WS_CLIPCHILDREN + WS_CLIPSIBLINGS SYS "SetWindowPos", @hwnd%, HWND_TOPMOST, 0, 0, xscreen%, yscreen%, 0 can anybody tell me how to get out without terminating the program? Thanks Usama
|
|
Logged
|
|
|
|
admin
Administrator
member is offline


Posts: 1145
|
 |
Re: Full-screen
« Reply #1 on: Oct 9th, 2013, 5:31pm » |
|
on Oct 9th, 2013, 4:42pm, Usama Amin wrote:can anybody tell me how to get out without terminating the program? |
|
You mean to restore it to a regular window? Basically you simply need to reverse the effects of the SetWindowLong and SetWindowPos, something like this:
Code: GWL_STYLE = -16
HWND_NOTOPMOST = -2
SWP_FRAMECHANGED = 32
SYS "SetWindowLong", @hwnd%, GWL_STYLE, &16CF0000
SYS "SetWindowPos", @hwnd%, HWND_NOTOPMOST, 100, 100, 800, 600, SWP_FRAMECHANGED
VDU 26 Richard.
|
|
Logged
|
|
|
|
Usama Amin
New Member
member is offline


Gender: 
Posts: 18
|
 |
Re: Full-screen
« Reply #2 on: Oct 9th, 2013, 6:08pm » |
|
Thanks! Works perfectly
|
|
Logged
|
|
|
|
|