From: "Mr A Appleyard" Organization: Materials Science Centre To: DJGPP AT delorie DOT com Date: Fri, 15 May 1998 11:10:38 GMT Subject: Strange mouse behaviour under Windows 95 Message-ID: Precedence: bulk I have just switched to Windows 95. I have run into these mouse effects:- In Windows applications, OK. If I run any DOS program from Shutdown, Restart in DOS mode, OK. But if I run a DOS program by calling it from Windows, or via the option `MSDOS Prompt' from the menu that appears when I click `Start':- Word Perfect 5.1 for DOS seems to obey the mouse very sluggishly but always or usually correctly. In Gnu C++ (v2) programs that I have:- CLEANUP.EXE does not use the mouse, and runs OK whatever I do with the mouse while it is running. SPATRL.EXE uses the mouse, and runs with the screen in a graphics mode, and runs OK. (It hooks interrupt 9.) AAEMACS.EXE uses the mouse, and runs with the screen in text mode 0x03. If called by clicking it in a folder display window, it drops out the first time I move the mouse even slightly. If called from a DOS prompt within Windows 95, it does not drop out but it moves the mouse pointer completely different from how I move the physical mouse. SPATRL.EXE and AAEMACS.EXE both hook the mouse with this function:- /*-----*/ void Mouse::settrap(uns int mask,void (*func)(Regs*)) { /* This is tricky in protected-mode. We must allocate a real-mode wrapper function which will be called by the mouse driver, and which in turn will switch to protected-mode and call our protected-mode handler function. */ if(!Jerry.nbuttons) return; if(!func) {Jerry.handlerInstalled=0; /* remove handler */ _go32_dpmi_free_real_mode_callback(&cb_info); R.dx=R.es=0;} else { /* Allocate real-mode call-back. Find real-mode address of handler */ cb_info.pm_offset=(uns long)func; Jerry.handlerInstalled=1; if(_go32_dpmi_allocate_real_mode_callback_retf(&cb_info, (__dpmi_regs*)&cb_regs)) return; R.dx=cb_info.rm_offset; R.es=cb_info.rm_segment;} R.ax=12; R.cx=mask; Int(0x33);}