mirror of
https://github.com/QB64Official/qb64.git
synced 2024-07-03 08:51:22 +00:00
Added function _SCREENICON to tell us if the window has been minimized to the taskbar (Iconified)
This commit is contained in:
parent
8ee2353cbf
commit
7fb1db97f6
|
@ -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 ();
|
|
@ -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.
|
||||
}
|
|
@ -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
|
||||
|
||||
|
|
Loading…
Reference in a new issue