Ignore:
Timestamp:
Mar 1, 2007, 12:31:13 AM (17 years ago)
Author:
イグトランス (egtra)
Message:

(拡張)メタファイル関数(全部)・構造体(一部)、BITMAPV4HEADERとそれに関連する型などの宣言

File:
1 edited

Legend:

Unmodified
Added
Removed
  • Include/basic/prompt.sbp

    r121 r123  
    3838
    3939_PromptSys_bInitFinish=0
    40 CreateThread( _
    41     0,
    42     0,
    43     AddressOf(PromptMain) As LPTHREAD_START_ROUTINE,
    44     0 As VoidPtr,
    45     0,
    46     _PromptSys_dwThreadID)
     40CreateThread(0, 0, AddressOf(PromptMain) As LPTHREAD_START_ROUTINE, 0, 0, _PromptSys_dwThreadID)
    4741Do
    4842    Sleep(20)
     
    135129            If buf[i2] = 9 Then 'tab
    136130                i3 = 8 - (.x And 7) '(.x mod 8)
    137                 Dim j As Long
    138                 Dim p = VarPtr(_PromptSys_Buffer[.y][.x]) As *Char
    139                 ' FillMemory(_PromptSys_Buffer[.y]+.x, i3, Asc(" "))
    140                 For j = 0 To ELM(i3)
    141                     p[j] = &h20 'Asc(" ")
    142                 Next
     131                _System_FillChar(VarPtr(_PromptSys_Buffer[.y][.x]), i3, &h20) 'Asc(" ")
    143132                i2++
    144133                .x += i3
     
    194183            Dim tm As TEXTMETRIC
    195184            Dim hOldFont=SelectObject(_PromptSys_hMemDC, _PromptSys_hFont) As HFONT
    196             GetTextExtentPoint32(_PromptSys_hMemDC, Ex" " As PCTSTR, 1, _PromptSys_FontSize)
     185            GetTextExtentPoint32(_PromptSys_hMemDC, " " As PCTSTR, 1, _PromptSys_FontSize)
    197186            GetTextMetrics(_PromptSys_hMemDC, tm)
    198187            SelectObject(_PromptSys_hMemDC, hOldFont)
     
    215204                    With CompForm
    216205                        .dwStyle = CFS_POINT
    217                         .ptCurrentPos.x = _PromptSys_CurPos.x*_PromptSys_FontSize.cx
    218                         .ptCurrentPos.y = _PromptSys_CurPos.y*_PromptSys_FontSize.cy
     206                        .ptCurrentPos.x = _PromptSys_CurPos.x * _PromptSys_FontSize.cx
     207                        .ptCurrentPos.y = _PromptSys_CurPos.y * _PromptSys_FontSize.cy
    219208                    End With
    220209                    ImmSetCompositionWindow(hIMC, CompForm)
     
    223212                ImmReleaseContext(hWnd, hIMC)
    224213
    225                 CreateCaret(hWnd,NULL,9,6)
     214                CreateCaret(hWnd, NULL, 9, 6)
    226215                SetCaretPos(_PromptSys_CurPos.x*_PromptSys_FontSize.cx, _
    227216                    (_PromptSys_CurPos.y+1)*_PromptSys_FontSize.cy-7)
     
    256245                    Dim pTemp = GlobalLock(hGlobal) As PCSTR
    257246#ifdef UNICODE 'A版ウィンドウプロシージャ用
    258                     Dim tempSizeW = MultiByteToWideChar(CP_ACP, 0, pTemp, -1, 0, 0) + 1
     247                    Dim tempSizeA = lstrlenA(pTemp)
     248                    Dim tempSizeW = MultiByteToWideChar(CP_ACP, 0, pTemp, tempSizeA, 0, 0) + 1
    259249                    TempStr = ZeroString(tempSizeW)
    260                     MultiByteToWideChar(CP_ACP, 0, pTemp, -1, StrPtr(TempStr), tempSizeW)
     250                    MultiByteToWideChar(CP_ACP, 0, pTemp, tempSizeA, StrPtr(TempStr), tempSizeW)
    261251#else
    262252                    TempStr = ZeroString(lstrlen(pTemp) + 1)
     
    335325    'Regist Prompt Class
    336326    Dim wcl As WNDCLASSEX
    337     FillMemory(VarPtr(wcl),Len(wcl),0)
    338     wcl.cbSize=Len(wcl)
    339     wcl.hInstance=GetModuleHandle(0)
    340     wcl.style=CS_HREDRAW or CS_VREDRAW or CS_DBLCLKS
    341     wcl.hIcon=LoadIcon(NULL,MAKEINTRESOURCE(IDI_APPLICATION))
    342     wcl.hIconSm=LoadIcon(NULL,MAKEINTRESOURCE(IDI_WINLOGO))
    343     wcl.hCursor=LoadCursor(NULL,MAKEINTRESOURCE(IDC_ARROW))
    344     wcl.lpszClassName="PROMPT"
    345     wcl.lpfnWndProc=AddressOf(PromptProc)
    346     wcl.hbrBackground=GetStockObject(BLACK_BRUSH)
     327    ZeroMemory(VarPtr(wcl), Len(wcl))
     328    With wcl
     329        .cbSize = Len(wcl)
     330        .hInstance = GetModuleHandle(0)
     331        .style = CS_HREDRAW or CS_VREDRAW' or CS_DBLCLKS
     332        .hIcon = LoadIcon(NULL, MAKEINTRESOURCE(IDI_APPLICATION))
     333        .hIconSm = LoadIcon(NULL, MAKEINTRESOURCE(IDI_WINLOGO))
     334        .hCursor = LoadCursor(NULL, MAKEINTRESOURCE(IDC_ARROW))
     335        .lpszClassName = "PROMPT"
     336        .lpfnWndProc = AddressOf(PromptProc)
     337        .hbrBackground = GetStockObject(BLACK_BRUSH)
     338    End With
    347339    Dim atom = RegisterClassEx(wcl)
    348340
    349341    'Create Prompt Window
    350342    _PromptSys_hWnd=CreateWindowEx(WS_EX_CLIENTEDGE,atom As ULONG_PTR As PCSTR,"BASIC PROMPT",WS_OVERLAPPEDWINDOW,CW_USEDEFAULT,CW_USEDEFAULT,CW_USEDEFAULT,CW_USEDEFAULT,0,0,GetModuleHandle(0),0)
    351     ShowWindow(_PromptSys_hWnd,SW_SHOW)
     343    ShowWindow(_PromptSys_hWnd, SW_SHOW)
    352344    UpdateWindow(_PromptSys_hWnd)
    353345
    354     Dim msg As MSG, iResult As Long
     346    Dim msg As MSG
    355347    Do
    356         iResult=GetMessage(msg,0,0,0)
    357         If iResult=0 or iResult=-1 Then Exit Do
     348        Dim iResult = GetMessage(msg, 0, 0, 0)
     349        If iResult = 0 or iResult = -1 Then Exit Do
    358350        TranslateMessage(msg)
    359351        DispatchMessage(msg)
     
    392384    If num=1 or num=3 Then
    393385        'Clear the text screen
    394         For i=0 To 100
    395             FillMemory(_PromptSys_Buffer[i],255,0)
     386        For i = 0 To 100
     387            _System_FillChar(_PromptSys_Buffer[i],255,0)
    396388        Next
    397         _PromptSys_CurPos.x=0
    398         _PromptSys_CurPos.y=0
     389        With _PromptSys_CurPos
     390            .x = 0
     391            .y = 0
     392        End With
    399393    End If
    400394
     
    488482    If y<0 Then y=0
    489483    If y>100 Then y=100
    490 
    491     _PromptSys_CurPos.x=x
    492     _PromptSys_CurPos.y=y
    493 
     484    With _PromptSys_CurPos
     485        .x = x
     486        .y = y
     487    End With
    494488    i=0
    495489    While _PromptSys_Buffer[y][i]
     
    497491    Wend
    498492
    499     If i<x Then
    500         FillMemory(_PromptSys_Buffer[y]+i,x-i,Asc(" "))
    501         For i2=i To x-1
    502             _PromptSys_BackColor[y][i2]=-1
     493    If i < x Then
     494        _System_FillChar(VarPtr(_PromptSys_Buffer[y][i]), x - i, &h20) 'Asc(" ")
     495        For i2 = i To x - 1
     496            _PromptSys_BackColor[y][i2] = -1
    503497        Next
    504498    End If
Note: See TracChangeset for help on using the changeset viewer.