Re: dos wait loop

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

Tone *koda wrote:
> 
> i mean it has to be possible. how does wait_key() do it?
> i want for dos (console) program to wait for a message from windows program.
> 
> it would work perfectly if i could simulate keypress, then i could use getc(0)
> which
> would do all three things: 1) wait for a "message" 2) it wouldn slow the
> operating
> system down 3) it would pause its program execution.
> 
> 
> Tone *koda wrote:
> > 
> > how can i in dos program make it so that following loop won't slow the
> > system down:
> > 
> > while 1 do
> >  -- on every half a second check something
> > end while
> > 
> > in windows i can use timer to achieve this functionality, is there something
> > similar
> > in dos?
> > 
> > 
> > btw, does anyone know of a library for communication between dos and windows
> > program?
> > or how it 
> > 
> > can be done, besides via a file?
> >
> 

AFAIK, it's not possible to pause a dos program so it doesn't use any cpu, 
because dos is not a multitasking os. You'd have to "contact" windows in some
way, but I dunno how you'd do that. What you want is to tell windows to
do something that it normally just does for windows programs.

Regards, Alexander Toresson

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

Search



Quick Links

User menu

Not signed in.

Misc Menu