DroopyLib
Re: DroopyLib
Hello,
The file format for .url is descibed here : http://www.fmtz.com/formats/url-file-format/article for url format ?
The file format for .url is descibed here : http://www.fmtz.com/formats/url-file-format/article for url format ?
-
- Enthusiast
- Posts: 628
- Joined: Fri Feb 20, 2009 9:24 am
- Location: Almaty (Kazakhstan. not Borat, but Triple G)
- Contact:
Re: DroopyLib
no. i mean i have a small problem with your shortcut. in start menu it shows like file without icon.
Re: DroopyLib
Hello, version 4.61.011 avalaible
28/09/12 : Library 4.61.011
Compiled with PbFastLib 6 (indent of examples fixed)
SearchFileStop() Function added
GetDiskSpace() Function added
GetHandleEx() Function added
GetClassName() Function added
Windows example changed
SimulatePurebasicEvent (tips) code changed
ShortcutTarget() Function added
WindowsInformation Tips added
ApplicationInstallation Tips added
WindowsControl_GetHandle() Function added
WindowsControl_WaitPresence() Function added
WindowsControl_Click() Function added
WindowsControl_ClickEx() Function added
WindowsControl_WriteText() Function added
Re: DroopyLib
Thank you!
Sveinung
Sveinung
-
- Enthusiast
- Posts: 628
- Joined: Fri Feb 20, 2009 9:24 am
- Location: Almaty (Kazakhstan. not Borat, but Triple G)
- Contact:
Re: DroopyLib
how i can teach read ini and write ini to read and write with #PB_Unicode flag?
now when it write - replace some special symbols like іңғұүқөқұәіғ to ??????? symbols:
now when it write - replace some special symbols like іңғұүқөқұәіғ to ??????? symbols:
Code: Select all
CompilerIf (#PB_Compiler_Unicode = 0)
CompilerError "Turn on: Create Unicode executable"
CompilerEndIf
If OpenWindow(5, 216, 0, 250, 100, "edit", #PB_Window_SystemMenu | #PB_Window_ScreenCentered | #PB_Window_TitleBar)
TextGadget(5000, 90, 10, 200, 20, "іңғұүқөқұәіғ")
TextGadget(501, 30, 37, 20, 20, "INI")
TextGadget(502, 10, 67, 50, 20, "Unicode")
StringGadget(5001, 78, 35, 166, 20, "")
StringGadget(5002, 78, 65, 166, 20, "")
If IniWrite("C:\test.ini", "MAIN", "somekey", "іңғұүқөқұәіғ")
SetGadgetText(5001, IniRead("C:\test.ini", "MAIN", "somekey"))
EndIf
If CreateFile(0, "C:\test2.ini")
WriteStringN(0, "іңғұүқөқұәіғ", #PB_Unicode)
CloseFile(0)
If ReadFile(0, "C:\test2.ini")
SetGadgetText(5002, ReadString(0, #PB_Unicode))
CloseFile(0)
EndIf
EndIf
Repeat
WEvent = WaitWindowEvent()
If WEvent = #PB_Event_CloseWindow
Quit35 = 1
EndIf
Until Quit35 = 1
EndIf
Re: DroopyLib
Hello, i try to use the api to write unicode value, but it fails.
It works with PureBasic natvie functions.
It works with PureBasic natvie functions.
Code: Select all
ProcedureDLL IniWrite2(INIFile.s,Section.s,Key.s,string.s) ; Writes a key to an Ini File
CompilerIf #PB_Compiler_Unicode
lid=OpenLibrary(#PB_Any,"Kernel32.dll")
ret=CallFunction(lid,"WritePrivateProfileStringW",@Section,@Key.s,@string,@INIFile)
CloseLibrary(fid)
CompilerElse
ret=WritePrivateProfileString_(@Section,@Key,@string,@INIFile)
CompilerEndIf
If ret<>0 : ret=1:EndIf
ProcedureReturn ret
EndProcedure
Inp.s=InputRequester("","","")
;/ Droopy Way
IniWrite2("C:\droopy.ini","","text",Inp)
;/ Native way
CreatePreferences("C:\Native.ini")
WritePreferenceString("Text",Inp)
-
- Enthusiast
- Posts: 628
- Joined: Fri Feb 20, 2009 9:24 am
- Location: Almaty (Kazakhstan. not Borat, but Triple G)
- Contact:
Re: DroopyLib
it means for change 1 item - i need to rewrite whole file? 

Re: DroopyLib
Just replace IniWrite in your code with IniWrite2SeregaZ wrote:it means for change 1 item - i need to rewrite whole file?
Code: Select all
ProcedureDLL IniWrite2(INIFile.s,Section.s,Key.s,string.s) ; Writes a key to an Ini File
OpenPreferences(INIFile)
PreferenceGroup(Section)
WritePreferenceString(Key,string)
ClosePreferences()
EndProcedure
-
- Enthusiast
- Posts: 628
- Joined: Fri Feb 20, 2009 9:24 am
- Location: Almaty (Kazakhstan. not Borat, but Triple G)
- Contact:
Re: DroopyLib
i have some problem with fantom ini file 
by my plan procedure reads some information from ini file - so if variable with file name is empty - procedure is not fill whole string field. so as you can see filename is empty, but readini still is read some fantom file


by my plan procedure reads some information from ini file - so if variable with file name is empty - procedure is not fill whole string field. so as you can see filename is empty, but readini still is read some fantom file


-
- Enthusiast
- Posts: 628
- Joined: Fri Feb 20, 2009 9:24 am
- Location: Almaty (Kazakhstan. not Borat, but Triple G)
- Contact:
Re: DroopyLib
i try to change this code to:
it is right?
Code: Select all
Procedure Reg(filenamein.s)
;Procedure Reg(filename.s)
Protected filename.s
filename = filenamein
Re: DroopyLib
Why not this :
check if filename is empty or check if the "IniFile" exists...
Code: Select all
Procedure Reg(filename.s)
;this
If filename <> ""
;or this
If FileSize(filename)>0
-
- Enthusiast
- Posts: 628
- Joined: Fri Feb 20, 2009 9:24 am
- Location: Almaty (Kazakhstan. not Borat, but Triple G)
- Contact:
Re: DroopyLib
to many code
for your variant needs two variant read ini function for all string fields - one for empty, second for not empty. in my case one code for both variant. but i see this fantom ini file
protected is fix this problem, but i am still cant understand why read ini from not existing file is reads some information 
probably problem is source if read ini. my system is work by this:
1. search any ini files in special folder
2. if not find any ini file - create path for future creation ini file like 1.ini
in my case 1.ini was exist, but i delite it. 1.ini not exist any more, but read ini still read from it strings
now i see the same problem in another place of my code. so i think:
needs to change someting like this:



probably problem is source if read ini. my system is work by this:
1. search any ini files in special folder
2. if not find any ini file - create path for future creation ini file like 1.ini
in my case 1.ini was exist, but i delite it. 1.ini not exist any more, but read ini still read from it strings

Code: Select all
ProcedureDLL.s IniRead(INIFile.s,Section.s,Key.s) ; Returns the contents of a key from an Ini File
ret.s=Space(512)
GetPrivateProfileString_(@Section,@Key,@"",@ret,512,@INIFile)
ProcedureReturn ret
EndProcedure
Code: Select all
ProcedureDLL.s IniRead(INIFile.s,Section.s,Key.s) ; Returns the contents of a key from an Ini File
if INIFile = "" or FileSize(INIFile) < 0
ProcedureReturn ""
else
ret.s=Space(512)
GetPrivateProfileString_(@Section,@Key,@"",@ret,512,@INIFile)
ProcedureReturn ret
endif
EndProcedure
Re: DroopyLib
Hello, new version available
13/11/12 : Library 5.00.001
GraphGadget Example modified
GraphClear() Added
CreateShortcut() Tweaked (PB5 don't support 'Not' with String)
Re: DroopyLib
For GetFileVersion(), is it possible to retrieve "other fields" in the resource's version table?
ie: Email or Website?
ie: Email or Website?