getmouse fails after reset (0)

Windows specific questions.
nedman47
Posts: 62
Joined: Dec 05, 2006 15:35

Re: getmouse fails after reset (0)

Post by nedman47 »

I recently gained full control over the 16 color table entries. I can change any color in real time from inside a program, which normally you would do with the right-click-on-the-title-bar console host interface. So I'm convinced you can regain control of the mouse, or do pretty much anything to the console, if you just know the right win32 call to manipulate the right data structure. I thought it was SetConsoleMode and ENABLE_MOUSE_INPUT, but I
have not gotten that to work.
fxm
Moderator
Posts: 12081
Joined: Apr 22, 2009 12:46
Location: Paris suburbs, FRANCE

Re: getmouse fails after reset (0)

Post by fxm »

I only found this as workaround:

Code: Select all

#include "windows.bi"
dim as integer x,y,button
reset (0)
freeconsole()
allocconsole()
do
   getmouse x,y,,button
   print x, y, button
   sleep 100
loop
grindstone
Posts: 862
Joined: May 05, 2015 5:35
Location: Germany

Re: getmouse fails after reset (0)

Post by grindstone »

No problems here with WinXP32/sp3, FB 1.05.0/32
nedman47
Posts: 62
Joined: Dec 05, 2006 15:35

Re: getmouse fails after reset (0)

Post by nedman47 »

allocconsole () opens a new window but attachconsole (-1) reactivates the mouse in the existing console which is what I was looking for!
fxm
Moderator
Posts: 12081
Joined: Apr 22, 2009 12:46
Location: Paris suburbs, FRANCE

Re: getmouse fails after reset (0)

Post by fxm »

Yes, the sequence well working on my PC (Win7) is:

Code: Select all

.....
reset(0)
freeconsole()
attachconsole(-1)  ''(works from WinXP only!)
.....
nedman47
Posts: 62
Joined: Dec 05, 2006 15:35

Re: getmouse fails after reset (0)

Post by nedman47 »

Unfortunately attachconsole fails for me if the program is called from a batch file.
Post Reply