// メインウィンドウ上のコントロール
#define ID_EDIT1 401 // 本体
#define ID_TRACK 402 // ダイアログ上じゃない? (↑うそつき)
#define ID_FONTTOOLBAR 403 // フォント変更用ツールバー
//--CONFIG1
#define IDC_CF1_DIALNUMBER 101
#define IDC_CF1_SELECTMDM 102
#define IDC_CF1_SELECTFONT 103
#define IDC_CF1_SHOWSBAR 104
#define IDC_CF1_FONTSIZE 105
#define IDC_CF1_UPDOWNFONT 106
#define IDC_CF1_PULSE 107
#define IDC_CF1_NEW_STATIC1 108
#define IDC_CF1_NEW_STATIC2 109
#define IDC_CF1_NEW_STATIC3 110
#define IDC_CF1_NEW_STATIC4 111
#define IDC_CF1_MMWIDTH 112
#define IDC_CF1_MMHEIGHT 113
#define IDC_CF1_INVALPIXELS 114
#define IDC_CF1_ZOOM 115
#define IDC_CF1_UPDOWN2 116
#define IDC_CF1_PAGENUMBER 117
#define IDC_CF1_UPDOWN3 118
#define IDC_CF1_NEW_STATIC5 119
#define IDC_CF1_UPBLANK 120
#define IDC_CF1_RLBLANK 121
#define IDC_CF1_SEND 122
#define IDC_CF1_ENDAPP 123
#define IDC_CF1_UPDATE 124
#define IDC_CF1_STATUS1 125
#define SbarSetText( wp , text ) \
SendDlgItemMessage( hCf1 , IDC_CF1_STATUS1 , SB_SETTEXT , ( WPARAM )(wp) , (LPARAM)(text) ) ;
#define IDC_CF1_CHECK_PARTIALMM 126
#define IDC_CF1_TESTMM 127
#define IDC_CF1_TRACK_TESTMM 128
#define IDC_CF1_STOP 129
#define IDC_CF1_NEW_STATIC6 130
#define IDC_CF1_STARTCAPTURE 131
#define IDC_CF1_CLEARCAPTURE 132
#define IDC_CF1_CF2 133
#define IDC_CF1_FINE_OR_NORMAL 134
#define IDC_CF1_SENDALL 135
#define IDC_CF1_POPUPFACE 136
#define IDC_CF1_LOAD 137
#define IDC_CF1_SAVE 138
#define IDC_CF1_FIXFORMAT 139
#define ID_CF1_POPEDIT 199
#define ID_CF1_PROGRESS 200
#define IDM_CF1_DISPLAYFONTINFO 1001
#define IDM_ENTRY 1002
#define IDM_CF1_REFRESHPARAMS 1003
#define IDM_CF1_FONTFACES_BEGIN 2000
#define NUMFACES 256
#define IDM_CF1_FONTFACES_END_DUMMY ( IDM_CF1_FONTFACES_BEGIN + NUMFACES -1 )
#define IDC_CF1_PAYMENT 3000
#define IDM_UNDO 101
#define IDM_CUT 102
#define IDM_COPY 103
#define IDM_PASTE 104
#define IDM_CLEAR 105
#define IDM_SELECTALL 106
#define IDM_ULINE 107
#define IDM_BOLD 108
#define IDM_ITALIC 109
#define IDM_STRIKE 110
#define IDM_SUP 111
#define IDM_SUB 112
#define IDM_FONT_PARTIAL 115
#define IDM_REDO 116
#define IDM_SEND 117
#define IDM_SWITCHTOOLBAR 120
#define IDM_HIDETOOLBAR 121
#define IDM_SHOWTOOLBAR 122
//--CONFIG2
#define IDC_CFA_STATIC1 101
#define IDC_CFA_EDIT1 102
#define IDC_CFA_STATIC2 103
#define IDC_CFA_EDIT2 104
#define IDC_CFA_STATIC3 105
#define IDC_CFA_STATIC4 106
#define IDC_CFA_EDIT3 107
#define IDC_CFA_STATIC5 108
#define IDC_CFA_INTERNATIONAL 109
//--
//--CONFIG3
#define IDC_CFB_GROUP1 101
#define IDC_CFB_CURPAGE 102
#define IDC_CFB_ALLPAGE 103
#define IDC_CFB_PAGESAFTER 104
#define IDC_CFB_NORMAL 105
#define IDC_CFB_FINE 106
#define IDC_CFB_COMPRESS2 107
#define IDC_CFB_COMPRESS4 108
#define IDC_CFB_PREVIEW 109
//--
//--PAYMENTDIALOG
#define IDC_PAYMENT_STATIC1 101
#define IDC_PAYMENT_STATIC2 102
#define IDC_PAYMENT_EDIT1 103
//--
#define InitVARSTRING_TYPE( proto , vptr , over ) \
(vptr) = (proto *)calloc( sizeof( proto ) + ( over ) ,1 ) ; \
(vptr)->dwTotalSize = sizeof( proto ) + ( over )
#define LINEUSETOTALSIZE_SANDWICH( proto , vptr , over ) \
InitVARSTRING_TYPE( proto , (vptr) , (over) ) ; \
while( LINEERR_STRUCTURETOOSMALL == (DWORD)(
#define LINEUSETOTALSIZE_SANDWICH_( proto , vptr ) \
) \
|| (vptr)->dwTotalSize < (vptr)->dwNeededSize ) \
{ int dwSize = (vptr)->dwNeededSize ; \
(vptr) = (proto *)realloc( (proto *)(vptr) , dwSize ) ; \
memset( (vptr), 0 , dwSize ) ; \
(vptr)->dwTotalSize = dwSize ; \
}
#include <stdio.h>
char *fmt( char *format , ... ) ;
char *fmt( char *format , ... )
{
static char buf[ 1024 ] ;
static char *pbuf = NULL ;
if( ! pbuf || 256 < pbuf - buf ) pbuf = buf ;
va_list argx ; va_start( argx , format ) ;
vsprintf( pbuf , format , argx ) ;
va_end( argx ) ;
int len = strlen( pbuf ) ;
if( len < 256 ) len ++ ;
else len = 0 ;
pbuf += len ;
return (char *) pbuf - len ;
}
//--
//ツールバー用追加マクロ
#define CheckToolButton( hwndtoolbar , idbutton , fCheck ) \
SendMessage( (HWND)hwndtoolbar , TB_CHECKBUTTON , (WPARAM)(idbutton) , MAKELONG( (fCheck) , 0 ) )
#define IsToolButtonChecked( hwndtoolbar , idbutton ) \
SendMessage( (HWND)hwndtoolbar , TB_ISBUTTONCHECKED , (WPARAM)(idbutton) , 0L )
#define ToolBar_InsertButton( htool , ibtn , ptbbtn ) \
SendMessage( (htool) , TB_INSERTBUTTON , (ibtn) , ( LPARAM ) (ptbbtn) )
#define ToolBar_DeleteButton( htool , ibtn ) \
SendMessage( (htool) , TB_DELETEBUTTON , (ibtn) , 0 )
#define ToolBar_GetExtendedStyle( htool ) \
SendMessage( (htool) , TB_GETEXTENDEDSTYLE , 0L , 0L )
#define ToolBar_SetExtendedStyle( htool , dwexstyle ) \
SendMessage( (htool) , TB_SETEXTENDEDSTYLE , 0L , (dwexstyle) )
#define ToolBar_GetRect( htool , iItem , lprc ) \
SendMessage( (htool) , TB_GETRECT , (WPARAM)(iItem) , (LPARAM)(lprc) )
//--
/* -- this is garbage...
// GARBAGE 1
LRESULT CALLBACK PrvDialogProc( HWND hWnd, UINT msg, WPARAM wp, LPARAM lp )
{
switch( msg ) {
case WM_INITDIALOG :
return TRUE ;
case WM_PAINT :
if( ! _hBitmap1728 )
break ;
{ HDC hdc ; //= (HDC)wp ;
PAINTSTRUCT ps ;
// BOOL bret = GetUpdateRect( hWnd , NULL , FALSE ) ;
// if( bret )
hdc = BeginPaint( hWnd , &ps ) ;
if( ! hdc ) break ;
HDC hdc_mem = CreateCompatibleDC( hdc ) ;
SelectObject( hdc_mem , _hBitmap1728 ) ;
RECT rc ; GetClientRect( hWnd , &rc ) ;
StretchBlt( hdc , 0 , 0 , rc.right , rc.bottom ,
hdc_mem , 0 , 0, 1728 , 297 * 4 * 2 , SRCCOPY ) ;
if( hdc_mem ) DeleteDC( hdc_mem ) ;
// if( bret )
EndPaint( hWnd , &ps ) ;
return 0L ;
}
break ;
case WM_COMMAND :
switch( LOWORD( wp ) ) {
case IDCANCEL :
break ;
default :
break ;
}
break ;
case WM_NOTIFY :
break ;
case WM_CLOSE :
DestroyWindow( hWnd ) ;
break ;
default :
break ;
}
return FALSE ;
}
// GARBAGE 2
DWORD ConstructOneLineProc
( char *plainbitstr , DWORD dwp1 , DWORD dwp2 )
{ // plainbitstr は 1 ライン分。
char bitstr_[2048] ; // 0と1 の文字列。
memset( bitstr_ , 0 , sizeof( bitstr_ )) ;
char *lp_bitstr_ ;
char sendbuffer[2048] ; memset( sendbuffer , 0 , sizeof( sendbuffer )) ;
lp_bitstr_ = stpcpy( bitstr_ , "00000000" "0001" ) ; // BOL だが == EOL
G3MHasBITSTR1728
( lp_bitstr_ , plainbitstr ,
sizeof( bitstr_ ) - strlen( bitstr_ )) ;
//if( fp_mhbits ) { fprintf( fp_mhbits , "--" ) ;
//fprintf( fp_mhbits , bitstr_ ) ; }
// 面倒なので , 8 こ以上 0 をつける。( DLE の検出が正しく行われるために。)
lp_bitstr_ += strlen( lp_bitstr_ ) ;
lp_bitstr_ = stpcpy( lp_bitstr_ , "00000000" ) ;
while( (lp_bitstr_ - bitstr_ ) % 8) *lp_bitstr_ ++ = '0' ;
if( strstr( bitstr_ , "00001000" )) {
//if( fp_mhbits ) {
//fprintf( fp_mhbits , " [ cnt. <DLE> ]" ) ;
//Edit_ReplaceSel( hEditLog , "<DLE> detected \r\n" ) ; }
// doubles <DLE>
for( char *lpdle = strstr( bitstr_ , "00001000" ) ;
lpdle ; lpdle = strstr( lpdle , "00001000" ) )
{ if( (lpdle - bitstr_ ) % 8 ) { lpdle ++ ; continue ; }
memmove( lpdle + 8 , lpdle , strlen( lpdle ) ) ;
if( strncmp( lpdle , "00001000" , 8 ))
memcpy( lpdle , "00001000" , 8 ) ; lpdle += 16 ;
}
}
// if( fp_mhbits ) fprintf( fp_mhbits , "\r\n" ) ;
memcpy( sendbuffer , digitstring_toint8(
bitstr_ ) , strlen( bitstr_ ) / 8 + 1 ) ;
int n_zeropad_bytes = 48 ; // 80 bytes = 9600 bps で、0.066 秒分。66 msec. > 20 msec .
// 24 bytes for 20 msec
memset( sendbuffer + strlen( bitstr_ ) / 8 + 1 ,
0 , n_zeropad_bytes ) ; // zero-padding している。
int nEol = 1 ; // ※メモ 2 は不可 ! , 0 だと、一ラインごとに飛んで高さが半分になる。
if( HIWORD( dwp1) == HIWORD(dwp2 ) -1 ) nEol += 14 - nEol ; // +3 ; // RTC + DLE + ETX を付加する場合。
memcpy( sendbuffer + strlen( bitstr_ ) / 8 + 1 + n_zeropad_bytes ,
digitstring_toint8(
"00000000" "00000001" "00000000" // nEol = 3 の場合はこの3つだけとなる。
"00010000" "00000001" "00000000"
"00010000" "00000001" "00000000" "00010000"
"00000001"
"00001000" "11000000" "00000000" // DLE ETX // 0 が必要 !! ?
) , nEol ) ;
// EOL 付加。次の送信に備えるため、NULL も付加。
int cbOneLine =
strlen( bitstr_ ) / 8 + 1 + n_zeropad_bytes + nEol ;
if( HIWORD( dwp1) != HIWORD(dwp2 ) -1 ) {
//{ // this is test for black1728 (w0b1728) you can see the effect of 副走査線 (sub scan line)
//memcpy( sendbuffer + cbOneLine ,
// digitstring_toint8( "00000001" "00110101" "00000011" "00101000" "0110111" "0" ) , 4 ) ;
//cbOneLine += 5 ;
//}
#ifdef MHCHECKINGMODE
{ // this is for white1728
memcpy( sendbuffer + cbOneLine ,
digitstring_toint8( "00000001" "010011011" "00110101" "0000000" ) , 4 ) ;
cbOneLine += 4 ;
}
memset( sendbuffer + cbOneLine , 0 , 24 ) ;
cbOneLine += 24 ;
#endif
}
memcpy( lpadd , sendbuffer , cbOneLine ) ;
lpadd += cbOneLine ;
return 1L ;
}
*/