Re: Machile level exception

new topic     » goto parent     » topic index » view thread      » older message » newer message
doncole2009 said...
bernie said...
doncole2009 said...
 
 
constant  FIRST_INDEX=1050, 
          LAST_INDEX=1052 
procedure check(integer self, integer event, sequence params)  
?event 
?params[1] 
?params[2] 
    if params[1]=120 then--f9 
         showWindow(Window1,SW_MINIMIZE) 
    elsif params[1]=121 then--f10 
         showWindow(Window1,SW_NORMAL)   
    end if 
 
-- clear the buffer 
-- poke( FIRST_INDEX, peek( LAST_INDEX ) ) this dosen't work I qet a machine level     execption 
end procedure 
setHandler(Screen,w32HKeyDown,routine_id("check")) 
 

This only works once on all further keyDowns nothing happens.

Don Cole

Don:
First maybe it would help if you said what you were trying to do ?
What the heck is the FIRST_INDEX, LAST_INDEX suppose to represent ?

Thank you Bernie,

FIRST_INDEX and LAST_INDEX represent the keyboard buffer as per keys.e

On further review I have found that the machine level execption occures because I am trying to use a dos (.ex) program in a window (.exw) program.

What I am trying to do is this:

Press F9 and SW_HIDE the window. Press F10 and have the window reappear. Somewhere in between the keyboard buffer must be cleared.

poke( FIRST_INDEX, peek( LAST_INDEX ) ) works in dos but not in windows.

So what I don't know how to do is clear the keyboard buffer in windows.

Don Cole

Don:

Set your handler to watch w32HKeyPress ( WM_CHAR message )

and when you see F9 ( code is #78 ) then hide the window.

when you see F10 ( code is #79 ) then show the window.

Bernie

new topic     » goto parent     » topic index » view thread      » older message » newer message

Search



Quick Links

User menu

Not signed in.

Misc Menu