thanks latch it works now but the way this function is set up it uses memblocks (i'm geussing thats the only way) but if i try to put the filter blank it says the memblock cant equal 0 and when i try to put a filter in it doesn't filter write. i'v tried doing ".bmp" "*.bmp" "bmp" but nuthing works it doesn't show anything exept files heres the code any help?
sync on
sync rate 0
set window on
Ink RGB(100,200,100),0
Box 0,0,25,25
Get image 1,0,0,25,25
selected=300
do
if mouseclick() and selected=300
selected=1
endif
if selected=2
selected=0
endif
sprite 1,MouseX(),Mousey(),1
if selected=1
Filename$=Getfilename("Load File","bmp")
selected=2
endif
Set cursor 0,0
Print Filename$
show mouse
sync
loop
rem show the file identification dialog
function getFileName(FileBoxTitle$,FileFilter$)
load dll "user32.dll",1
load dll "kernel32.dll",2
load dll "comdlg32.dll",3
rem Memblock Table
OFN_MB = 1
PathBuffer_MB = 2
FileFilter_MB = 3
FileBoxTitle_MB = 4
rem Offset Table OPENFILENAME Struct
lStructSize = 0
hwndOwner = 4
hInstance = 8
lpstrFilter = 12
lpstrCustomFilter = 16
nMaxCustFilter = 20
nFilterIndex = 24
lpstrFile = 28
nMaxFile = 32
lpstrFileTitle = 36
nMaxFileTitle = 40
lpstrInitialDir = 44
lpstrTitle = 48
Flags = 52
nFileOffset = 56
nFileExtension = 58
lpstrDefExt = 60
lCustData = 64
lpfnHook = 68
lpTemplateName = 72
StructEnd = 76
rem OPENFILENAME Flag Table
OFN_ALLOWMULTISELECT = 512:rem 0x00000200
OFN_CREATEPROMPT = 8192:rem 0x00002000
OFN_ENABLEHOOK = 32:rem 0x00000020
OFN_ENABLETEMPLATE = 64:rem 0x00000040
OFN_ENABLETEMPLATEHANDLE = 128:rem 0x00000080
OFN_EXPLORER = 524288:rem 0x00080000
OFN_EXTENSIONDIFFERENT = 1024:rem 0x00000400
OFN_FILEMUSTEXIST = 4096:rem 0x00001000
OFN_HIDEREADONLY = 4:rem 0x00000004
OFN_LONGNAMES = 2097152:rem 0x00200000
OFN_NOCHANGEDIR = 8:rem 0x00000008
OFN_NODEREFERENCELINKS = 1048576:rem 0x00100000
OFN_NOLONGNAMES = 262144:rem 0x00040000
OFN_NONETWORKBUTTON = 131072:rem 0x00020000
OFN_NOREADONLYRETURN = 32768:rem 0x00008000
OFN_NOTESTFILECREATE = 65536:rem 0x00010000
OFN_NOVALIDATE = 256:rem 0x00000100
OFN_OVERWRITEPROMPT = 2:rem 0x00000002
OFN_PATHMUSTEXIST = 2048:rem 0x00000800
OFN_READONLY = 1:rem 0x00000001
OFN_SHAREAWARE = 16384:rem 0x00004000
OFN_SHOWHELP = 16:rem 0x00000010
rem FileBox Info
FileBoxFlags = OFN_EXPLORER + OFN_FILEMUSTEXIST + OFN_PATHMUSTEXIST + OFN_LONGNAMES + OFN_HIDEREADONLY + OFN_NONETWORKBUTTON
PathBufferSize = 256
hWnd = call dll(1,"GetActiveWindow")
hMod = call dll(2,"GetModuleHandleA",0)
rem Create Memblock Struct
make memblock OFN_MB,StructEnd
make memblock PathBuffer_MB,PathBufferSize
make memblock FileFilter_MB,len(FileFilter$)
make memblock FileBoxTitle_MB,len(FileBoxTitle$)
OFN = get memblock ptr(OFN_MB)
PathBuffer = get memblock ptr(PathBuffer_MB)
FileFilter = get memblock ptr(FileFilter_MB)
FileBoxTitle = get memblock ptr(FileBoxTitle_MB)
rem Dump Strings to Memblock
dump(FileFilter_MB,FileFilter$)
dump(FileBoxTitle_MB,FileBoxTitle$)
rem Write to OPENFILENAME Struct
write memblock dword OFN_MB,lStructSize,StructEnd
write memblock dword OFN_MB,hWndOwner,hWnd
write memblock dword OFN_MB,hInstance,hMod
write memblock dword OFN_MB,lpstrFilter,FileFilter
write memblock dword OFN_MB,lpstrFile,PathBuffer
write memblock dword OFN_MB,nMaxFile,PathBufferSize
write memblock dword OFN_MB,Flags,FileBoxFlags
write memblock dword OFN_MB,lpstrTitle,FileBoxTitle
rem Open FileBox
call dll 3,"GetOpenFileNameA",OFN
result$ = getstr(PathBuffer_MB)
rem Delete Memblock Struct
delete memblock OFN_MB
delete memblock PathBuffer_MB
delete memblock FileFilter_MB
delete memblock FileBoxTitle_MB
delete dll 1
delete dll 2
delete dll 3
endfunction result$
rem fonctions utilisées pour l'identification d'une fichier
function dump(m,s$)
for p=1 to len(s$)
b=asc(mid$(s$,p))
if b=asc("^") then b=0
write memblock byte m,p-1,b
next p
endfunction
function getstr(m)
p=0:s$=""
do
b=memblock byte(m,p)
if b=0 then exit
s$=s$+chr$(b)
inc p
loop
endfunction s$
[Edit]
Heck yes i just fixed it! i took out make memblock FileFilter_MB,len(FileFilter$) and FileFilter = get memblock ptr(FileFilter_MB) and then took out the part where it deletes em and it works great now! yay

now i can use window mode for my paint program(i was using TDK's file selector functions and alert boxes. hey do you happen to have any functions using windows dll's that do alert boxes. i found on msdn where to find the calls but everyone always uses functions they make with memblocks and stuff and i'm not good with that haha or do you know where to find it