www.digitalmars.com         C & C++   DMDScript  

c++.windows.32-bits - Console I/O with the Win32 API

reply "Kenneth Roger" <kennethroger prodigy.net> writes:
Some common conio functions are attached for those of you who wonder how
WordStar could be written using the win32 API (no dos interrupts).
Functions like gotoxy(), insline(), and delline() needed, but aren't in
standard C.

Credits are in the package.


begin 666 yyconio.zip
M4$L#!!0````(`*E[7BM56ZIOAP,``#L'```)`!$`>7EC;VYI;RYH550-``?.
M-]\[`%[>._0=WCN554V/VS80O1?H?Q XA] +2XDW0(!- *"(4S1!LEV NTB1
MDT&1(XDP30HDM;;ZZSM#ZF,W0 \]2:3FS<>;-Z,7NK8*:S <?OS8W_WYY>[P
M^7#X]9<7=*<M_GQ-'W2=S3_=[I\:RLYK&VO(#[I'JW3-B%>O0+K3R5EZ6.V 
M[JV,VMD`L141A$?[,H*V$**P2G %^P1Z:!'.VKZY!M%IT 'Z &I+(/3(*+ .
ME N$C.A]W\50)MP](JRD1Z5C6 %%( 10-N!J>B4_M398CIGM*0]G$-:7[;#A
M(.O==K>94&N#==Q&UVV2_:/3"AH7W6584U2X;#DX#)OWXS=I?)!^_?2,SBQG
M;8,ALI8+A6:^8%=G+N[R_#C,QP9CQ$O,L7=C\/%YN1[/])2M\'!5]?4$[/H$
MA/^/I)"R73\[72<O5Z'5Q$U"7LGHS?CZ>&3CQ.V(!8^Q]ZG=U+< M89'87K,
M_4 XXD#8&H0=RKGQ=-EY#(%;8ET$E*U#!=$E")&,:$N +S7\ ]ZQ58Y""DD^
M2"MS?-$(S<;L-R")4(W&#,ON!(M3<7K HB4'M7>G15JP>]O.PH7=Z[9\6N,U
M!S'!_6>E:^=3GAL2=&Q=G^O1MED*%K[I3VAC %5BEI1+>:Z8V=64;FU$0_(E
M9WW7H0<IJ$HR2TXXYIZLF3H>I8A;6#T>5\^2RO/T_>MAJ9F(^>ABRY_S1( N
M?'/RF.+?<RJ+QY#FCA ,6I$R59I:$B55,J4]$4.=F?BG?&>:6F*XHMY1[L;P
M.'/*Q7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z()N X(<.60NT&F -
MT$: %J ?`$6,'A.-DNXSRM\&A$G_(=!30!WX[ #Z`] (T,= <T#.+$(>!:H`
MV VT%V ?4"?0LT"_`'H-Z!30(- PT-^!IH'F 4AWF&B_ ^UHOT'X-<*O$'H1
M?H;P4X3G$9Y%.(9P%*$+X4<(!Q$.(+0AB  M"$&$)H1&A.\"D)ZMA'X$KK$=
M=F [K-%;HQ-YI\X?1OZ.=(OIIY=TKR#:.DB[MA(A!X% %8Z8SS;S^V3CDJ'_
M^*&71UAY\LG]1F0/WF+CX8HEO[%I^DU&2>JI1M./,;KHC447/=D8;_RHI^D7
M&C6?9W1IB)]__\-O+3NNQ =UO^>6^7R$S7;COP16T]L]PVCJ 473[RYJ/L4_
MK^C_\_<O4$L!`A<+% ```` `J7M>*U5;JF^'`P``.P<```D`"0```````0` 
M`+:!`````'EY8V]N:6\N:%54!0`'SC??.U!+`0(7"Q0````(`,Q[7BL+MC %
MM  ``', ```)``D```````$`( "V ;\#``!Y>6-O;FEO+F-55 4`!Q XWSM0
M2P$"%PL4````" #5>UXKV9BC(V8(````$ ``"P`)`````````" `MH&K# ``
J>7EC;VYI;RYL:6)55 4`!R(XWSM02P4&``````,``P#"````2Q4`````
`
end
Oct 30 2001
parent "Walter" <walter digitalmars.com> writes:
Thank-you!

"Kenneth Roger" <kennethroger prodigy.net> wrote in message
news:9ro1dl$15th$1 digitaldaemon.com...
 Some common conio functions are attached for those of you who wonder how
 WordStar could be written using the win32 API (no dos interrupts).
 Functions like gotoxy(), insline(), and delline() needed, but aren't in
 standard C.

 Credits are in the package.
Oct 31 2001