API見習い中のTOKOです・・
>例 declare function API_XYZ & lib "ABC" alias "XYZ" ( byval A$ , byval ・・・・ )
上記の場合
API_XYZと&の間に空白が入っていないとしてAPI_XYZ&は自由に変更することができます。
DLLの部分"ABC"および関数名"XYZ"は変数に置き換える人はいないでしょうが
#define Z$ "ABC"
#define W$ "XYZ"
declare function API_XYZ& lib Z$ alias W$ ( byval A$ , byval ・・・・ )でも動きます。
例えば下記のAPIをF-BASICで使いたい場合、
Public Declare Function CreateWindowEx Lib "user32" Alias "CreateWindowExA" _
(ByVal dwExStyle As Long, ByVal lpClassName As String, _
ByVal lpWindowName As String, ByVal dwStyle As Long, _
ByVal x As Long, ByVal y As Long, ByVal nWidth As Long, _
ByVal nHeight As Long, ByVal hWndParent As Long, _
ByVal hMenu As Long, ByVal hInstance As Long, lpParam As Any) As Long
TOKOさん
APIのDestroyWindowのご回答によりまして
作成後のビットマップボタンをプログラムで取り除く事ができました。
if (GETDLGITEM("Bmpbutton21"))<>0 then RET=winapi_DestroyWindow(GETDLGITEM("Bmpbutton21"))
お陰様で目的通りのものが出来ました。
心より厚くお礼を申しあげます。
本当にありがとうございました。
SUB SORT(TOTALCNT1&,ITI,ZYUN$)
SELECT CASE ZYUN$
CASE IS = "U"
for L& = TOTALCNT1& to 1 step -1
for J& = 1 to L& - 1
if SORTWORK1(J&, ITI) > SORTWORK1(J& + 1, ITI) then
for M = 1 to 6
swap SORTWORK1(J&, M), SORTWORK1(J& + 1, M)
next
endif
next
next
CASE IS = "D"
For L& = TOTALCNT1& to 1 step -1
for J& = 1 to L& - 1
if SORTWORK1(J&, ITI) < SORTWORK1(J& + 1, ITI) then
for M = 1 to SORTKOUMOKU
swap SORTWORK1(J&, M), SORTWORK1(J& + 1, M)
next
endif
next
next
END SELECT
ENDSUB
open "sort.txt" for output as #1
for j&=1 to 50000
nen$=right$( space$(3)+str$( SORTWORK1(J&, 2) ),3 )
kin&=1000000&-val( SORTWORK1(J&, 6) ) '金額は0〜999999(6桁)の場合
kin$=right$( space$(6)+str$( abs(kin$) ),6 )
print #1, nen$+kin$+right$( space$(5)+str$(j%),5 )
next j&
close #1
open "sort.out" for input as #1
while not eof(1)
line input #1, buf$
code&=val( right$( sortkey$(j&),5 ) )
for m=1 to 6
print SORTWORK1(code&, 6)
next m
wend
L$ = "テキストファイル(*.TXT)"
F$ = WINSAVEDLG("ファイルの保存","3DG.BAS",FL$,0)
if F$ <> chr$(&H1B) then
'実際はリネームする前にPATHを分解する必要があります。
'また既に同名のファイルがあった場合に削除する処理も必要と思われます
IF RIGHT$(UCASE$(F$),4)><".TXT" THEN NAME F$ AS F$+".TXT"
endif
L$ = "datファイル(*.dat)"
F$=WINSAVEDLG("新しい名前をつけて保存","main.dat",L$,0)
if F$<>chr$(&H1B) then
open F$ for create as #1
print #1
if right$(ucase$(F$),4)><".DAT" then name F$ as F$+".DAT"