delorie.com/archives/browse.cgi   search  
Mail Archives: djgpp/1998/05/27/06:58:16

From: "Anthony Appleyard" <MCLSSAA2 AT fs2 DOT mt DOT umist DOT ac DOT uk>
Organization: Materials Science Centre
To: DJGPP AT delorie DOT com
Date: Wed, 27 May 1998 11:57:13 GMT
Subject: Re: BUG in Gnu C++ (djgpp v2) mouse access under Windows 95
Message-ID: <1E3FA1454D1@fs2.mt.umist.ac.uk>

  I found why this fault happens.
  My event routine was reading the mouse coordinates thus:-

    Jerry.x=R->cx/8; Jerry.y=R->dx/8;

  where R->cx and R->dx are 4-byte, i.e. are really ECX and EDX.
  In DOS 6.22 and previous, and in plain DOS 7, I get away with this.
  But in Windows 95, this value of (mouse Y as supplied in EDX) contains
binary trash in its high two bytes. This alteration cured the trouble:-

    Jerry.x=(R->cx/8)&0xffff; Jerry.y=(R->dx/8)&0xffff;

- Raw text -


  webmaster     delorie software   privacy  
  Copyright © 2019   by DJ Delorie     Updated Jul 2019