Lost Focus
Blitz3D Forums/Blitz3D Beginners Area/Lost Focus
| ||
Does B3d have the equivalent of the command to detect whether it's window has 'lost focus'...ie, the user has clicked the desktop or minimised the window? |
| ||
;;;;; user32.decls ;;;;; ; .lib "user32.dll" ; ; api_HasFocus%() : "GetActiveWindow" ; api_IsIconic% (hwnd%) : "IsIconic" ;;;;;;;;;;;;;;;;;;;;;;;; Global hwnd=SystemProperty("apphwnd") Graphics3D 800,600,0,2 Repeat Cls RenderWorld If api_HasFocus()<>hwnd txt$="window lost focus" Else txt$="window has focus" EndIf If api_IsIconic(hwnd) AppTitle"minimized" Else AppTitle"windowed" EndIf Text 10,10,txt$ Flip Until KeyHit(1) End |
| ||
How iconic! ;) |
| ||
Ummm...is there an active link to these fabled decls? LOL |
| ||
User32.decls |
| ||
Hi Chi! The IsIconic Decl is there, but the api_HasFocus is not Am I missing something? |
| ||
if its not inside user32.decls... then add it ;) api_HasFocus%() : "GetActiveWindow" |
| ||
Apologies for not getting back to you sooner, Chi. My thanks for all your input...I have it working now that I understand the use of DECLS. *big smile* |
| ||
your welcome ;) |