Jump to content

This site uses cookies. By continuing to browse the site you are agreeing to our use of cookies. Find out more here. X
X


Photo

Resources UDF


  • Please log in to reply
627 replies to this topic

#1 Zedna

Zedna

    AutoIt rulez!

  • MVPs
  • 8,717 posts

Posted 10 August 2007 - 05:03 PM

*
POPULAR

Link to pages with general resources description
MSDN - Resources OverView & Reference

You can embed any binary data into your AutoIt compiled EXE files in it's resources at compile time.
As opposite to FileInstall() with resources you can use your embedded data directly without any temporary files on disk.
If you wish you can save resources to disk with _ResourceSaveToFile() however.

Adding data to resources can be done simply by AutoIt3Wrapper directive:
#AutoIt3Wrapper_Res_File_Add=FileName, ResType, ResName

As data can be used for example images,cursors,texts,sounds,videos,binary files etc.
For loading/using data from resources at run time I made this tiny helper Resources UDF.

Functions inside UDF:
_ResourceGet($ResName, $ResType = $RT_RCDATA, $ResLang = 0, $DLL = -1)
_ResourceGetAsString($ResName, $ResType = $RT_RCDATA, $ResLang = 0
, $DLL = -1)
_ResourceGetAsStringW($ResName, $ResType = $RT_RCDATA, $ResLang = 0, $DLL = -1)
_ResourceGetAsBytes($ResName, $ResType = $RT_RCDATA, $ResLang = 0, $DLL = -1)
_ResourceGetAsImage($ResName, $ResType =
$RT_RCDATA, $DLL = -1)
_ResourceGetAsBitmap($ResName, $ResType =
$RT_RCDATA, $DLL = -1)
_ResourceSaveToFile($FileName, $ResName, $ResType = $RT_RCDATA, $ResLang = 0, $CreatePath = 0
, $DLL = -1)
_ResourceSetImageToCtrl($CtrlId, $ResName, $ResType = $RT_RCDATA
, $DLL = -1)
_SetBitmapToCtrl($CtrlId, $hBitmap)
_ResourcePlaySound($ResName, $Flag = 0, $DLL = -1)

Notes:
* to compile all script examples you must have installed Scite4AutoIt3 --> you must compile script by F7 from full Scite
* for using #AutoIt3Wrapper_Res_File_Add directive you must have AutoIt3Wrapper at least version 2.0.1.22 (it's part of latest Scite4AutoIt3)
* to compile all script examples must be apropriate resource data files in script directory (from resource_data.zip)
* _ResourceGet() always returns pointer to data (for RT_BITMAP returns hBitmap), returning other types can be done by additional wrapper functions like _ResourceGetAsString() or _ResourceGetAsBytes()
* _ResourceGetAsStringW() is for Unicode strings (Widechar)
* you can use also #number instead of resource name, see examples
* general supported resource types are listed in UDF as constants ($RT_BITMAP, $RT_RCDATA, ...)
* information about playing video files (AVI) from resources is here thanks matrixnz
* information/examples about using animated GIFs from resources is here and here thanks smashly/ProgAndy
* information about running EXE files/DLL functions directly from resources is here thanks trancexx/Ward

Known problems/limitations:
* _ResourceGet() returns resource size (in bytes) in @extended macro but not for resource type RT_BITMAP
* _ResourceSetImageToCtrl() works with "static/button" type of controls (picture,label,icon,button,checkbox,radiobutton,groupbox)
* _ResourcePlaySound() plays only WAV files (not MP3 files)
* _ResourceGetAsBytes() doesn't work for RT_BITMAP type
because _ResourceGet() returns hBitmap instead of memory pointer in this case
there could be used _ResourceGetAsImage() as workaround
* _ResourceGet() has potential memory leak
releasing of resources UnlockResource,FreeResource (opposite of LoadResource,LockResource) is not done
because it must be done after using of resources at the end and not inside UDF
* _GDIPlus_Startup() is called once at start of whole include --> no _GDIPlus_Shutdown() is called

History:
Plain Text         
2011-06-20 - fixed x64 compatibility (type: int->ptr) - internal change: FindResourceA -> FindResourceW (& type: str->wstr) - _SetBitmapToCtrl() --> $CtrlId parameter now supports also -1 (thanks guinness) - _WinAPI_LoadLibraryEx($DLL, $LOAD_LIBRARY_AS_DATAFILE) instead of _WinAPI_LoadLibrary($DLL) (thanks arcker) - added au3.user.calltips.api, au3.userudfs.properties (thanks guinness) - merged resource_au3.zip + resource_data.zip to one file resources.zip 2010-02-12 - all examples now use fixed #AutoIt3Wrapper_Res_File_Add directive from latest Scite4Autoit3 (no need for ResHacker.exe) - added support for buttons (also checkboxes,radiobuttons,groupboxes) in _ResourceSetImageToCtrl()/_SetBitmapToCtrl() thanks Melba   2009-08-25  - fixed corrupted topic (appeared after forum upgrade)  - removed some AU3 tags from topic, note: all AU3 code is untouched inside attached ZIP 2008-11-27  - added _ResourceGetAsStringW() --> for Unicode strings (Widechar)   2008-11-10  - added two very simple examples   2008-08-14  - change: _GDIPlus_Startup() is called once at start of whole include--> no _GDIPlus_Shutdown() is called  - fixed support for animated GIFs in _ResourceGetAsImage() --> removed_MemGlobalFree($hData)  - used simpler UDF syntax (from WinAPI) instead of DllCall() where possible  - added new example for animated GIF image   2008-07-08  - just corrected some typos in this topic (no code changes)   2008-06-25  - big thanks to ProgAndy for ideas,improvements!  - added _ResourceGetAsImage(), _ResourceGetAsBitmap()  - added optional $DLL parameter to all functions - for loading resources from external EXE,DLL files  - fixed previous limitation in _ResourceSaveToFile() - now supports also RT_BITMAP type  - new examples in resource_test.au3   2008-05-02  - added new RT,SND constants  - fixed bad order of parameters ResName x ResType in FindResourceExA (thanks SmOke_N)  - added DeleteObject of oldBmp from STM_SETIMAGE in _SetBitmapToCtrl (thanks ProgAndy)  - added settinng SS_BITMAP style to control before STM_SETIMAGE in_SetBitmapToCtrl (support for labels)   2008-04-24  - added support for JPG,GIF,PNG in _ResourceSetImageToCtrl() using GDI+ - thanks ProgAndy  - reverted all examples back from #AutoIt3Wrapper_Res_File_Add= to#AutoIt3Wrapper_run_after=ResHacker.exe -add  - updated both ZIP archives   2007-10-16  - added _ResourcePlaySound() - thanks Larry  - corrected local declaration of $struxt - was problem when Opt("MustDeclareVars",1)  - updated resource_test.au3 and resource.au3 in resource_au3.zip   2007-09-14  - added optional parameter $CreatePath in _ResourceSaveToFile()  - updated resource_test.au3 and resource.au3 in resource_au3.zip   2007-09-11  - in examples used new AutoIt3Wrapper directive#AutoIt3Wrapper_Res_File_Add from latest Scite4AutoIt3  (instead of #AutoIt3Wrapper_run_after=ResHacker.exe -add ...)  - updated resource_test.au3 and resource_test_ie.au3 in resource_au3.zip   2007-09-05  - in #AutoIt3Wrapper_run_after=ResHacker.exe -add ... directive can be resource type in text form  -->rcdata instead of 10, bitmap instead of 2 and so on (note: but for htmlmust be used 23 still)  - updated only resource_test.au3 in resource_au3.zip   2007-09-04  - added description at top of this topic  - added _ResourceSaveToFile() - source is also example for using _ResourceGetAsBytes()  - more error checking in UDF and error codes are now differrent todistinguish possible problem  - default ResType = 10 ($RT_RCDATA) in all functions  - updated both ZIP archives   2007-08-29  - added TODO list  - removed not used local variables in _ResourceSetImageToCtrl() - ziparchive not updated yet  - revisited WWW links and TODO list and added list of functions   2007-08-10  - first version


resource_test_min1.au3 - very simple example script of using UDF
#AutoIt3Wrapper_Res_File_Add=image3.jpg, rt_rcdata, TEST_JPG_1 #include "resources.au3"   $gui = GUICreate("Data from resources simple example 1",400,150) $pic1 = GUICtrlCreatePic("",0,0,400,150) _ResourceSetImageToCtrl($pic1, "TEST_JPG_1") ; set JPG image to picture control from resource GUISetState(@SW_SHOW) While 1  If GUIGetMsg() = -3 Then Exit WEnd


resource_test.au3 - complex example script of using UDF
AutoIt         
#AutoIt3Wrapper_Res_File_Add=test_1.txt, rt_rcdata, TEST_TXT_1 #AutoIt3Wrapper_Res_File_Add=image1.bmp, rt_bitmap, TEST_BMP_1 #AutoIt3Wrapper_Res_File_Add=image2.bmp, rt_bitmap, TEST_BMP_2 #AutoIt3Wrapper_Res_File_Add=image3.jpg, rt_rcdata, TEST_JPG_3 #AutoIt3Wrapper_Res_File_Add=binary1.dat, rt_rcdata, TEST_BIN_1 #AutoIt3Wrapper_Res_File_Add=C:\WINDOWS\Media\tada.wav, sound, TEST_WAV_1 #include "resources.au3"   $gui = GUICreate("Data from resources example",820,400) $pic1 = GUICtrlCreatePic("",0,0,400,300) $pic2 = GUICtrlCreatePic("",400,0,400,150) $pic3 = GUICtrlCreatePic("",400,150,400,150) $pic4 = GUICtrlCreatePic("",600,320,400,100) $label1 = GUICtrlCreateLabel("",20,320,380,100) $label2 = GUICtrlCreateLabel("",400,320,200,100) GUISetState(@SW_SHOW) ; get string from resource $string = _ResourceGetAsString("TEST_TXT_1") GUICtrlSetData($label1, $string) ; set BMP image to picture control from resource bitmap _ResourceSetImageToCtrl($pic1, "TEST_BMP_1", $RT_BITMAP) ; get bitmap from resource (as pointer) $hBmp = _ResourceGet("TEST_BMP_2", $RT_BITMAP) ; and use it for whatever you like _SetBitmapToCtrl($pic2, $hBmp) ; set JPG image to picture control from resource _ResourceSetImageToCtrl($pic3, "TEST_JPG_3") ; set image to picture control from external DLL resource _ResourceSetImageToCtrl($pic4, "#14355", $RT_BITMAP, @SystemDir & "\shell32.dll") ; get/use picture from resources as hImage type $size1 = _ResourceGetImageSize("TEST_BMP_1", $RT_BITMAP) $size2 = _ResourceGetImageSize("TEST_JPG_3") GUICtrlSetData($label2, $size1 & @CRLF & $size2) ; save binary data or another type (image) from resource to file and get its size in bytes $size1 = _ResourceSaveToFile(@ScriptDir & "\binary_data1.dat", "TEST_BIN_1") $size2 = _ResourceSaveToFile(@ScriptDir & "\binary_data2.bmp", "TEST_BMP_1", $RT_BITMAP) ; save binary data from resource to file (create not existing directory) _ResourceSaveToFile("C:\Dir1\SubDir2\binary_data1.dat", "TEST_BIN_1", $RT_RCDATA, 0, 1) _ResourceSaveToFile("C:\Dir1\SubDir2\binary_data2.bmp", "TEST_BMP_1", $RT_BITMAP, 0, 1) ; play WAV from resource (sync/async) _ResourcePlaySound("TEST_WAV_1") _ResourcePlaySound("TEST_WAV_1", $SND_ASYNC) While 1  If GUIGetMsg() = -3 Then Exit WEnd Func _ResourceGetImageSize($ResName, $ResType = 10) ; $RT_RCDATA = 10  ; get/use picture from resources as hImage type  $hImage = _ResourceGetAsImage($ResName, $ResType)  $width = _GDIPlus_ImageGetWidth ($hImage)  $height = _GDIPlus_ImageGetHeight($hImage)    Return "Size of " & $ResName & " is: " & $width & "x" & $height EndFunc


resources.zip - UDF + examples + sample resource data for examples
Spoiler



Previous downloads: 7195

Attached Files


Edited by Zedna, 21 June 2011 - 01:05 AM.

  • footswitch, sensalim, mesale0077 and 5 others like this







#2 Zedna

Zedna

    AutoIt rulez!

  • MVPs
  • 8,717 posts

Posted 11 August 2007 - 12:24 AM

Note: I have problems with edit original post from my Opera (second autoit script in autoit tags gets corrupted)
so I will add it here:


Some descriptions:
#compiler_run_after=ResHacker.exe -add resource_test.exe, resource_test.exe, test_1.txt , 10, TEST_1, 0

in the above directive
test_1.txt means file with data (may be TXT or binary) to be included as resource
10 means RT_RCDATA type of resource
TEST_1 is choosen resource name
0 at the end is LangId - lang_neutral = 0

#compiler_run_after=ResHacker.exe -add resource_test.exe, resource_test.exe, test_1.txt , 10, TEST_1, 0

can be also replaced by adding precompiled RES file:

Test_1.rc
TEST_1 RCDATA "test_1.txt"


compile RC file to RES file:
rc.exe Test_1.rc

changed directive for adding precompiled RES resource instead of source data file (Test_1.txt)
#compiler_run_after=ResHacker.exe -add resource_test.exe, resource_test.exe, test_1.res ,,,



Maybe some AutoIt3Wrapper resource directive could be added for simplicify adding such resources,
something similar to #AutoIt3Wrapper_Res_Icon_Add=
for example:
1) precompiled resources
#AutoIt3Wrapper_Res_Add=filename1.res #AutoIt3Wrapper_Res_Add=filename2.res

and/or
2) data from source files
#AutoIt3Wrapper_Res_Data_Add=filename1.txt,RT_RCDATA,res_name1 #AutoIt3Wrapper_Res_Data_Add=filename2.dat,RT_RCDATA,res_name2 #AutoIt3Wrapper_Res_Data_Add=filename3.jpg,RT_RCDATA,res_name3 #AutoIt3Wrapper_Res_Data_Add=filename4.bmp,RT_BITMAP,res_name4


so it's: #AutoIt3Wrapper_Res_Data_Add=filename,datatype,resource name

EDIT:
but the best solution will be direct Autoit directive (similar to #include)
#resource=filename1.res #resource=filename2.res


Note: bitmap resources can be used by using LoadLibrary, LoadImage API calls, see Larry's LoadImage examples from this and this - SetBitmapResourceToPicCtrl()

Edited by Zedna, 11 August 2007 - 12:37 PM.


#3 martin

martin

    ~~\o/~~~/0\=¬''~~~

  • MVPs
  • 7,321 posts

Posted 11 August 2007 - 07:18 PM

This looks like what a lot of people have been asking for, and although you only created this thread yesterday, I'm surpised there aren't a lot of replies already. I haven't tried it yet but it looks like your usual excellent work Zedna. Thanks for this script.

Edited by martin, 11 August 2007 - 07:19 PM.

Serial port communications UDF Includes functions for binary transmission and reception.printing UDF Useful for graphs, forms, labels, reports etc.Add User Call Tips to SciTE for functions in UDFs not included with AutoIt and for your own scripts.Functions with parameters in OnEvent mode and for Hot Keys One function replaces GuiSetOnEvent, GuiCtrlSetOnEvent and HotKeySet.UDF IsConnected2 for notification of status of connected state of many urls or IPs, without slowing the script.

#4 Zedna

Zedna

    AutoIt rulez!

  • MVPs
  • 8,717 posts

Posted 11 August 2007 - 08:21 PM

This looks like what a lot of people have been asking for, and although you only created this thread yesterday, I'm surpised there aren't a lot of replies already. I haven't tried it yet but it looks like your usual excellent work Zedna. Thanks for this script.


Thanks for positive feedback martin.

JdeB said that he can add some Autoi3Wrapper directive if we can simplify all that resource process/examples.

#5 rover

rover

    unmutual

  • Active Members
  • PipPipPipPipPipPip
  • 825 posts

Posted 11 August 2007 - 09:10 PM

Zedna this is great

how do I use for internal bitmap?

I've run the text demo above O.K.

I'm already using Larry's UDF in one of my scripts to use internal bitmaps without using fileinstall or a resource dll


is it the _ResourceGetAsPointer function?
if so what data / format is used for $ResSize?

$pic = _ResourceGetAsBytes("WINNT_BMP", $RT_BITMAP)
$pic = _ResourceGetAsPointer("WINNT_BMP", $RT_BITMAP) obviously needs third parameter


i know to use directive:

#AutoIt3Wrapper_Run_After=ResHacker.exe -add resource_test.exe, resource_test.exe, winnt.bmp , 2, WINNT_BMP, 0ƒo݊÷ Û­†Ç+Š›ZÖæ¦)ìjgŸ¢W^­«+zÈZrG«­ë!iÉ®»§¶èºp­ªiz¸Z²šènW¦Â+a²–œzȧ¥«a©ž J®¢Óë¢ Ú™ø¥zÊ®¢Ø­r‰©ŠW¬¶¢™¨Š{h¶žÅ觶›ŠÙš¦Çœ¶*'¡úÞ²‹«qëºÜ!jج¶Ÿºw-Š‰Ú×è®f­¶‡h¶¬jgš²Øb±«­¢+ؘŒÀÌØíÕ¥Á¥ŒÄ€ôU% Ñɱ ɕ…Ñ•A¥Œ ™ÅÕ½Ðì™ÅÕ½Ð찀À°€À°€ÈÜÔ°€ÄÜа€´Ä°€˜ŒÀÌØí]M}a}1eI¤((í…́Õ͕Ý¥Ñ 1…ÉÉ䘌Ìäí́U€M•Ñ ¥Ñµ…ÁI•Í½Õɍ•Q½A¥ ÑÉ°()M•Ñ   ¥Ñµ…ÁI•Í½Õɍ•Q½A¥ ÑÉ° ˜ŒÀÌØíÕ¤°˜ŒÀÌØíÕ¥Á¥ŒÄ±MÉ¥ÁÑÕ±±A…Ñ °™ÅÕ½Ðí]%99Q}    5@™ÅÕ½Ðì


Thanks!

#6 Zedna

Zedna

    AutoIt rulez!

  • MVPs
  • 8,717 posts

Posted 11 August 2007 - 09:35 PM

Zedna this is great

how do I use for internal bitmap?

I've run the text demo above O.K.

I'm already using Larry's UDF in one of my scripts to use internal bitmaps without using fileinstall or a resource dll

Thanks!


I will accomodate Larry's SetBitmapResourceToPicCtrl() function to make it more compatible/usable with my UDF
and will make also example for bitmaps.

Stay tuned ...

Edited by Zedna, 11 August 2007 - 09:38 PM.


#7 Zedna

Zedna

    AutoIt rulez!

  • MVPs
  • 8,717 posts

Posted 12 August 2007 - 01:02 AM

Here is promised first working bitmap from resource example with changed (simplified) Larry's SetBitmapResourceToPicCtrl() function:
Unfortunatelly
#compiler_run_after=upx.exe --compress-resources=0 resource_test_bmp.exe
will cause not adding bitmap resource so it must be compiled without UPX :)

I discovered that problem is in second #compiler_run_after= which will not wait for the first #compiler_run_after= to be finished - with my big testing bitmap)

note: image1.bmp is in my case 800x600 and 1.5MB size and is located in script directory

resource_test_bmp.au3
AutoIt         
#compiler_useupx=n   #compiler_run_after=ResHacker.exe -add resource_test_bmp.exe, resource_test_bmp.exe, image1.bmp, 2, TEST_BMP_1, 0 ;#compiler_run_after=upx.exe --compress-resources=0 resource_test_bmp.exe       $gui = GUICreate("Bitmap from resources test",900,700)   $pic = GUICtrlCreatePic("",0,0,800,600)   GUISetState()     SetBitmapResourceToPicCtrl($gui,$pic,"TEST_BMP_1")     While 1       If GUIGetMsg() = -3 Then Exit   WEnd     Func SetBitmapResourceToPicCtrl($hwnd,$ctrl,$resource)       Local Const $STM_SETIMAGE = 0x0172       Local Const $IMAGE_BITMAP = 0       Local Const $LR_CREATEDIBSECTION = 0x2000       Local Const $LR_COPYDELETEORG = 8         $hwnd = ControlGetHandle($hwnd,"",$ctrl)             Local $hInstance = DllCall("kernel32.dll","int","GetModuleHandleA", "int",0)       $hInstance = $hInstance[0]           Local $hBitmap = DLLCall("user32.dll","hwnd","LoadImage","hwnd",$hInstance,"str",$resource, _               "int",$IMAGE_BITMAP,"int",0,"int",0,"int",0)       $hBitmap = $hBitmap[0]             DeleteObject(_SendMessage($hwnd,$STM_SETIMAGE,$IMAGE_BITMAP,$hBitmap,0,"int","int","hwnd"))   EndFunc     Func _SendMessage($hWnd, $msg, $wParam = 0, $lParam = 0, $r = 0, $t1 = "int", $t2 = "int", $t3 = "long")      Local $ret = DllCall("user32.dll", $t3, "SendMessage", "hwnd", $hWnd, "int", $msg, $t1, $wParam, $t2, $lParam)       If @error Then Return SetError(@error, @extended, "")       If $r >= 0 And $r <= 4 Then Return $ret[$r]       Return $ret   EndFunc ; _SendMessage()     Func DeleteObject($hObj)       Local $bResult = DllCall('gdi32.dll', 'int', 'DeleteObject', 'hwnd', $hObj)       Return $bResult[0]   EndFunc   ;==>DeleteObject


I will make some change in my resources.au3 UDF to be more general.
Idea is to to have one general function
_ResourceGet($ResName, $ResType, $ResLang = 0)

which will return result based on the given type
also ResSize will be returned in @extended macro

I have not too much time now, so stay tuned ...

Edited by Zedna, 12 August 2007 - 10:36 AM.


#8 Zedna

Zedna

    AutoIt rulez!

  • MVPs
  • 8,717 posts

Posted 12 August 2007 - 03:45 PM

Some notes about directives for adding resources:
- 10=RT_RCDATA, 2=RT_BITMAP
- instead of EXE name can be used %out% parameter
- in new Scite4Autoit3 is #AutoIt3Wrapper_Run_After= directive instead of old #compiler_run_after= directive

RT_RCDATA example old way
#compiler_run_after=ResHacker.exe -add resource_test.exe, resource_test.exe, test_1.txt, 10, TEST_1, 0   #compiler_run_after=upx.exe --compress-resources=0 resource_test.exe


RT_RCDATA example better way with %out%
#compiler_run_after=ResHacker.exe -add %out%, %out%, test_1.txt, 10, TEST_1, 0   #compiler_run_after=upx.exe --compress-resources=0 %out%


***

RT_BITMAP example old way
#compiler_run_after=ResHacker.exe -add resource_test_bmp.exe, resource_test_bmp.exe, image1.bmp, 2, TEST_BMP_1, 0   #compiler_run_after=upx.exe --compress-resources=0 resource_test_bmp.exe


RT_BITMAP example better way with %out%
#compiler_run_after=ResHacker.exe -add %out%, %out%, image1.bmp, 2, TEST_BMP_1, 0   #compiler_run_after=upx.exe --compress-resources=0 %out%

Edited by Zedna, 12 August 2007 - 03:50 PM.


#9 RazerM

RazerM

    cowinkeedenky - coincidence?

  • Active Members
  • PipPipPipPipPipPip
  • 1,246 posts

Posted 12 August 2007 - 06:39 PM

I had to make sure reshacker was in same dir as files (didn't use upx), but it works well. I hope it becomes easier to use. :)

Edited by RazerM, 12 August 2007 - 06:39 PM.

My Programs:AInstall - Create a standalone installer for your programUnit Converter - Converts Length, Area, Volume, Weight, Temperature and Pressure to different unitsBinary Clock - Hours, minutes and seconds have 10 columns each to display timeAutoIt Editor - Code Editor with Syntax Highlighting.Laserix Editor & Player - Create, Edit and Play Laserix LevelsLyric Syncer - Create and use Synchronised Lyrics.Connect 4 - 2 Player Connect 4 Game (Local or Online!, Formatted Chat!!)MD5, SHA-1, SHA-256, Tiger and Whirlpool Hash Finder - Dictionary and Brute Force FindCool Text Client - Create Rendered ImageMy UDF's:GUI Enhance - Enhance your GUIs visually.IDEA File Encryption - Encrypt and decrypt files easily! File Rename - Rename files easilyRC4 Text Encryption - Encrypt text using the RC4 AlgorithmPrime Number - Check if a number is primeString Remove - remove lots of strings at onceProgress Bar - made easySound UDF - Play, Pause, Resume, Seek and Stop.

#10 Zedna

Zedna

    AutoIt rulez!

  • MVPs
  • 8,717 posts

Posted 12 August 2007 - 09:13 PM

this fails
#AutoIt3Wrapper_Run_After="%scitedir%\AutoIt3Wrapper\ResHacker.exe" -script C:\Program Files\AutoIt3\Examples\reshack.txt
this fails
#AutoIt3Wrapper_Run_After="%scitedir%\AutoIt3Wrapper\ResHacker.exe" -script "C:\Program Files\AutoIt3\Examples\reshack.txt"

this works
#AutoIt3Wrapper_Run_After="%scitedir%\AutoIt3Wrapper\ResHacker.exe" -script C:\Compile\reshack.txt
reshacker script method (same method as used in autoit3wrapper.au3, that's whats used for extra icon add)

try this:
#AutoIt3Wrapper_Run_After="%scitedir%\AutoIt3Wrapper\ResHacker.exe" -script "C:\Progra~1\AutoIt3\Examples\reshack.txt"

Zedna, I noticed when first trying Larry's UDF that it used a variation on _SendMessage() (and same name) in Misc.au3 include
which your example above has, they being essentially the same if you remove this "hwnd" from the DeleteObject line.

otherwise if you use Misc.au3 in your script you will get a conflict with having two same named functions
or wrong number of arguments message if you don't use the modified function

from DeleteObject(_SendMessage($hwnd,$STM_SETIMAGE,$IMAGE_BITMAP,$hBitmap,0,"int","int","hwnd")) to DeleteObject(_SendMessage($hwnd,$STM_SETIMAGE,$IMAGE_BITMAP,$hBitmap,0,"int","int"))

You are right.
I know about that _SendMessage variation from Larry. He made it due to differrent output type (hwnd instead of long.
I tried it also with standard output type (long) from Misc.au3 and it works fine.
So in final UDF version will be used _SendMessage from Misc.au3.

also, I guess/assume that ResSize has to do with resizing image?

ResSize is output parameter for get resource size. This ResSize is used later for DllSctructCreate().
I said that this will be changed - resource size will be returned in @extended macro.

one thing about compiling bitmaps as resources is you can't resize the image, you have to
adjust your image size to what you want before compiling into exe.
Thanks for your above bitmap example and the work your doing on this UDF,
not much comment here yet, but obvious interest in other threads on this in the forum, especially Larry's UDF

OK.

Edit:
upx compression works if run manually after compiling exe
i noticed in my case that when using icon add and compiling in bitmaps for my toolbar
that upx compressing after exe compiled would break the link to the internal icon resources but not the default program icon
or bitmaps (blank toolbar)

Read my above post. I discovered this too. It's probably error in Autoit3Wrapper:

I discovered that problem is in second #compiler_run_after= which will not wait for the first #compiler_run_after= to be finished - with my big testing bitmap)

As I said: I will make some changes and cleanup later. Stay tuned...

Edited by Zedna, 12 August 2007 - 09:21 PM.


#11 Zedna

Zedna

    AutoIt rulez!

  • MVPs
  • 8,717 posts

Posted 13 August 2007 - 05:05 PM

Good news folks!! :)

Here is new version of my resource UDF and new simple/clean example for using:

resource_test.au3 - example for TXT and BMP data in resources
AutoIt         
#compiler_useupx=n #compiler_run_after=ResHacker.exe -add %out%, %out%, test_1.txt, 10, TEST_TXT_1, 0 #compiler_run_after=ResHacker.exe -add %out%, %out%, image1.bmp, 2, TEST_BMP_1, 0 #compiler_run_after="c:\program files\Autoit3\Aut2Exe\upx.exe" --compress-resources=0 "%out%" #include "resources.au3"   $gui = GUICreate("Data from resources test",900,700) $pic = GUICtrlCreatePic("",0,0,800,600) $label = GUICtrlCreateLabel("",20,620,800,100) GUISetState(@SW_SHOW) ; string from resource $string = _ResourceGetAsString("TEST_TXT_1", $RT_RCDATA) GUICtrlSetData($label, $string) ; bitmap from resource $hBmp = _ResourceGet("TEST_BMP_1", $RT_BITMAP) _SetBitmapToCtrl($gui, $pic, $hBmp) While 1     If GUIGetMsg() = -3 Then Exit WEnd Func _SetBitmapToCtrl($hWnd, $CtrlId, $hBitmap)     Local Const $STM_SETIMAGE = 0x0172     Local Const $IMAGE_BITMAP = 0     $hWnd = ControlGetHandle($hWnd, "", $CtrlId)         DllCall("user32.dll", "hwnd", "SendMessage", "hwnd", $hWnd, "int", $STM_SETIMAGE, "int", $IMAGE_BITMAP, "int", $hBitmap)     DllCall('gdi32.dll', 'int', 'DeleteObject', 'hwnd', $hBitmap) EndFuncƒo݊÷ ÙºÞ²‹«që»uöÚºÚ"µÍˆÚ[˜ÛYK[ۘÙQÛؘ[ÛۜÝ ˆÌ ͎ԕÐÕT”ÓԈH B‘Ûؘ[ÛۜÝ    ˆÌ ͎ԕВUPTH ‚‘Ûؘ[ÛۜÝ   ˆÌ ͎ԕÒPÓӈH ‘Ûؘ[ÛۜÝ   ˆÌ ͎ԕÓQS•HH ‘Ûؘ[ÛۜÝ  ˆÌ ͎ԕÑPSÑÈH B‘Ûؘ[ÛۜÝ  ˆÌ ͎ԕÔÕ’S‘ÈH ‚‘Ûؘ[ÛۜÝ ˆÌ ͎ԕѓӕTˆH ‘Ûؘ[ÛۜÝ ˆÌ ͎ԕѓӕH‘Ûؘ[ÛۜÝ    ˆÌ ͎ԕÐPÐÑSTUԔÈHB‘Ûؘ[ÛۜÝ ˆÌ ͎ԕԐÑUHH L‘Ûؘ[ÛۜÝ  ˆÌ ͎ԕÓQTÔÐQÑUP“HH LB‘Ûؘ[ÛۜÝ  ˆÌ ͎ԕÑԓÕTÐÕT”ÓԈH L‚‘Ûؘ[ÛۜÝ    ˆÌ ͎ԕÑԓÕTÒPÓӈH M‘Ûؘ[ÛۜÝ ˆÌ ͎ԕՑT”ÒSӈH M‘Ûؘ[ÛۜÝ   ˆÌ ͎ԕÐS’PÕT”ÓԈH ŒB‘Ûؘ[ÛۜÝ  ˆÌ ͎ԕÐS’RPÓӈH Œ‚‘Ûؘ[ÛۜÝ ˆÌ ͎ԕÒSH ŒÂ‘Ûؘ[ÛۜÝ    ˆÌ ͎ԕÓPS’Q‘TÕH [˜ÈԙÛݘÙQÙ]     ˆÌ ͎ԙӘ[YK   ˆÌ ͎ԙÕK ˆÌ ͎ԙÓ[™ÈH BˆØØ[ÛۜÝ   ˆÌ ͎ÒSPQÑWВUPTH ˆØØ[    ˆÌ ͎Ú[œÝ[˜ÙK   ˆÌ ͎Úš]X  ˆÌ ͎Ò[™›Ð›ØÚË    ˆÌ ͎ÑÛؘ[Y[[ܞP›ØÚË  ˆÌ ͎ÓY[[ܞTÚ[‹   ˆÌ ͎ԙÔÚ^™Bˆˆ  ˆÌ ͎Ú[œÝ[˜ÙHHØ[     œ][ÝÚٛ™[ ̋™   œ][ÝË  œ][ÝÚ[    œ][ÝË  œ][ÝÑÙ][Ù[R[™PIœ][ÝË  œ][ÝÚ[    œ][ÝË Bˆ ˆÌ ͎Ú[œÝ[˜ÙHH  ˆÌ ͎Ú[œÝ[˜ÙVÌHYˆ    ˆÌ ͎ԙÕHH    ˆÌ ͎ԕВUPT[‚ˆ    ˆÌ ͎Úš]XHØ[     œ][ÝÝٌ̋™   œ][ÝË  œ][ÝÚۙ  œ][ÝË  œ][ÝÓØY[XYÙIœ][ÝË  œ][ÝÚۙ  œ][ÝË  ˆÌ ͎Ú[œÝ[˜ÙK   œ][ÝÜ݉œ][ÝË    ˆÌ ͎ԙӘ[YKˆ   œ][ÝÚ[    œ][ÝË  ˆÌ ͎ÒSPQÑWВUPT  œ][ÝÚ[    œ][ÝË    œ][ÝÚ[    œ][ÝË    œ][ÝÚ[    œ][ÝË Bˆ    ˆÌ ͎Úš]XH    ˆÌ ͎Úš]XÌBˆ™]›ˆ  ˆÌ ͎Úš]XÈ™]›œÈ[™HÈš]Xˆ[™YˆYˆ   ˆÌ ͎ԙÓ[™È   ›əÝÈ [‚ˆ    ˆÌ ͎Ò[™›Ð›ØÚÈHØ[     œ][ÝÚٛ™[ ̋™   œ][ÝË  œ][ÝÚ[    œ][ÝË  œ][Ýњ[™™ÛݘÙQ^Iœ][ÝË œ][ÝÚ[    œ][ÝË  ˆÌ ͎Ú[œÝ[˜ÙK   œ][ÝÜ݉œ][ÝË    ˆÌ ͎ԙӘ[YK   œ][ÝÛۙɜ][ÝË  ˆÌ ͎ԙÕK œ][ÝÜÚܝ    œ][ÝË  ˆÌ ͎ԙÓ[™ÊBˆ[ÙBˆ   ˆÌ ͎Ò[™›Ð›ØÚÈHØ[     œ][ÝÚٛ™[ ̋™   œ][ÝË  œ][ÝÚ[    œ][ÝË  œ][Ýњ[™™ÛݘÙPIœ][ÝË   œ][ÝÚ[    œ][ÝË  ˆÌ ͎Ú[œÝ[˜ÙK   œ][ÝÜ݉œ][ÝË    ˆÌ ͎ԙӘ[YK   œ][ÝÛۙɜ][ÝË  ˆÌ ͎ԙÕJBˆ[™Y‚ˆˆYˆœ›Üˆ[ˆ™]›ˆÙ]œ›ÜŠ K  Bˆ ˆÌ ͎Ò[™›Ð›ØÚÈH   ˆÌ ͎Ò[™›Ð›ØÚÖÌBˆYˆ   ˆÌ ͎Ò[™›Ð›ØÚÈH [ˆ™]›ˆÙ]œ›ÜŠ K  Bˆˆ  ˆÌ ͎ԙÔÚ^™HHØ[     œ][ÝÚٛ™[ ̋™   œ][ÝË  œ][ÝÙÛܙ    œ][ÝË  œ][ÝÔÚ^™[ٔ™ÛݘÙIœ][ÝË    œ][ÝÚ[    œ][ÝË  ˆÌ ͎Ú[œÝ[˜ÙK   œ][ÝÚ[    œ][ÝË  ˆÌ ͎Ò[™›Ð›ØÚÊBˆYˆœ›Üˆ[ˆ™]›ˆÙ]œ›ÜŠ K  Bˆ ˆÌ ͎ԙÔÚ^™HH ˆÌ ͎ԙÔÚ^™VÌBˆYˆ ˆÌ ͎ԙÔÚ^™HH [ˆ™]›ˆÙ]œ›ÜŠ K  Bˆˆ  ˆÌ ͎ÑÛؘ[Y[[ܞP›ØÚÈHØ[     œ][ÝÚٛ™[ ̋™   œ][ÝË  œ][ÝÚ[    œ][ÝË  œ][ÝÓØY™ÛݘÙIœ][ÝË œ][ÝÚ[    œ][ÝË  ˆÌ ͎Ú[œÝ[˜ÙK   œ][ÝÚ[    œ][ÝË  ˆÌ ͎Ò[™›Ð›ØÚÊBˆYˆœ›Üˆ[ˆ™]›ˆÙ]œ›ÜŠ K  Bˆ ˆÌ ͎ÑÛؘ[Y[[ܞP›ØÚÈH ˆÌ ͎ÑÛؘ[Y[[ܞP›ØÚÖÌBˆYˆ ˆÌ ͎ÑÛؘ[Y[[ܞP›ØÚÈH [ˆ™]›ˆÙ]œ›ÜŠ K  Bˆˆ  ˆÌ ͎ÓY[[ܞTÚ[ˆHØ[     œ][ÝÚٛ™[ ̋™   œ][ÝË  œ][ÝÚ[    œ][ÝË  œ][ÝÓØÚԙÛݘÙIœ][ÝË   œ][ÝÚ[    œ][ÝË  ˆÌ ͎ÑÛؘ[Y[[ܞP›ØÚÊBˆYˆœ›Üˆ[ˆ™]›ˆÙ]œ›ÜŠ K  Bˆ ˆÌ ͎ÓY[[ܞTÚ[ˆH  ˆÌ ͎ÓY[[ܞTÚ[–ÌBˆYˆ  ˆÌ ͎ÓY[[ܞTÚ[ˆH [ˆ™]›ˆÙ]œ›ÜŠ K  BˆˆÙ]^[™Y     ˆÌ ͎ԙÔÚ^™JBˆ™]›ˆ   ˆÌ ͎ÓY[[ܞTÚ[‚‘[™[˜Ñ[˜ÈԙÛݘÙQÙ]ÔÝš[™Ê  ˆÌ ͎ԙӘ[YK   ˆÌ ͎ԙÕK ˆÌ ͎ԙÓ[™ÈH BˆØØ[ ˆÌ ͎ԙÔÚ[‹   ˆÌ ͎ԙÔÚ^™H   ˆÌ ͎ԙÔÚ[ˆHԙÛݘÙQÙ]     ˆÌ ͎ԙӘ[YK   ˆÌ ͎ԙÕK ˆÌ ͎ԙÓ[™ÊBˆYˆœ›Üˆ[‚ˆÙ]œ›ÜŠ K  Bˆ™]›ˆ   ˆÌÎNɈÌÎNˆ[™Y‚ˆ  ˆÌ ͎ԙÔÚ^™HH^[™Yˆ    ˆÌ ͎ÜݝXÝHݝXÝܙX]J œ][ÝØÚ–Éœ][ÝÈ   ˜[È  ˆÌ ͎ԙÔÚ^™H   ˜[È  œ][Ý×Iœ][ÝË    ˆÌ ͎ԙÔÚ[ŠBˆ™]›ˆÝXÝÙ]]J   ˆÌ ͎ÜݝXÝ  JHÈ™]›œÈÝš[™Â‘[™[˜Ñ[˜ÈԙÛݘÙQÙ]О]Ê ˆÌ ͎ԙӘ[YK   ˆÌ ͎ԙÕK ˆÌ ͎ԙÓ[™ÈH BˆØØ[ ˆÌ ͎ԙÔÚ[‹   ˆÌ ͎ԙÔÚ^™H   ˆÌ ͎ԙÔÚ[ˆHԙÛݘÙQÙ]     ˆÌ ͎ԙӘ[YK   ˆÌ ͎ԙÕK ˆÌ ͎ԙÓ[™ÊBˆYˆœ›Üˆ[ˆ™]›ˆÙ]œ›ÜŠ K  Bˆ ˆÌ ͎ԙÔÚ^™HH^[™Yˆ™]›ˆÝXÝܙX]J  œ][Ý؞]Vɜ][ÝÈ   ˜[È  ˆÌ ͎ԙÔÚ^™H   ˜[È  œ][Ý×Iœ][ÝË    ˆÌ ͎ԙÔÚ[ŠHÈ™]›œÈÚ[ˆÈž]‘[™[˜


Notes:
- ResHacker.exe must be in script directory at compile time
- Image1.bmp, Test_1.txt must be in script directory at compile time
- ;#compiler_run_after=upx.exe --compress-resources=0 %out% can't be used directly due to Autoit3Wrapper bug (see above posts)
so for now you can run command upx.exe --compress-resources=0 resource_test.exe after compilation
EDIT: solved: sorry JdeB for my mistake
- _ResourceGet() always returns pointer, returning other types can be done by additional wrapper functions like _ResourceGetAsString() or _ResourceGetAsBytes() - see resource.au3 UDF
- LoadImage can be used also for icons and cursors. For icons it's not neccessary because icons (from resources) are supported by GUICtrlSetImage already
- _ResourceGet() returns resource size (in bytes) in @extended macro but not for resource type RT_BITMAP
- _SetBitmapToCtrl() is changed Larry's SetBitmapResourceToPicCtrl() which is used in my example as separate function not included in my resource UDF because it's not resource related function

Post your comments to this stuff ...

EDIT: UPX directive solved: sorry JdeB for my mistake

Edited by Zedna, 13 August 2007 - 07:18 PM.


#12 Jos

Jos

    ...

  • Developers
  • 23,289 posts

Posted 13 August 2007 - 05:28 PM

Notes:
- ResHacker.exe must be in script directory at compile time
- Image1.bmp, Test_1.txt must be in script directory at compile time
- ;#compiler_run_after=upx.exe --compress-resources=0 %out% can't be used directly due to Autoit3Wrapper bug (see above posts)
so for now you can run command upx.exe --compress-resources=0 resource_test.exe after compilation

- _ResourceGet() always returns pointer, returning other types can be done by additional wrapper functions like _ResourceGetAsString() or _ResourceGetAsBytes() - see resource.au3 UDF
- LoadImage can be used also for icons and cursors. For icons it's not neccessary because icons (from resources) are supported by GUICtrlSetImage already
- _ResourceGet() returns resource size (in bytes) in @extended macro but not for resource type RT_BITMAP
- _SetBitmapToCtrl() is changed Larry's SetBitmapResourceToPicCtrl() which is used in my example as separate function not included in my resource UDF because it's not resource related function

Post your comments to this stuff ...


Give this a try for RUN_After:
#AutoIt3Wrapper_run_after=""c:\program files\Autoit3\Aut2Exe\upx.exe" --compress-resources=0 "%out%""


:)

Visit the SciTE4AutoIt3 Download page for the latest versions                                                                 Forum Rules
 
Live for the present,
Dream of the future,
Learn from the past.
  :)


#13 Zedna

Zedna

    AutoIt rulez!

  • MVPs
  • 8,717 posts

Posted 13 August 2007 - 07:00 PM

Give this a try for RUN_After:
#AutoIt3Wrapper_run_after=""c:\program files\Autoit3\Aut2Exe\upx.exe" --compress-resources=0 "%out%""

:)



Sorry JdeB for my mistake and thanks for working solution.

#14 Jos

Jos

    ...

  • Developers
  • 23,289 posts

Posted 13 August 2007 - 07:01 PM

Sorry JdeB for my mistake and thanks for working solution.

No problem .... its all a bit goofy depending on the OS used....
Its something you need to know how to code it ...

:)

Visit the SciTE4AutoIt3 Download page for the latest versions                                                                 Forum Rules
 
Live for the present,
Dream of the future,
Learn from the past.
  :)


#15 Zedna

Zedna

    AutoIt rulez!

  • MVPs
  • 8,717 posts

Posted 13 August 2007 - 07:43 PM

Bad news.
Edit post with autoit code tags on this forum is absolutely amazing!!

Therefore I will post my au3 code here as attachments:

EDIT:
removed attachments (number of previous downloads: 29 + 33)
see first post for the most recent version ...

Edited by Zedna, 30 August 2007 - 08:37 PM.


#16 martin

martin

    ~~\o/~~~/0\=¬''~~~

  • MVPs
  • 7,321 posts

Posted 13 August 2007 - 08:17 PM

Bad news.
Edit post with autoit code tags on this forum is absolutely amazing!!

Therefore I will post my au3 code here as attachments:



Fantastic Zedna. I've tested with a 5Mb bitmap and it works just as the manufacturer said it would! :)
And amazingly, if I compress it with upx it reduces the size from 5.61Mb to 4.88Mb and it still works.
If I compile it a second time then it produces a file which is 4.9Mb which runs ok, and if I use upx again it reduces to 4.3Mb and still runs. :P
If I delete the reshacker.ini and the reshacker.log files then if I compile again it is back to 5.61Mb :)
So I don't understand (among other things) the line
#compiler_run_after="c:\program files\Autoit3\Aut2Exe\upx.exe" --compress-resources=0 "%out%"

Edited by martin, 13 August 2007 - 08:51 PM.

Serial port communications UDF Includes functions for binary transmission and reception.printing UDF Useful for graphs, forms, labels, reports etc.Add User Call Tips to SciTE for functions in UDFs not included with AutoIt and for your own scripts.Functions with parameters in OnEvent mode and for Hot Keys One function replaces GuiSetOnEvent, GuiCtrlSetOnEvent and HotKeySet.UDF IsConnected2 for notification of status of connected state of many urls or IPs, without slowing the script.

#17 Zedna

Zedna

    AutoIt rulez!

  • MVPs
  • 8,717 posts

Posted 13 August 2007 - 09:45 PM

Fantastic Zedna. I've tested with a 5Mb bitmap and it works just as the manufacturer said it would! :)
And amazingly, if I compress it with upx it reduces the size from 5.61Mb to 4.88Mb and it still works.
If I compile it a second time then it produces a file which is 4.9Mb which runs ok, and if I use upx again it reduces to 4.3Mb and still runs. :P
If I delete the reshacker.ini and the reshacker.log files then if I compile again it is back to 5.61Mb :)
So I don't understand (among other things) the line
#compiler_run_after="c:\program files\Autoit3\Aut2Exe\upx.exe" --compress-resources=0 "%out%"


Good to hear that it's working fine :)

If you want the best compression you can add another parametres to upx.exe, for example:
#compiler_run_after="c:\program files\Autoit3\Aut2Exe\upx.exe" -9 --compress-resources=0 "%out%"
or
#compiler_run_after="c:\program files\Autoit3\Aut2Exe\upx.exe" --best --compress-resources=0 "%out%"

Note:
--compress-resources=0 means: Don't compress any resources at all.
So bitmap stored as resource must stay uncompressed by UPX to be usable by resource API functions.

Maybe sometimes in the future somebody will observe how to use also GIF,JPG,PNG directly from resources through some API functions (maybe GDI+) ...

#18 martin

martin

    ~~\o/~~~/0\=¬''~~~

  • MVPs
  • 7,321 posts

Posted 13 August 2007 - 10:09 PM

Good to hear that it's working fine :)

If you want the best compression you can add another parametres to upx.exe, for example:
#compiler_run_after="c:\program files\Autoit3\Aut2Exe\upx.exe" -9 --compress-resources=0 "%out%"
or
#compiler_run_after="c:\program files\Autoit3\Aut2Exe\upx.exe" --best --compress-resources=0 "%out%"

Note:
--compress-resources=0 means: Don't compress any resources at all.
So bitmap stored as resource must stay uncompressed by UPX to be usable by resource API functions.

Maybe sometimes in the future somebody will observe how to use also GIF,JPG,PNG directly from resources through some API functions (maybe GDI+) ...



The point is that the -resources=0 doesn't seem to make any significant difference, which is to say if I remove it the exe still works. If I omit the whole line and manually compress the exe with upx the exe is smaller and still works.
Serial port communications UDF Includes functions for binary transmission and reception.printing UDF Useful for graphs, forms, labels, reports etc.Add User Call Tips to SciTE for functions in UDFs not included with AutoIt and for your own scripts.Functions with parameters in OnEvent mode and for Hot Keys One function replaces GuiSetOnEvent, GuiCtrlSetOnEvent and HotKeySet.UDF IsConnected2 for notification of status of connected state of many urls or IPs, without slowing the script.

#19 Zedna

Zedna

    AutoIt rulez!

  • MVPs
  • 8,717 posts

Posted 13 August 2007 - 10:54 PM

The point is that the -resources=0 doesn't seem to make any significant difference, which is to say if I remove it the exe still works. If I omit the whole line and manually compress the exe with upx the exe is smaller and still works.

Really - you are right!
I'm surprised by this behaviour.

In my little test was best result with this UPX directive:
#compiler_run_after="c:\program files\Autoit3\Aut2Exe\upx.exe" --best "%out%"

With this directive it works with smallest size but ResHacker couldn't show included resources (it recognize them but not show it's content) and say: "File has non-standard resource layout. It's probably been compressed with an EXE compressor"

But sometimes it makes corrupted EXE (non worling without resources at all).
I tried recompile it several times and only sometimes it makes a crap.

#20 Zedna

Zedna

    AutoIt rulez!

  • MVPs
  • 8,717 posts

Posted 14 August 2007 - 09:33 AM

I did search for some GDI plus reference about loading images (BMP,GIF,JPG,PNG,TIFF,WMF,...) and found only this MSDN link
about Image Functions. There are functions GdipLoadImageFromFile() and GdipLoadImageFromStream() but there is no detailed description.
Can somebody tell me where is detailed reference of these GDI plus functions.

Note:
GdipLoadImageFromFile() is in Auto3Lib
GdipLoadImageFromStream() is not in Auto3Lib and maybe could be used to load compressed images (GIF,JPG,PNG) from resources




0 user(s) are reading this topic

0 members, 0 guests, 0 anonymous users