BBC BASIC for Windows
« Full-screen »

Welcome Guest. Please Login or Register.
Apr 6th, 2018, 12:02am



ATTENTION MEMBERS: Conforums will be closing it doors and discontinuing its service on April 15, 2018.
Ad-Free has been deactivated. Outstanding Ad-Free credits will be reimbursed to respective payment methods.

If you require a dump of the post on your message board, please come to the support board and request it.


Thank you Conforums members.

BBC BASIC for Windows Resources
Online BBC BASIC for Windows documentation
BBC BASIC for Windows Beginners' Tutorial
BBC BASIC Home Page
BBC BASIC on Rosetta Code
BBC BASIC discussion group
BBC BASIC for Windows Programmers' Reference

« Previous Topic | Next Topic »
Pages: 1  Notify Send Topic Print
 thread  Author  Topic: Full-screen  (Read 631 times)
Usama Amin
New Member
Image


member is offline

Avatar




PM

Gender: Male
Posts: 18
xx 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
User IP Logged

admin
Administrator
ImageImageImageImageImage


member is offline

Avatar




PM


Posts: 1145
xx 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.
User IP Logged

Usama Amin
New Member
Image


member is offline

Avatar




PM

Gender: Male
Posts: 18
xx Re: Full-screen
« Reply #2 on: Oct 9th, 2013, 6:08pm »

Thanks! Works perfectly
User IP Logged

Pages: 1  Notify Send Topic Print
« Previous Topic | Next Topic »

| |

This forum powered for FREE by Conforums ©
Terms of Service | Privacy Policy | Conforums Support | Parental Controls