Yesterday, 02:58
(This post was last modified: Yesterday, 03:11 by Dale Yarker.)
In a current project I'm using GRAPHIC WINDOW CLICK in a DO/LOOP.
(Is similar to MODELESS pump and CALLBACK but only clicks not Windows messages)
If I closed the window using right click on task bar icon compiling again failed because program is still running.
(needed to close using Task Manager)
The cure is API IsWindow (hWin) in the DO/LOOP.
I've found no way to monitor for mouse clicks in TXT.WINDOW. But there could be a DO/LOOP.
Use CON.MOUSE and CON.HANDLE for the above to work in PBCC.
PBWIN has function ISWIN, but GRAPHIC WINDOW and TXT.WINDOW can also be created in PBCC which doesn't.
related: Console programs can have a callback. See PBCC samples\Internet\TCP or \UDP.
(Is similar to MODELESS pump and CALLBACK but only clicks not Windows messages)
If I closed the window using right click on task bar icon compiling again failed because program is still running.
(needed to close using Task Manager)
The cure is API IsWindow (hWin) in the DO/LOOP.
Code:
'Mouse click "pump"
do
graphic window click to ClickState, PosX, PosY
' if ClickState then '<== to also check for double click
' sleep 550 'default Windows time 500, '<== for double click
' graphic window click to ClickState, dummy, dummy '<== for double click
ExitRequest = ClickProc( ClickState, PosX, PosY) '<== Exit clicked on window
if ExitRequest then exit function
if IsWindow (hGrafWin) = 0 then exit function '<== the cure!
' end if '<== for double click
sleep 100
loopUse CON.MOUSE and CON.HANDLE for the above to work in PBCC.
PBWIN has function ISWIN, but GRAPHIC WINDOW and TXT.WINDOW can also be created in PBCC which doesn't.
related: Console programs can have a callback. See PBCC samples\Internet\TCP or \UDP.
