by Ryo » 2006年7月02日(日) 18:07
コード: 全て選択
Sub MainWnd_Create ( ByRef CreateStruct As CREATESTRUCT )
Dim FullPath As BytePtr
Dim NameByte As Integer
Dim FileName As BytePtr
FullPath = malloc ( 24 )
lstrcpy ( FullPath , "C:\WINDOWS\explorer.exe" )
NameByte = GetFileTitle ( FullPath , FileName , 0 )
FileName = malloc ( NameByte )
GetFileTitle ( FullPath , FileName , NameByte )
SetWindowText ( hMainWnd , FileName )
free ( FileName )
End Sub
こんな感じでどうでしょうか?
#この処理を関数化しようと試みましたが上手くいきませんでした。
#String型でなら関数化出来たんですがString型は嫌いなので・・・。
[code] Sub MainWnd_Create ( ByRef CreateStruct As CREATESTRUCT )
Dim FullPath As BytePtr
Dim NameByte As Integer
Dim FileName As BytePtr
FullPath = malloc ( 24 )
lstrcpy ( FullPath , "C:\WINDOWS\explorer.exe" )
NameByte = GetFileTitle ( FullPath , FileName , 0 )
FileName = malloc ( NameByte )
GetFileTitle ( FullPath , FileName , NameByte )
SetWindowText ( hMainWnd , FileName )
free ( FileName )
End Sub[/code]
こんな感じでどうでしょうか?
#この処理を関数化しようと試みましたが上手くいきませんでした。
#String型でなら関数化出来たんですがString型は嫌いなので・・・。