取得したドライブ名をエディットボックスに表示させたいのですが、
ドライブ名が文字化けしてしまいます。
どうすれば文字化けせずに表示されるのでしょうか?
[ここをクリックすると内容が表示されます]
AB: 5.00.00 (CP3)コード: 全て選択
' グローバル領域
Dim hEdit As HWND
Sub MainWnd_Create(ByRef CreateStruct As CREATESTRUCT)
hEdit[0]=GetDlgItem(hMainWnd,EditBox1)
hEdit[1]=GetDlgItem(hMainWnd,EditBox2)
hEdit[2]=GetDlgItem(hMainWnd,EditBox3)
hEdit[3]=GetDlgItem(hMainWnd,EditBox4)
hEdit[4]=GetDlgItem(hMainWnd,EditBox5)
hEdit[5]=GetDlgItem(hMainWnd,EditBox6)
Dim Size As DWord, n As Long
Dim buffer As BytePtr, hIcon As DWord
Dim Drive[10] As Byte, temp As DWord
Dim SetDrv[255] As Byte
'ドライブ一覧を取得
Size=GetLogicalDriveStrings(0,NULL)
buffer=malloc(Size+1)
GetLogicalDriveStrings(Size,buffer)
Size=0
Do
If buffer[Size]=NULL Then
If buffer[Size+1]=NULL Then Exit Do
lstrcpy(Drive,buffer+Size-3)
temp=GetDriveType(Drive)
If temp=DRIVE_FIXED Then
wsprintf(SetDrv,"Drive %s",Left$(Drive,1))
SetWindowText(hEdit[n],SetDrv)
n++
End If
End If
Size++
Loop
free(buffer)
End Sub