1
1
Fork 0
mirror of https://github.com/QB64-Phoenix-Edition/QB64pe.git synced 2024-07-03 11:11:20 +00:00

Added function _SCREENICON to tell us if the window has been minimized to the taskbar (Iconified)

This commit is contained in:
SMcNeill 2015-08-08 12:50:45 -04:00
parent 8ee2353cbf
commit 7fb1db97f6
3 changed files with 34 additions and 1 deletions

View file

@ -30,4 +30,5 @@ double func_csch (double num);
double func_coth (double num);
double func_sec (double num);
double func_csc (double num);
double func_cot (double num);
double func_cot (double num);
int32 func_screenicon ();

View file

@ -21,3 +21,26 @@ int32 func_windowexists () {
int32 func__controlchr () {
return -no_control_characters2;
}
int32 func_screenicon () {
while (!window_exists){Sleep(100);}
extern int32 screen_hide;
if (screen_hide) {error(5); return 0;}
#ifdef QB64_WINDOWS
#include <windows.h>
extern HWND window_handle;
return -IsIconic(window_handle);
#else
#include <X11/X.h>
#include <X11/Xlib.h>
extern Display *X11_display;
extern Window X11_window;
extern int32 screen_hide;
XWindowAttributes attribs;
while (!(X11_display && X11_window));
XGetWindowAttributes(X11_display, X11_window, &attribs);
if (attribs.map_state == IsUnmapped) return -1;
return 0;
#endif
return 0; //if we get here and haven't exited already, we failed somewhere along the way.
}

View file

@ -319,3 +319,12 @@ id.ret = FLOATTYPE - ISPOINTER
id.Dependency = DEPENDENCY_USER_MODS
regid
clearid
id.n = "_SCREENICON"
id.subfunc = 1
id.callname = "func_screenicon"
id.args = 0
id.ret = LONGTYPE - ISPOINTER
id.Dependency = DEPENDENCY_USER_MODS
regid