Page 12 of 13
Re: DroopyLib
Posted: Wed Jan 14, 2015 7:33 pm
by Rinzwind
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
.
.
Re: DroopyLib
Posted: Wed Jan 14, 2015 7:50 pm
by Rinzwind
Btw why not using EnableExplicit in DroopyLib? How many times did you bump your head because of accidental variable creation troubles?
Re: DroopyLib
Posted: Thu Feb 05, 2015 5:48 am
by SeregaZ
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"?
Re: DroopyLib
Posted: Tue Apr 19, 2016 10:51 pm
by Mythros
How do I use the new DroopyLib HMOD after I install it?
Thank You!
Mythros
Re: DroopyLib
Posted: Wed Apr 20, 2016 8:26 am
by Droopy
Begin your code with
Code: Select all
XIncludeFile #PB_Compiler_Home+"hmod\DroopyLib.pbi"
UseModule DroopyLib
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
Re: DroopyLib
Posted: Wed Jun 08, 2016 7:35 am
by loulou2522
Droopy wrote:Begin your code with
Code: Select all
XIncludeFile #PB_Compiler_Home+"hmod\DroopyLib.pbi"
UseModule DroopyLib
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
Hi droopy,
Regread key won't work in your lib with windows10. Can you see please ?
THanks in advance
Re: DroopyLib
Posted: Wed Jun 08, 2016 7:35 am
by loulou2522
Droopy wrote:Begin your code with
Code: Select all
XIncludeFile #PB_Compiler_Home+"hmod\DroopyLib.pbi"
UseModule DroopyLib
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
Hi droopy,
Regread key won't work in your lib with windows10. Can you see please ?
THanks in advance
Re: DroopyLib
Posted: Mon Jun 13, 2016 1:52 pm
by Droopy
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","."))
Re: DroopyLib
Posted: Tue Jun 14, 2016 6:37 am
by loulou2522
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","."))
Hi droopy,
Right,
it works when droopy lib is in purebasic directory if not it dosen't work
Thanks for solving,
Re: DroopyLib
Posted: Tue Jun 14, 2016 11:50 am
by SeregaZ
and exe file need to be start with admin rights for this registry functions.
Re: DroopyLib
Posted: Fri Oct 14, 2016 7:43 am
by loulou2522
When compile in X64 version with purifier enabled
Code: Select all
Procedure.s GetFileVersion(FileName.s,Which,FieldName) ;+++
in droopy lib give an error on line
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
Re: DroopyLib
Posted: Mon Oct 17, 2016 10:33 am
by Droopy
could you try with debugger disabled ?
Re: DroopyLib
Posted: Mon Oct 17, 2016 12:00 pm
by SeregaZ
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:
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
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 )
color = GetPixel_(sysviewDC, x, y)
ReleaseDC_(hwndSysview, sysviewDC)
ProcedureReturn color
EndProcedure
Re: DroopyLib
Posted: Mon Oct 17, 2016 12:18 pm
by Bisonte
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)
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
Re: DroopyLib
Posted: Mon Oct 17, 2016 12:29 pm
by loulou2522
Droopy wrote:could you try with debugger disabled ?
I try it and it works perfectly even if debugger is enabled, the problem comes from the purifier in every case where it is check