05-13-2022, 09:05 PM
(This post was last modified: 05-13-2022, 09:07 PM by hanness.
Edit Reason: Grammatical error
)
Take a look at this small piece of sample code:
In this code, I am hiding the QB64pe screen until I take some actions based upon the size of the desktop on which the program is being run. As a result, I try to obtain the width and height of the desktop. However, the line "x = _DesktopWidth: y = _DesktopHeight" will simply hang forever.
If you execute the code above, it will look within the IDE as if the program runs and ends because you get access to the IDE again after running the program. However, if you look at task manager you will find that the program is still running:
As further proof of this, try to run the same program in Debug mode by pressing the F7 key. Note that it will hang on the line "x = _DesktopWidth: y = _DesktopHeight" and you will never be able to step past that line.
I find it odd that the QB64pe screen would have to be displayed just to allow me to get the width and height of my actual display.
Is this expected behavior for some reason? If so, any workaround or possibility of a fix for this?
Code: (Select All)
$ScreenHide
x = _DesktopWidth: y = _DesktopHeight
'
' The foloowing lines serve no purpose other that to illustrate that the program
' will never reach those lines of code.
For z = 1 To 10
Next z
System
In this code, I am hiding the QB64pe screen until I take some actions based upon the size of the desktop on which the program is being run. As a result, I try to obtain the width and height of the desktop. However, the line "x = _DesktopWidth: y = _DesktopHeight" will simply hang forever.
If you execute the code above, it will look within the IDE as if the program runs and ends because you get access to the IDE again after running the program. However, if you look at task manager you will find that the program is still running:
As further proof of this, try to run the same program in Debug mode by pressing the F7 key. Note that it will hang on the line "x = _DesktopWidth: y = _DesktopHeight" and you will never be able to step past that line.
I find it odd that the QB64pe screen would have to be displayed just to allow me to get the width and height of my actual display.
Is this expected behavior for some reason? If so, any workaround or possibility of a fix for this?