FBToolbox DLL :)

Blitz3D Forums/Blitz3D Programming/FBToolbox DLL :)

Filax(Posted 2004) [#1]
I have made a little DLL for help blitz coder's :)

http://www.blitz3dfr.com/fbtoolbox_projet/FBToolbox.zip

More function to come.

For the moment :

FBT_GetShortFilename$(Filename$)
FBT_GetOnlyDirectory$(Filename$)
FBT_GetOnlyExtension$(filename$)

FBT_CryptString$(String$,Key)

FBT_OpenFileRequester$(InitialPathFile$,PatternString$,PatternNumber,Title$)
FBT_SaveFileRequester$(InitialPathFile$,PatternString$,PatternNumber,Title$)
FBT_OpenPathRequester$(InitialPathFile$,Title$)
FBT_MessageAlert%(Title$,Msg$,Type)

FBT_UnpackMem%(bank*,OrigSize)
FBT_PackMem%(bank*,BankSize)

FBT_CurrentExePath$()
FBT_CurrentExeName$()
FBT_GetTempPath$()

FBT_TestMouse%()
FBT_RenameFile%(OldFileName$, NewFileName$)

FBT_TestInternetConnection%()
FBT_SendMail%(mailserver$,mailto$,mailfrom$,subject$,msgbody$)
FBT_SendNetworkMessage%(Sender$,Sendto$,Message$)

FBT_Inc#(Value#,Inc#)
FBT_Dec#(Value#,Inc#)
FBT_Switch%(Value)
FBT_InvertString$(String$)


Gabriel(Posted 2004) [#2]
Cool stuff, and a nice share. Thanks man.


Neochrome(Posted 2004) [#3]
ooowww, the SendNetworkMessage, does this work over TCP/IP? as well as the internal network


CyberHeater(Posted 2004) [#4]
superb.


Filax(Posted 2004) [#5]
Thanks :)

NeoMancer only on internal network ! But i plan some
function for make stuf over internet :)


Filax(Posted 2004) [#6]
redownload it i have implented some new function

FBT_TestFreeRam%()
FBT_TestTotalRam%()

FBT_RefreshDesktop%()

FBT_PromptReboot%()
FBT_PromptEmptyTrash%(Confirm)

FBT_EjectCD%(Drive$)
FBT_LoadCD%(Drive$)


Paolo(Posted 2004) [#7]
HEEEEEEEEEEEEEEY!
WAIT A MINUTE,

How does the FBT_SendMail() work????????????

I could send e-mails between any two addresses without knowing the password of each acount ??????????

Am I right? THIS IS FABULOUS and may be illegal (?) :)

Paolo.


Filax(Posted 2004) [#8]
Hi :) You can send email without password :) the password is required only for read email.

You have example .bb code for use this function.


; FBT_SendMail%(mailserver$,mailto$,mailfrom$,subject$,msgbody$)
; -----------------------------------------------------------------------------------------------
; With this function you can easily send an email :)
; mailserver$ = The mail server like 'smpt.wanadoo.fr'
; mailto$ = Destination adress
; mailfrom$ = Your email
; subject$ = Subject of the message
; msgbody$ = The message
; Return 1 if the mail has been send ! 0 if failed
Alert=FBT_MessageAlert("Alert","Do you want to send me an email ?",2)

If Alert=6 Then
Mail=FBT_SendMail%(\"smtp.wanadoo.fr\",\"peter.pan@wanadoo.fr\",\"bob@... !","I love your lib !")


If Mail=1 Then
Alert=FBT_MessageAlert("Alert","The mail is ok !",1)
Else
Alert=FBT_MessageAlert("Alert","Can't send email !",1)
EndIf
EndIf


Paolo(Posted 2004) [#9]
Oh yes :) excellent...

I have just sent an e-mail to a friend with his own e-mail... and know he thinks I (some way) discover his password....(hehehe!)
Certainly funny feature :)

But above all, it is a great work... Thanks!
Paolo.


GfK(Posted 2004) [#10]
I have just sent an e-mail to a friend with his own e-mail... and know he thinks I (some way) discover his password....(hehehe!)
Certainly funny feature :)
You can do that with Outlook.


Jeroen(Posted 2004) [#11]
nice. It would be cool to do this as well:

getDesktopWidth()
getDesktopHeight()
getDesktopDepth()
maximiseWindow()
minimizeWindow()
setZorderWindow()


OverDozing(Posted 2004) [#12]
Awesome Filax ! Keep up the kick ass work !!!! :O


Picklesworth(Posted 2004) [#13]
sounds great for a variety of uses. Will download tomorrow morning.


Filax(Posted 2004) [#14]
Very goog idea Jeroen ! i go make this !


Filax(Posted 2004) [#15]
Please reload this lib

http://www.blitz3dfr.com/fbtoolbox_projet/FBToolbox.zip

I have put 2 new functions :

Print FTB_GetDesktopWidth()
Print FTB_GetDesktopHeight()


Neochrome(Posted 2004) [#16]
you can get the desktop depth by adding this to the user32.decls

EnumDisplaySettings(lpszDeviceName%, iModeNum%, lpDevMode):"EnumDisplaySettingsA"

and this in your blitz project, need some help with this, i dont know how to get blitz to pass this stuff to the type, you see what im doing tho
Type DEVMODE
    Field dmDeviceName
    Field dmSpecVersion
    Field dmDriverVersion
    Field dmSize
    Field dmDriverExtra
    Field dmFields
    Field dmOrientation
    Field dmPaperSize
    Field dmPaperLength
    Field dmPaperWidth
    Field dmScale
    Field dmCopies
    Field dmDefaultSource
    Field dmPrintQuality
    Field dmColor
    Field dmDuplex
    Field dmYResolution
    Field dmTTOption
    Field dmCollate
    Field dmFormName
    Field dmUnusedPadding
    Field dmBitsPerPel
    Field dmPelsWidth
    Field dmPelsHeight
    Field dmDisplayFlags
    Field dmDisplayFrequency
End Type

disp.devmode = New devmode

api_GetDisplaySettings(0,0,Handle(disp))


Select disp\dmBitsPerPel
	Case 4:      colors = "16 Color"
    Case 8:      colors = "256 Color"
    Case 16:     colors = "High Color"
    Case 24, 32: colors = "True Color"
End Select




Filax(Posted 2004) [#17]
and now :)

FTB_GetDesktopHeight()

reload :)


Filax(Posted 2004) [#18]
I have change two functions :

; FBT_Inc(Value#,Inc#,Max#)
; With this command you can increment a variable with a value example : MyVar#=FBT_Inc(MyVar#,2.1,30)
; This command accept float, if you want tu use integer use for example : MyVar=FBT_Inc(MyVar,2,30)

; The same think in blitz is :
; -----------------------------------
; MyVar=MyVar+1

; If MyVar>=30 Then
; MyVar=30
; EndIf

; ---------------------------------------------------------------------------------------------------------------------------------------------

;FBT_Dec(Value#,Inc#,Min#)
; With this command you can decrement a variable with a value example : MyVar#=FBT_Dec(MyVar#,2.3,-10)
; This command accept float, if you want tu use integer use for example : MyVar=FBT_Dec(MyVar,2,-30)

; The same think in blitz is :
; -----------------------------------
; MyVar=MyVar-1

; If MyVar<=-20 Then
; MyVar=-20
; EndIf


Neochrome(Posted 2004) [#19]
is this faster than doing

; MyVar=MyVar-1

; If MyVar<=-20 Then
; MyVar=-20
; EndIf

?


Filax(Posted 2004) [#20]
I don't know my dear ! but it's less long.


Neochrome(Posted 2004) [#21]
haha, iv written a QLimit command that does the same, In the amiga version QLimit was something that was part of the tokens!


CyberHeater(Posted 2004) [#22]
Some really useful commands here.

Keep 'em comming :)


Bremer(Posted 2004) [#23]
For these two:

FBT_Inc(Value#,Inc#,Max#)
FBT_Dec(Value#,Inc#,Min#)

Is the max,min optional or do you have to include min/max values?


Filax(Posted 2004) [#24]
Good remark ! i go to change this.


Filax(Posted 2004) [#25]
I have change the function INC & DEC you can use this
without limit and i have add 2 new functions.


FBT_Inc#(Value#,Inc#)
FBT_Dec#(Value#,Inc#)


FBT_IncLimit#(Value#,Inc#,Max#)
FBT_DecLimit#(Value#,Inc#,Min#)


Filax(Posted 2004) [#26]
If have implanted more string function :

; FBT_RemoveString(String$,Find$)
; With this Function you can remove a String under a String, example : Print FBT_RemoveString("Current desktop depth"," desktop") ,Return "Current depth"

; FBT_ReplaceString(String$,Find$,Replace$)
; With this function you can replace a string under a string, example : Print FBT_ReplaceString("Current desktop depth","desktop","monitor"), return "Current monitor depth"

; FBT_CountString(String$,Find$)
; This function return how many (find$) string in a string example : Num=FBT_CountString("This test is a big test","test"), return 2


Picklesworth(Posted 2004) [#27]
in the demo, does that file deletion part, er, actually delete 6 files? I accidentaly hit yes...


Red Ocktober(Posted 2004) [#28]
this Filax guy, he just never stops...

either he...

(1) has cloned himslef

(2) has a time machine

(3) employs well paid laborors

or, he is not a real person, but a computer program that likes to write computer programs :)


nice stuff...
thx


--Mike


John Blackledge(Posted 2004) [#29]
Excellent work, Filax. Oo, oo, new ideas!-
Please can you do:
1) A drag-drop system that doesn't MAV.
2) hnd = GetIcon()
3) DrawIcon(hnd)
I _really_ want to write a toolbar in Blitz3D via (close to) system calls, instead of 'Gadget' like syntax.


Filax(Posted 2004) [#30]
Ok for the idea :) john

i have add :

FBT_TestWindowsVersion()
Return the current window version
Work with "Windows 95,98,ME,XP,2000,NT4,NT3.51"


FBT_Clump#(Value#,Min#,Max#)
Clump a value with a min and max value


CyberHeater(Posted 2004) [#31]
FBT_Clump#(Value#,Min#,Max#)

Do you mean "clamp" ie, to constrain a value to a certain range.

What exactly does this function do.


Filax(Posted 2004) [#32]
Try

For i=0 to 40
Random=FBT_Clump( Rnd(1000), 0, 255)
Print Random
Next


Neochrome(Posted 2004) [#33]
filax screen mode would be cool.


Filax(Posted 2004) [#34]
Soon my friend :)


Picklesworth(Posted 2004) [#35]
I just started looking at this in my libs folder. Very useful dll :D

Could you please add a way to turn the computer off so you could make a program that shuts it down on a timer, and some other magic things? This would be useful for some things that happen overnight.


Mustang(Posted 2004) [#36]
Wow...! Cool... useful stuff here!


jfk EO-11110(Posted 2004) [#37]
Does sendmail also work when there is no smtp mailserver installed on the machine?


Picklesworth(Posted 2004) [#38]
Hasn't worked for me. I would love to know how to use it though...


Rook Zimbabwe(Posted 2004) [#39]
Fantastic Stuff! Good to see you around again filax! :) Keep up the high quality work!!!
-Rook Zimbabwee