cfgmacro.c
来自「包括文件操作、图形系统、并口串口编程、鼠标编程、小型cad系统、编译器、病毒防火」· C语言 代码 · 共 66 行
C
66 行
#include <io.h>
#include <stdio.h>
#include <stdlib.h>
#include <string.h>
#include "tdecfg.h"
#include "cfgmacro.h"
extern struct vcfg cfg;
extern FILE *tde_exe;
extern long macro_offset;
static WINDOW *w_ptr;
MACRO macros;
void tdemacro( void )
{
int c;
char fname[82];
FILE *macro_file;
cls( );
show_box( 0, 0, macro_screen, NORMAL );
xygoto( 42, 14 );
c = getkey( );
while (c != '1' && c != '2')
c = getkey( );
if (c == '1') {
puts( "" );
puts( "" );
puts( "" );
puts( "Enter file name that contains the macro definitions :" );
gets( fname );
if ((c = access( fname, EXIST )) != 0) {
puts( "\nFile not found. Press any key to continue." );
c = getkey( );
cls( );
return;
} else if ((macro_file = fopen( fname, "rb" )) == NULL ) {
puts( "\nCannot open macro file. Press any key to contine." );
c = getkey( );
cls( );
return;
}
fread( (void *)¯os.first_stroke[0], sizeof(int), MAX_KEYS, macro_file );
fread( (void *)¯os.strokes[0], sizeof(STROKES), STROKE_LIMIT, macro_file );
fseek( tde_exe, macro_offset + 8, SEEK_SET );
fwrite( (void *)¯os.first_stroke[0], sizeof(int), MAX_KEYS, tde_exe );
fwrite( (void *)¯os.strokes[0], sizeof(STROKES), STROKE_LIMIT, tde_exe );
fclose( macro_file );
puts( "" );
puts( "" );
puts( "" );
puts( "New macros successfully installed. Press any key to continue." );
c = getkey( );
}
cls( );
}
⌨️ 快捷键说明
复制代码Ctrl + C
搜索代码Ctrl + F
全屏模式F11
增大字号Ctrl + =
减小字号Ctrl + -
显示快捷键?