getmouse fails after reset (0)

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

Re: getmouse fails after reset (0)

Postby nedman47 » Mar 11, 2017 18:25

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
Posts: 9618
Joined: Apr 22, 2009 12:46
Location: Paris suburbs, FRANCE

Re: getmouse fails after reset (0)

Postby fxm » Mar 11, 2017 19:47

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: 714
Joined: May 05, 2015 5:35
Location: Germany

Re: getmouse fails after reset (0)

Postby grindstone » Mar 11, 2017 19:53

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)

Postby nedman47 » Mar 12, 2017 1:29

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

Re: getmouse fails after reset (0)

Postby fxm » Mar 12, 2017 6:38

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)

Postby nedman47 » Mar 12, 2017 20:02

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

Return to “Windows”

Who is online

Users browsing this forum: No registered users and 2 guests