DroopyLib
Re: DroopyLib
Slightly adjusted from http://forums.purebasic.fr/english/view ... =7&t=47410 to fit into the format of RegGetValue
Structure Registry_CharacterArray
c.c[0]
EndStructure
.
.
Case #REG_MULTI_SZ
GetHandle = RegQueryValueEx_(hKey, ValueName, 0, @lType, #Null, @Length)
If GetHandle = 0
*Buffer = AllocateMemory(Length)
RegQueryValueEx_(hKey, ValueName, 0, @lType, *Buffer, @Length)
Length / SizeOf(Character) - 2
For i = 0 To Length
If *Buffer\c = #Null : Lines + 1 : EndIf
Next
Length = 0
For i = 0 To Lines
ts.s = PeekS(@*Buffer\c[Length])
If GetValue <> "": GetValue + #CRLF$: EndIf
GetValue + ts
Length + Len(ts) + 1
Next
FreeMemory(*Buffer)
EndIf
EndSelect
.
.
Structure Registry_CharacterArray
c.c[0]
EndStructure
.
.
Case #REG_MULTI_SZ
GetHandle = RegQueryValueEx_(hKey, ValueName, 0, @lType, #Null, @Length)
If GetHandle = 0
*Buffer = AllocateMemory(Length)
RegQueryValueEx_(hKey, ValueName, 0, @lType, *Buffer, @Length)
Length / SizeOf(Character) - 2
For i = 0 To Length
If *Buffer\c = #Null : Lines + 1 : EndIf
Next
Length = 0
For i = 0 To Lines
ts.s = PeekS(@*Buffer\c[Length])
If GetValue <> "": GetValue + #CRLF$: EndIf
GetValue + ts
Length + Len(ts) + 1
Next
FreeMemory(*Buffer)
EndIf
EndSelect
.
.
Re: DroopyLib
Btw why not using EnableExplicit in DroopyLib? How many times did you bump your head because of accidental variable creation troubles?
-
- Enthusiast
- Posts: 617
- Joined: Fri Feb 20, 2009 9:24 am
- Location: Almaty (Kazakhstan. not Borat, but Triple G)
- Contact:
Re: DroopyLib
how to set two search options for SearchFilesInit command?
NbFiles=SearchFilesInit(wherekeys$,"*.one",1)
blablabla
NbFiles=SearchFilesInit(wherekeys$,"*.two",1)
blablabla
or
SearchFilesInit(wherekeys$,"*.*",1)
Repeat
File.s=SearchFilesGet()
tmp$ = Right(File, 3)
Select tmp$
Case "one"
blablabla
Case "two"
blablabla
this "*.*" will make very slow search or it will be same, like "*.one"?
NbFiles=SearchFilesInit(wherekeys$,"*.one",1)
blablabla
NbFiles=SearchFilesInit(wherekeys$,"*.two",1)
blablabla
or
SearchFilesInit(wherekeys$,"*.*",1)
Repeat
File.s=SearchFilesGet()
tmp$ = Right(File, 3)
Select tmp$
Case "one"
blablabla
Case "two"
blablabla
this "*.*" will make very slow search or it will be same, like "*.one"?
Re: DroopyLib
How do I use the new DroopyLib HMOD after I install it?
Thank You!
Mythros
Thank You!
Mythros
Re: DroopyLib
Begin your code with
Hit CTRL+F1 on DroopyLib function to get help
to get autocompetion open DroopyLib.pbi (with CTRL+F12) in a tab and set autocompletion (in the editor) for all open files
Code: Select all
XIncludeFile #PB_Compiler_Home+"hmod\DroopyLib.pbi"
UseModule DroopyLib
to get autocompetion open DroopyLib.pbi (with CTRL+F12) in a tab and set autocompletion (in the editor) for all open files
-
- Enthusiast
- Posts: 495
- Joined: Tue Oct 14, 2014 12:09 pm
Re: DroopyLib
Hi droopy,Droopy wrote:Begin your code withHit CTRL+F1 on DroopyLib function to get helpCode: Select all
XIncludeFile #PB_Compiler_Home+"hmod\DroopyLib.pbi" UseModule DroopyLib
to get autocompetion open DroopyLib.pbi (with CTRL+F12) in a tab and set autocompletion (in the editor) for all open files
Regread key won't work in your lib with windows10. Can you see please ?
THanks in advance
-
- Enthusiast
- Posts: 495
- Joined: Tue Oct 14, 2014 12:09 pm
Re: DroopyLib
Hi droopy,Droopy wrote:Begin your code withHit CTRL+F1 on DroopyLib function to get helpCode: Select all
XIncludeFile #PB_Compiler_Home+"hmod\DroopyLib.pbi" UseModule DroopyLib
to get autocompetion open DroopyLib.pbi (with CTRL+F12) in a tab and set autocompletion (in the editor) for all open files
Regread key won't work in your lib with windows10. Can you see please ?
THanks in advance
Re: DroopyLib
i just test some registry function (over windows 10) with no problems :
Code: Select all
XIncludeFile #PB_Compiler_Home+"hmod\DroopyLib.pbi"
UseModule DroopyLib
; Create the Test Key
RegCreateKey("HKEY_LOCAL_MACHINE\SOFTWARE\Microsoft\Test",".")
; Write Value
RegSetValue("HKEY_LOCAL_MACHINE\SOFTWARE\Microsoft\Test","SZ Value","SZ",#REG_SZ,".")
; Read Value
MessageRequester("",RegGetValue("HKEY_LOCAL_MACHINE\SOFTWARE\Microsoft\Test","SZ Value","."))
-
- Enthusiast
- Posts: 495
- Joined: Tue Oct 14, 2014 12:09 pm
Re: DroopyLib
Hi droopy,Droopy wrote:i just test some registry function (over windows 10) with no problems :
Code: Select all
XIncludeFile #PB_Compiler_Home+"hmod\DroopyLib.pbi" UseModule DroopyLib ; Create the Test Key RegCreateKey("HKEY_LOCAL_MACHINE\SOFTWARE\Microsoft\Test",".") ; Write Value RegSetValue("HKEY_LOCAL_MACHINE\SOFTWARE\Microsoft\Test","SZ Value","SZ",#REG_SZ,".") ; Read Value MessageRequester("",RegGetValue("HKEY_LOCAL_MACHINE\SOFTWARE\Microsoft\Test","SZ Value","."))
Right,
it works when droopy lib is in purebasic directory if not it dosen't work
Thanks for solving,
-
- Enthusiast
- Posts: 617
- Joined: Fri Feb 20, 2009 9:24 am
- Location: Almaty (Kazakhstan. not Borat, but Triple G)
- Contact:
Re: DroopyLib
and exe file need to be start with admin rights for this registry functions.
-
- Enthusiast
- Posts: 495
- Joined: Tue Oct 14, 2014 12:09 pm
Re: DroopyLib
When compile in X64 version with purifier enabled
in droopy lib give an error on line
Procedure stack has been coorupted
and the programm crash
If i generate an exe the programm don't crash
Thanks
Code: Select all
Procedure.s GetFileVersion(FileName.s,Which,FieldName) ;+++
Code: Select all
Result = CallFunction(1,"VerQueryValueW",*pBlock,@lpSubBlock$,@lplpBuffer,@puLen)
Procedure stack has been coorupted
and the programm crash
If i generate an exe the programm don't crash
Thanks
-
- Enthusiast
- Posts: 617
- Joined: Fri Feb 20, 2009 9:24 am
- Location: Almaty (Kazakhstan. not Borat, but Triple G)
- Contact:
Re: DroopyLib
i have old verstion of Droopy, becouse i have old vestion of PB - 5.31. and in a help i see code for get pixel code:
it is same for new version? if yes - it have memory leak. after 10 minuts of active using this function - application is freeze.
this GetDC need to be free. some kind of:
Code: Select all
ProcedureDLL GetPixelColor(x,y) ; Returns the RGB color of the pixel at the specified coordinates or #CLR_INVALID (-1) if coordinate is outside of the screen
sysviewDC = GetDC_( hwndSysview )
ProcedureReturn GetPixel_( sysviewDC,x, y )
EndProcedure
this GetDC need to be free. some kind of:
Code: Select all
ProcedureDLL GetPixelColor(x,y) ; Returns the RGB color of the pixel at the specified coordinates or #CLR_INVALID (-1) if coordinate is outside of the screen
sysviewDC = GetDC_( hwndSysview )
color = GetPixel_(sysviewDC, x, y)
ReleaseDC_(hwndSysview, sysviewDC)
ProcedureReturn color
EndProcedure
Re: DroopyLib
SeregaZ is right. And I could not find any declaration of the variable : hwndSysView so it is 0.
So it gets alsways the DC from the mainscreen (see MSDN)
So it gets alsways the DC from the mainscreen (see MSDN)
Code: Select all
Procedure GetPixelColor(x, y) ;+++
;/// Returns the RGB color of the pixel at the specified coordinates or #CLR_INVALID (-1) if coordinate is outside of the screen
Protected SysViewDC, Color = -1
SysViewDC = GetDC_(#Null)
If SysViewDC
Color = GetPixel_(SysViewDC, x, y)
ReleaseDC_(SysViewDC)
EndIf
ProcedureReturn Color
EndProcedure
-
- Enthusiast
- Posts: 495
- Joined: Tue Oct 14, 2014 12:09 pm
Re: DroopyLib
I try it and it works perfectly even if debugger is enabled, the problem comes from the purifier in every case where it is checkDroopy wrote:could you try with debugger disabled ?