did you agree if i add the ApiTimer functions with the example code above ?So you think your "Timer" is necessary
DroopyLib
Re: DroopyLib
Sorry I don't understand
Re: DroopyLib
Oh
I misunderstood...
Yes, of course !

I misunderstood...
Yes, of course !
-
- Enthusiast
- Posts: 200
- Joined: Wed Feb 01, 2012 5:30 pm
- Location: Russian Federation
Re: DroopyLib
Please, add Vista administrator mode request to Droopy Lib installer. Otherwise, it doesn't install with UAC enabled.
Former user of pirated PB.
Now registered user :].
Now registered user :].
Re: DroopyLib
Korolev Michael wrote:Please, add Vista administrator mode request to Droopy Lib installer. Otherwise, it doesn't install with UAC enabled.
did you right click on the installer .exe - choose 'properties' then on the General tab click "unblock" - then right click on the file again and choose "Run As Administrator" ?
The advantage of a 64 bit operating system over a 32 bit operating system comes down to only being twice the headache.
Re: DroopyLib
New version avalaible
Regards
Regards
13/08/12 : Library 4.61.008
Timer() Undeleted / tweaked by Bisonte
TimerKill() Undeleted / tweaked by Bisonte
SelfDelete() Tweaked (batch now self delete itself too)
PinItem() added
Using PBFastLib 4 : Installer Request Administrator mode for Windows Vista
Re: DroopyLib
Hello, new version avalaible :
17/08/12 : Library 4.61.009
ServiceStart() tweaked
ServiceStop() tweaked
ServiceStatus() added
ServiceConfig() added
Save & restore window position/size
Here's a couple of routines I wrote (using droopy registry funcs -- you can add these to droopy lib if you want)
The idea was to make it very simple for me to store the windows position/size on window-close; and then restore it on openwindow()
The "Identifier" should be unique, but if it's missing, it will use the window title; but if you use "" as identifier, and you have multiple windows with the same title, they will all try to use the same registry entry...
Anyway; not rocket science stuff; but simple to use...
(I used the base64 encoder purely to have "one registry entry" per window.)
The idea was to make it very simple for me to store the windows position/size on window-close; and then restore it on openwindow()
The "Identifier" should be unique, but if it's missing, it will use the window title; but if you use "" as identifier, and you have multiple windows with the same title, they will all try to use the same registry entry...
Anyway; not rocket science stuff; but simple to use...
(I used the base64 encoder purely to have "one registry entry" per window.)
Code: Select all
#WindowPositionRegistryKey = "HKEY_CURRENT_USER\Software\Windows\Position"
ProcedureDLL SaveWindowPosition( hWindow.l, cIdentifier.s="" )
Protected.RECT iWinInfo
Protected.l nSize, bSuccess = #False
Protected.s cKey=#WindowPositionRegistryKey, cCode=Space(30)
If IsWindow_(hWindow)
If cIdentifier = "" : cIdentifier = GetWindowTitleEx(hWindow) : EndIf
If cIdentifier <> ""
If GetWindowRect_(hWindow,@iWinInfo)
nSize = Base64Encoder(@iWinInfo,SizeOf(RECT),@cCode,30)
If nSize
If RegCreateKey(cKey,".")
If RegSetValue(cKey,cIdentifier,Left(cCode,nSize-2),#REG_SZ,".")
bSuccess = #True
EndIf
EndIf
EndIf
EndIf
EndIf
EndIf
ProcedureReturn bSuccess
EndProcedure
ProcedureDLL.l RestoreWindowPosition( hWindow.l, cIdentifier.s = "")
Protected.RECT iWinInfo
Protected.l nSize, bSuccess = #False
Protected.s cKey=#WindowPositionRegistryKey, cCode=Space(30)
If IsWindow_(hWindow)
If cIdentifier = "" : cIdentifier = GetWindowTitleEx(hWindow) : EndIf
If cIdentifier <> ""
cCode = RegGetValue(cKey,cIdentifier,".")+"=="
If cCode <> "=="
If Base64Decoder(@cCode,Len(cCode),@iWinInfo,SizeOf(RECT))
With iWinInfo
If SetWindowPos_(hWindow,#HWND_TOP,\left,\top,\right-\left,\bottom-\top,#SWP_SHOWWINDOW);
bSuccess = #True
EndIf
EndWith
EndIf
EndIf
EndIf
EndIf
ProcedureReturn bSuccess
EndProcedure
Re: DroopyLib
Hello jassing, nice code.
I already used this type of code for storing window position, using flag functions of the droopylib.
I already used this type of code for storing window position, using flag functions of the droopylib.
Code: Select all
FlagInit("HKEY_CURRENT_USER\Software\Windows\Position")
; Save position
FlagSet("x",WindowX(#Window))
FlagSet("y",WindowY(#Window))
Re: DroopyLib
Hello, new version avalaible
04/09/12 : Library 4.61.010
Between() bug fixed
EditDefaultUserRegistry help added
FastHash() added
WindowsEnum() New example
FunctionAndPointer Tips added
IsWindowEx() Function added
WebgadgetDisableScriptError() Function added
GetWebgadgetSource() Function added
MultiWindow Tips added
SendStringInit() Function added
SendString() Function added
GetPidFromHandle() Function added
Windows Example added
-
- Enthusiast
- Posts: 628
- Joined: Fri Feb 20, 2009 9:24 am
- Location: Almaty (Kazakhstan. not Borat, but Triple G)
- Contact:
Re: DroopyLib
dear Droopy, have you any FileSearchStop commands? i mean when user is not want to wait when search is end, press cancel button and search is stop.
Re: DroopyLib
@SeregaZ
No i don't have this, perhaps calling SearchFilesInit() in a thread ?
No i don't have this, perhaps calling SearchFilesInit() in a thread ?
- Zebuddi123
- Enthusiast
- Posts: 796
- Joined: Wed Feb 01, 2012 3:30 pm
- Location: Nottinghamshire UK
- Contact:
Re: DroopyLib
@SeregaZ
do the file search via a thread. then when the user cancels the search kill the thread and release anything allocated
Zebuddi.
do the file search via a thread. then when the user cancels the search kill the thread and release anything allocated
Zebuddi.

malleo, caput, bang. Ego, comprehendunt in tempore
-
- Enthusiast
- Posts: 628
- Joined: Fri Feb 20, 2009 9:24 am
- Location: Almaty (Kazakhstan. not Borat, but Triple G)
- Contact:
Re: DroopyLib
already do, but i think killing the thread not safe. hard disk drive in this moment very active, i heard noise how it work. who knows how this killing can affect to hdd...
this code will work?
Global FileSearchStop = #False
***
Until FileSearchStop = #True Or FindNextFile_(Handle, @lpFindFileData)= #False
; Close the Api search Function
if Handle
FindClose_(Handle)
Endif
of course for applying and avoid conflict with droopy library i need to change name of fuctions. it will stop search process without killing thread?
and for SearchDirectory(Path.s,Mask.s) too.
and one more question - can GetSpecialFolderLocation shows path to "Programm Files (86)" in 64bits windows system? when my programm will be launch on 64bit - it will start wrong iexplorer - 64bit, but i need to start 32bit iexplorer when system is 64bit.
this code will work?
Code: Select all
Global FileSearchStop = #False
Procedure SearchFiles(Path.s,Mask.s)
;- Fill the LinkedList with the files found
; Add \ to Path if missing
If Right(Path,1)<>"\" : Path+"\":EndIf
; Apply Structure
lpFindFileData.WIN32_FIND_DATA
; Add Filter *.*
Recherche.s=Path+Mask
; Initiate the Search
Handle.l = FindFirstFile_(Recherche, @lpFindFileData)
; If search succeeds
If Handle <> #INVALID_HANDLE_VALUE
Repeat
; Trouve = File or Directory Found
Trouve.s=PeekS(@lpFindFileData\cFileName)
; This is a not a directory
If lpFindFileData\dwFileAttributes & #FILE_ATTRIBUTE_DIRECTORY =#False
; Display File found
AddElement(Fichiers.s())
Fichiers()=Path+Trouve
;Debug "--> "+Path+Trouve
EndIf
; Exit when there is no more files
Until FileSearchStop = #True Or FindNextFile_(Handle, @lpFindFileData)= #False
; Close the Api search Function
if Handle
FindClose_(Handle)
Endif
EndIf
EndProcedure
***
Until FileSearchStop = #True Or FindNextFile_(Handle, @lpFindFileData)= #False
; Close the Api search Function
if Handle
FindClose_(Handle)
Endif
of course for applying and avoid conflict with droopy library i need to change name of fuctions. it will stop search process without killing thread?
and for SearchDirectory(Path.s,Mask.s) too.
and one more question - can GetSpecialFolderLocation shows path to "Programm Files (86)" in 64bits windows system? when my programm will be launch on 64bit - it will start wrong iexplorer - 64bit, but i need to start 32bit iexplorer when system is 64bit.
Re: DroopyLib
For FileSearchStop looking this in the next release.
For PFx86 you can use
Or 'Known Folders' (SHGetKnownFolderPath) can do this : see http://msdn.microsoft.com/en-us/library ... s.85).aspx
For PFx86 you can use
Code: Select all
GetEnvironmentVariable("ProgramFiles(x86)")
-
- Enthusiast
- Posts: 628
- Joined: Fri Feb 20, 2009 9:24 am
- Location: Almaty (Kazakhstan. not Borat, but Triple G)
- Contact:
Re: DroopyLib
i cant see function for webshortcut. if you not have it - maybe my is fit?
web shortcut have hot key option too, but i dont know what key what code...
Hotkey=1617 for example is Ctrl + Alt + Q
and i have some problem with Windows 7. my install makes shortcut in start menu - programs. in XP all looks fine. on W7 - in big first menu fine, in programs looks like my shortcut not have ico:

so if i see properties, and press the change icon button, but i am nothing change, just press OK - in this start menu starting show normal with icon, like it must show.
Code: Select all
ProcedureDLL CreateWebShortcut(Path.s,WebLink.s)
If CreateFile(0, Path)
WriteStringN(0, "[InternetShortcut]")
WriteStringN(0, "URL="+WebLink)
CloseFile(0)
Result = 1
EndIf
ProcedureReturn Result
EndProcedure
CreateWebShortcut("c:\PureBasic site.url","http://www.purebasic.fr")
Hotkey=1617 for example is Ctrl + Alt + Q
and i have some problem with Windows 7. my install makes shortcut in start menu - programs. in XP all looks fine. on W7 - in big first menu fine, in programs looks like my shortcut not have ico:

so if i see properties, and press the change icon button, but i am nothing change, just press OK - in this start menu starting show normal with icon, like it must show.