Changing Focus from QuickWin Using the Windows APILast reviewed: July 17, 1995Article ID: Q124027 |
The information in this article applies to:
SUMMARYThis article shows by example how to use Windows API calls to switch focus between windows. There are 2 concerns with adding functionality to a QuickWin application with the Windows API.
MORE INFORMATIONThe following QuickWin program creates a text window and a graphics window, sets focus to the text window, waits for the user response, and then returns focus to the graphics window. This example assumes that the QuickWin Graphics Library update has been made. To install the graphics update, follow the instructions in the README.TXT file on the installation disk labelled "Microsoft FORTRAN, QuickWin Graphics Library" (NOTE: The "QuickWin Graphics Library" is in fine print.)
Sample CodeC Compile options needed: /MW C Link with modified library LLIBFEW.LIB
interface to integer*2 function getfocus + [PASCAL,alias:'GetFocus']() end interface to integer*2 function setfocus + [PASCAL,alias:'SetFocus'](i) integer*2 i end include'fgraph.fi' include'fgraph.fd' integer*2 i, texthandle, graphicshandle, getfocus, setfocusC Get handle for the current window (assumed to be the text window) texthandle = getfocus()C Create graphics window and get it's handle i=setvideomode($sres256color)C This is NOT the same handle as returned from WGGETACTIVEQQ graphicshandle=getfocus()C Set focus to text window i = setfocus(texthandle) write(*,*) "Hit <Enter> to continue" read(*,*)C Set focus to graphics window i=setfocus(graphicshandle) end |
Additional reference words: kbinf 5.10
© 1998 Microsoft Corporation. All rights reserved. Terms of Use. |