open

Blitz3D Forums/Blitz3D Programming/open

Heliotrope(Posted 2010) [#1]
Is there a way in Blitz to open a dialog box in which you can search for a file and then have a blitz program open that file.


ClayPigeon(Posted 2010) [#2]
You have to make your own. I know there're a few pre-made file browsers floating around if that's what you want. Unless by "search for a file" you mean literally "search" then I don't know if anyone has made a file search code or if it's even possible.. Might want to try the user32.dll, kernel32, win32.dll, etc. libs if you're up to the challenge. I believe it can be done through one of those.

Last edited 2010


Vorderman(Posted 2010) [#3]
The easiest way is to use BlitzSys - it's a DLL and a .bb include and it takes just a couple of lines to open a regular Windows file selector, and it also does all the other stuff like messageboxes, yes/no boxes etc..

I don't know where you can download it from, but I can email you a copy of the files + a small test program - let me know if the email address in your sig is OK to accept the .rar file (it's 16kb).

This is the test program so you can see how easy it is to select and return a filename, and use a messagebox to quit the program:
Global rootdir$ 													= Lower$(CurrentDir$())


Include "blitzsys.bb"
If (DLLBlitzSysInitialise() = False)
	RuntimeError("BLITZSYS DLL NOT FOUND")
Else
	DebugLog "BLITZSYS Initialised."
EndIf



QUIT = False

Repeat

	ChangeDir rootdir$
	sAFilter$ = "Select a file (*.bb)" + Chr(0) + "*.bb" + Chr(0)
	sFileName$ = DLLGetOpenFileName$("LOAD Blitz Basic FILE",rootdir$+"",sAFilter$,OFN_HIDEREADONLY Or OFN_FILEMUSTEXIST)

	If sFileName$ <> ""
		Print "File selected : " + sFileName$
	Else
		Print "No File Selected."
	EndIf

	;message box to quit
	sContents$ = "Exit This Test Program?"
	Select DLLMessageBox("BLITZSYS TEST PROGRAM",sContents$,MB_TOPMOST Or MB_ICONQUESTION Or MB_YESNO)
	Case IDYES
		;Yes selected
		QUIT = True
	End Select
				
Until QUIT


Last edited 2010


jfk EO-11110(Posted 2010) [#4]
You can do the same as Blitzsys.dll with a userlib decls:

http://www.blitzbasic.com/codearcs/codearcs.php?code=916

Last edited 2010


Heliotrope(Posted 2010) [#5]
I want the thing that opens in any program like a webbrouser when you press File>Save.

Next I also want the comands to talk to the other program.


Matty(Posted 2010) [#6]
See jfk and Vorderman's posts above.


Vorderman(Posted 2010) [#7]
Download this and run the example .bb file :
http://webspace.mypostoffice.co.uk/~james.kett/BlitzSys.rar


Leon Drake(Posted 2010) [#8]
oh phew i thought this was another stanrol thread


Heliotrope(Posted 2011) [#9]
very funny Vorderman, .rar . )-:


jfk EO-11110(Posted 2011) [#10]
Every serious system requires an unpacker that can handle not only ZIP, but also some other common formats, such as rar, gz.sfx, 7z, lzh. There must be dozens of freewares for this, look around. See it as a test. Is this going to stop you?


Vorderman(Posted 2011) [#11]
I'm so glad I bothered to upload that file for you...


jfk EO-11110(Posted 2011) [#12]
It happens all the time, simply "don't ignore at all". ^^


Zethrax(Posted 2011) [#13]
Just get 7-Zip. It opens RARs and a variety of other formats, too.

http://www.7-zip.org/