Jump to content

Recommended Posts

Posted

I have compiled script to exe without UPX compression and there is my string inside, so function _ResourceGetAsString() didn't work

Posted

Starting AutoIt3Wrapper v.2.0.0.1 Environment(Language:0415 Keyboard:00000415 OS:WIN_XP/Dodatek Service Pack 3 CPU:X86 OS:X86)

interesting what cause this bug?

Posted (edited)

ok, thanks! I also think so, maybe there is something wrong with dll library?

I checked including resources with AutoIt3Wrapper v.2.0.1.24 and finally everything is fine, uff. I see my strings in message box. The strangest thing is that on the autoitscript download page ('http://www.autoitscript.com/site/autoit-script-editor/downloads/') there is still version 2.0.0.1 inside ScieTe install package and the newest Wrapper to download as separate file is 2.0.1.24. From where did you get version 2.0.1.34? At the end I would like to thank you taiatel for your attention without it I will never solve my problem.

Edited by hevoxer
Posted

I checked including resources with AutoIt3Wrapper v.2.0.1.24 and finally everything is fine, uff. I see my strings in message box. The strangest thing is that on the autoitscript download page ('http://www.autoitscript.com/site/autoit-script-editor/downloads/') there is still version 2.0.0.1 inside ScieTe install package and the newest Wrapper to download as separate file is 2.0.1.24. From where did you get version 2.0.1.34?

For latest beta version look here

http://www.autoitscript.com/autoit3/scite/download/beta_SciTE4AutoIt3/

  • 2 months later...
Posted

Does anyone know why is my .jpg resized(bigger) after compilation?

I am using everything as .jpg example from example.au3

There are some posts about image from resource resizing in this topic.

Solution wrote somebody more clever than me ;-)

Please try to find it here, I can add that link to first post for others.

If you don't find it I will try to find it later.

Posted

I don't know if you knew Zedna, but the UDF is only compatible with x32. I recently found out after I compiled a Script for x64. Ones of these days I will sit down and have have a look through Resources UDF to see what the problems is :huh2:

UDF List:

 
_AdapterConnections()_AlwaysRun()_AppMon()_AppMonEx()_ArrayFilter/_ArrayReduce_BinaryBin()_CheckMsgBox()_CmdLineRaw()_ContextMenu()_ConvertLHWebColor()/_ConvertSHWebColor()_DesktopDimensions()_DisplayPassword()_DotNet_Load()/_DotNet_Unload()_Fibonacci()_FileCompare()_FileCompareContents()_FileNameByHandle()_FilePrefix/SRE()_FindInFile()_GetBackgroundColor()/_SetBackgroundColor()_GetConrolID()_GetCtrlClass()_GetDirectoryFormat()_GetDriveMediaType()_GetFilename()/_GetFilenameExt()_GetHardwareID()_GetIP()_GetIP_Country()_GetOSLanguage()_GetSavedSource()_GetStringSize()_GetSystemPaths()_GetURLImage()_GIFImage()_GoogleWeather()_GUICtrlCreateGroup()_GUICtrlListBox_CreateArray()_GUICtrlListView_CreateArray()_GUICtrlListView_SaveCSV()_GUICtrlListView_SaveHTML()_GUICtrlListView_SaveTxt()_GUICtrlListView_SaveXML()_GUICtrlMenu_Recent()_GUICtrlMenu_SetItemImage()_GUICtrlTreeView_CreateArray()_GUIDisable()_GUIImageList_SetIconFromHandle()_GUIRegisterMsg()_GUISetIcon()_Icon_Clear()/_Icon_Set()_IdleTime()_InetGet()_InetGetGUI()_InetGetProgress()_IPDetails()_IsFileOlder()_IsGUID()_IsHex()_IsPalindrome()_IsRegKey()_IsStringRegExp()_IsSystemDrive()_IsUPX()_IsValidType()_IsWebColor()_Language()_Log()_MicrosoftInternetConnectivity()_MSDNDataType()_PathFull/GetRelative/Split()_PathSplitEx()_PrintFromArray()_ProgressSetMarquee()_ReDim()_RockPaperScissors()/_RockPaperScissorsLizardSpock()_ScrollingCredits_SelfDelete()_SelfRename()_SelfUpdate()_SendTo()_ShellAll()_ShellFile()_ShellFolder()_SingletonHWID()_SingletonPID()_Startup()_StringCompact()_StringIsValid()_StringRegExpMetaCharacters()_StringReplaceWholeWord()_StringStripChars()_Temperature()_TrialPeriod()_UKToUSDate()/_USToUKDate()_WinAPI_Create_CTL_CODE()_WinAPI_CreateGUID()_WMIDateStringToDate()/_DateToWMIDateString()Au3 script parsingAutoIt SearchAutoIt3 PortableAutoIt3WrapperToPragmaAutoItWinGetTitle()/AutoItWinSetTitle()CodingDirToHTML5FileInstallrFileReadLastChars()GeoIP databaseGUI - Only Close ButtonGUI ExamplesGUICtrlDeleteImage()GUICtrlGetBkColor()GUICtrlGetStyle()GUIEventsGUIGetBkColor()Int_Parse() & Int_TryParse()IsISBN()LockFile()Mapping CtrlIDsOOP in AutoItParseHeadersToSciTE()PasswordValidPasteBinPosts Per DayPreExpandProtect GlobalsQueue()Resource UpdateResourcesExSciTE JumpSettings INISHELLHOOKShunting-YardSignature CreatorStack()Stopwatch()StringAddLF()/StringStripLF()StringEOLToCRLF()VSCROLLWM_COPYDATAMore Examples...

Updated: 22/04/2018

Posted

I don't know if you knew Zedna, but the UDF is only compatible with x32. I recently found out after I compiled a Script for x64. Ones of these days I will sit down and have have a look through Resources UDF to see what the problems is :huh2:

Thanks!

I can remember something with Unicode or X64 was discussed here already before, we tried API calls with W (widechar)

and there was probably int instead of correct ptr_ datatype somewhere in DllCalls.

Currently I have no acces to X64 for testing so thanks for help.

Posted (edited)

I hope you don't mind but I edited _SetBitmapToCtrl() so now the value of -1 can be used for the last ControlID created, just like GUICtrlSetData(-1, "Update") & the Native Functions do.

The idea came from a Function I created called

Example use of Function:

GUICtrlCreateLabel("", 5, 5, 40, 40)
    _ResourceSetImageToCtrl(-1, "EXAMPLE")

Function:

Func _SetBitmapToCtrl($iControlID, $hBitmap)
    Local Const $BM_SETIMAGE = 0xF7, $BS_BITMAP = 0x0080, $GWL_STYLE = -16, $IMAGE_BITMAP = 0, $SS_BITMAP = 0xE, $STM_SETIMAGE = 0x0172
    Local $hControlID, $hPreviousBitmap, $iControlID_BITMAP, $iControlID_SETIMAGE, $iStyle

    $hControlID = GUICtrlGetHandle($iControlID)
    If $hControlID = 0 Then
        Return SetError(1, 0, 0)
    EndIf
    $iControlID = _WinAPI_GetDlgCtrlID($hControlID)
    If @error Then
        Return SetError(2, 0, 0)
    EndIf

    Switch _WinAPI_GetClassName($iControlID)
        Case "Button" ; Button, Checkbox, Radiobutton, Groupbox
            $iControlID_SETIMAGE = $BM_SETIMAGE
            $iControlID_BITMAP = $BS_BITMAP
        Case "Static" ; Picture, Icon, Label
            $iControlID_SETIMAGE = $STM_SETIMAGE
            $iControlID_BITMAP = $SS_BITMAP
        Case Else
            Return SetError(3, 0, 0)
    EndSwitch

    ; Set SS_Bitmap/BS_Bitmap Style To The Control.
    $iStyle = _WinAPI_GetWindowLong($hControlID, $GWL_STYLE)
    If @error Then
        Return SetError(4, 0, 0)
    EndIf
    _WinAPI_SetWindowLong($hControlID, $GWL_STYLE, BitOR($iStyle, $iControlID_BITMAP))
    If @error Then
        Return SetError(5, 0, 0)
    EndIf

    ; Set Image To The Control.
    $hPreviousBitmap = GUICtrlSendMsg($iControlID, $iControlID_SETIMAGE, $IMAGE_BITMAP, $hBitmap) ; _SendMessage($hControlID, $iControlID_SETIMAGE, $IMAGE_BITMAP, $hBitmap)
    If @error Then
        Return SetError(6, 0, 0)
    EndIf
    If $hPreviousBitmap Then
        _WinAPI_DeleteObject($hPreviousBitmap)
    EndIf
    Return 1
EndFunc   ;==>_SetBitmapToCtrl
Edited by guinness

UDF List:

 
_AdapterConnections()_AlwaysRun()_AppMon()_AppMonEx()_ArrayFilter/_ArrayReduce_BinaryBin()_CheckMsgBox()_CmdLineRaw()_ContextMenu()_ConvertLHWebColor()/_ConvertSHWebColor()_DesktopDimensions()_DisplayPassword()_DotNet_Load()/_DotNet_Unload()_Fibonacci()_FileCompare()_FileCompareContents()_FileNameByHandle()_FilePrefix/SRE()_FindInFile()_GetBackgroundColor()/_SetBackgroundColor()_GetConrolID()_GetCtrlClass()_GetDirectoryFormat()_GetDriveMediaType()_GetFilename()/_GetFilenameExt()_GetHardwareID()_GetIP()_GetIP_Country()_GetOSLanguage()_GetSavedSource()_GetStringSize()_GetSystemPaths()_GetURLImage()_GIFImage()_GoogleWeather()_GUICtrlCreateGroup()_GUICtrlListBox_CreateArray()_GUICtrlListView_CreateArray()_GUICtrlListView_SaveCSV()_GUICtrlListView_SaveHTML()_GUICtrlListView_SaveTxt()_GUICtrlListView_SaveXML()_GUICtrlMenu_Recent()_GUICtrlMenu_SetItemImage()_GUICtrlTreeView_CreateArray()_GUIDisable()_GUIImageList_SetIconFromHandle()_GUIRegisterMsg()_GUISetIcon()_Icon_Clear()/_Icon_Set()_IdleTime()_InetGet()_InetGetGUI()_InetGetProgress()_IPDetails()_IsFileOlder()_IsGUID()_IsHex()_IsPalindrome()_IsRegKey()_IsStringRegExp()_IsSystemDrive()_IsUPX()_IsValidType()_IsWebColor()_Language()_Log()_MicrosoftInternetConnectivity()_MSDNDataType()_PathFull/GetRelative/Split()_PathSplitEx()_PrintFromArray()_ProgressSetMarquee()_ReDim()_RockPaperScissors()/_RockPaperScissorsLizardSpock()_ScrollingCredits_SelfDelete()_SelfRename()_SelfUpdate()_SendTo()_ShellAll()_ShellFile()_ShellFolder()_SingletonHWID()_SingletonPID()_Startup()_StringCompact()_StringIsValid()_StringRegExpMetaCharacters()_StringReplaceWholeWord()_StringStripChars()_Temperature()_TrialPeriod()_UKToUSDate()/_USToUKDate()_WinAPI_Create_CTL_CODE()_WinAPI_CreateGUID()_WMIDateStringToDate()/_DateToWMIDateString()Au3 script parsingAutoIt SearchAutoIt3 PortableAutoIt3WrapperToPragmaAutoItWinGetTitle()/AutoItWinSetTitle()CodingDirToHTML5FileInstallrFileReadLastChars()GeoIP databaseGUI - Only Close ButtonGUI ExamplesGUICtrlDeleteImage()GUICtrlGetBkColor()GUICtrlGetStyle()GUIEventsGUIGetBkColor()Int_Parse() & Int_TryParse()IsISBN()LockFile()Mapping CtrlIDsOOP in AutoItParseHeadersToSciTE()PasswordValidPasteBinPosts Per DayPreExpandProtect GlobalsQueue()Resource UpdateResourcesExSciTE JumpSettings INISHELLHOOKShunting-YardSignature CreatorStack()Stopwatch()StringAddLF()/StringStripLF()StringEOLToCRLF()VSCROLLWM_COPYDATAMore Examples...

Updated: 22/04/2018

Posted

I hope you don't mind but I edited _SetBitmapToCtrl() so now the value of -1 can be used for the last ControlID created, just like GUICtrlSetData(-1, "Update") & the Native Functions do.

The idea came from a Function I created called

Example use of Function:

GUICtrlCreateLabel("", 5, 5, 40, 40)
_ResourceSetImageToCtrl(-1, "EXAMPLE")

Nice. Thanks!

I will add this to my Resources UDF.

Posted (edited)

New version, see first post.

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

Thanks to all cooperating people!

I will incorporate more tips for this UDF posted in this topic...

Edited by Zedna
Posted

Nice update. I forgot I did the tips :huh2: I will be upgrading all my programs today so I will let you know of any problems I encounter.

UDF List:

 
_AdapterConnections()_AlwaysRun()_AppMon()_AppMonEx()_ArrayFilter/_ArrayReduce_BinaryBin()_CheckMsgBox()_CmdLineRaw()_ContextMenu()_ConvertLHWebColor()/_ConvertSHWebColor()_DesktopDimensions()_DisplayPassword()_DotNet_Load()/_DotNet_Unload()_Fibonacci()_FileCompare()_FileCompareContents()_FileNameByHandle()_FilePrefix/SRE()_FindInFile()_GetBackgroundColor()/_SetBackgroundColor()_GetConrolID()_GetCtrlClass()_GetDirectoryFormat()_GetDriveMediaType()_GetFilename()/_GetFilenameExt()_GetHardwareID()_GetIP()_GetIP_Country()_GetOSLanguage()_GetSavedSource()_GetStringSize()_GetSystemPaths()_GetURLImage()_GIFImage()_GoogleWeather()_GUICtrlCreateGroup()_GUICtrlListBox_CreateArray()_GUICtrlListView_CreateArray()_GUICtrlListView_SaveCSV()_GUICtrlListView_SaveHTML()_GUICtrlListView_SaveTxt()_GUICtrlListView_SaveXML()_GUICtrlMenu_Recent()_GUICtrlMenu_SetItemImage()_GUICtrlTreeView_CreateArray()_GUIDisable()_GUIImageList_SetIconFromHandle()_GUIRegisterMsg()_GUISetIcon()_Icon_Clear()/_Icon_Set()_IdleTime()_InetGet()_InetGetGUI()_InetGetProgress()_IPDetails()_IsFileOlder()_IsGUID()_IsHex()_IsPalindrome()_IsRegKey()_IsStringRegExp()_IsSystemDrive()_IsUPX()_IsValidType()_IsWebColor()_Language()_Log()_MicrosoftInternetConnectivity()_MSDNDataType()_PathFull/GetRelative/Split()_PathSplitEx()_PrintFromArray()_ProgressSetMarquee()_ReDim()_RockPaperScissors()/_RockPaperScissorsLizardSpock()_ScrollingCredits_SelfDelete()_SelfRename()_SelfUpdate()_SendTo()_ShellAll()_ShellFile()_ShellFolder()_SingletonHWID()_SingletonPID()_Startup()_StringCompact()_StringIsValid()_StringRegExpMetaCharacters()_StringReplaceWholeWord()_StringStripChars()_Temperature()_TrialPeriod()_UKToUSDate()/_USToUKDate()_WinAPI_Create_CTL_CODE()_WinAPI_CreateGUID()_WMIDateStringToDate()/_DateToWMIDateString()Au3 script parsingAutoIt SearchAutoIt3 PortableAutoIt3WrapperToPragmaAutoItWinGetTitle()/AutoItWinSetTitle()CodingDirToHTML5FileInstallrFileReadLastChars()GeoIP databaseGUI - Only Close ButtonGUI ExamplesGUICtrlDeleteImage()GUICtrlGetBkColor()GUICtrlGetStyle()GUIEventsGUIGetBkColor()Int_Parse() & Int_TryParse()IsISBN()LockFile()Mapping CtrlIDsOOP in AutoItParseHeadersToSciTE()PasswordValidPasteBinPosts Per DayPreExpandProtect GlobalsQueue()Resource UpdateResourcesExSciTE JumpSettings INISHELLHOOKShunting-YardSignature CreatorStack()Stopwatch()StringAddLF()/StringStripLF()StringEOLToCRLF()VSCROLLWM_COPYDATAMore Examples...

Updated: 22/04/2018

Posted

Zedna just one thing I've found so far is the UDF fails with #AutoIt3Wrapper_Au3Check_Parameters=-d -w 1 -w 2 -w 3 -w 4 -w 5 -w 6. I've edit my Version for now and used #forceref in some places. Thanks.

UDF List:

 
_AdapterConnections()_AlwaysRun()_AppMon()_AppMonEx()_ArrayFilter/_ArrayReduce_BinaryBin()_CheckMsgBox()_CmdLineRaw()_ContextMenu()_ConvertLHWebColor()/_ConvertSHWebColor()_DesktopDimensions()_DisplayPassword()_DotNet_Load()/_DotNet_Unload()_Fibonacci()_FileCompare()_FileCompareContents()_FileNameByHandle()_FilePrefix/SRE()_FindInFile()_GetBackgroundColor()/_SetBackgroundColor()_GetConrolID()_GetCtrlClass()_GetDirectoryFormat()_GetDriveMediaType()_GetFilename()/_GetFilenameExt()_GetHardwareID()_GetIP()_GetIP_Country()_GetOSLanguage()_GetSavedSource()_GetStringSize()_GetSystemPaths()_GetURLImage()_GIFImage()_GoogleWeather()_GUICtrlCreateGroup()_GUICtrlListBox_CreateArray()_GUICtrlListView_CreateArray()_GUICtrlListView_SaveCSV()_GUICtrlListView_SaveHTML()_GUICtrlListView_SaveTxt()_GUICtrlListView_SaveXML()_GUICtrlMenu_Recent()_GUICtrlMenu_SetItemImage()_GUICtrlTreeView_CreateArray()_GUIDisable()_GUIImageList_SetIconFromHandle()_GUIRegisterMsg()_GUISetIcon()_Icon_Clear()/_Icon_Set()_IdleTime()_InetGet()_InetGetGUI()_InetGetProgress()_IPDetails()_IsFileOlder()_IsGUID()_IsHex()_IsPalindrome()_IsRegKey()_IsStringRegExp()_IsSystemDrive()_IsUPX()_IsValidType()_IsWebColor()_Language()_Log()_MicrosoftInternetConnectivity()_MSDNDataType()_PathFull/GetRelative/Split()_PathSplitEx()_PrintFromArray()_ProgressSetMarquee()_ReDim()_RockPaperScissors()/_RockPaperScissorsLizardSpock()_ScrollingCredits_SelfDelete()_SelfRename()_SelfUpdate()_SendTo()_ShellAll()_ShellFile()_ShellFolder()_SingletonHWID()_SingletonPID()_Startup()_StringCompact()_StringIsValid()_StringRegExpMetaCharacters()_StringReplaceWholeWord()_StringStripChars()_Temperature()_TrialPeriod()_UKToUSDate()/_USToUKDate()_WinAPI_Create_CTL_CODE()_WinAPI_CreateGUID()_WMIDateStringToDate()/_DateToWMIDateString()Au3 script parsingAutoIt SearchAutoIt3 PortableAutoIt3WrapperToPragmaAutoItWinGetTitle()/AutoItWinSetTitle()CodingDirToHTML5FileInstallrFileReadLastChars()GeoIP databaseGUI - Only Close ButtonGUI ExamplesGUICtrlDeleteImage()GUICtrlGetBkColor()GUICtrlGetStyle()GUIEventsGUIGetBkColor()Int_Parse() & Int_TryParse()IsISBN()LockFile()Mapping CtrlIDsOOP in AutoItParseHeadersToSciTE()PasswordValidPasteBinPosts Per DayPreExpandProtect GlobalsQueue()Resource UpdateResourcesExSciTE JumpSettings INISHELLHOOKShunting-YardSignature CreatorStack()Stopwatch()StringAddLF()/StringStripLF()StringEOLToCRLF()VSCROLLWM_COPYDATAMore Examples...

Updated: 22/04/2018

  • 1 month later...
Posted (edited)

I want to make a little universal tool. It's an injector - used to inejct DLLs into other programs. It depends on the user what is he/she using it for.

I found a nice UDF for the inject so currently that's not a problem. So now I can easily make this tool. But my problem is the following:

What if I want to inject my DLL to a given process without showing the dll to any1? So i have to use this resources UDF. But currently I can't understand the using of it. Can you give me a little help?

_InjectDll($hWnd, $dllpath)

I can set the hwnd, but how can I include the DLL to my program and after start, how to associate it to the $dllpath?

Edited by Unc3nZureD
Posted

Hi Zedna,

I tried playing with your Resources.au3 but can't find a solution with this:

#AutoIt3Wrapper_UseX64=n
#AutoIt3Wrapper_Res_File_Add=test.bmp, rt_bitmap, TEST_BMP
#include <ImageSearch.au3>
#include <Resources.au3>

Global $x=0,$y=0
Global $image = @ScriptDir & "\test.bmp"

Sleep (1000)

_normal()
Sleep (1000)
MouseMove(0,0,0)
_with_ResourceGet()
Sleep (1000)
MouseMove(0,0,0)
_with_ResourceGetAsImage()
Sleep (1000)
MouseMove(0,0,0)
_with_ResourceGetAsBitmap()



Func _with_ResourceGetAsBitmap()
    $hBmp = _ResourceGetAsBitmap("TEST_BMP", $RT_BITMAP);same results using ,$RT_RCDATA)
    if _ImageSearcharea($hBmp,1,1632,362,1755,409,$x,$y,100) = 1 Then
        MouseMove($x,$y,0)
        MsgBox(0,"Found","Found @ " & $x & " - " & $y & @CR)
    Else
        MsgBox(0,"Error","Not Found" & @CR)
    EndIf
EndFunc


Func _with_ResourceGetAsImage()
    $hBmp = _ResourceGetAsImage("TEST_BMP", $RT_BITMAP);same results using $RT_RCDATA)
    if _ImageSearcharea($hBmp,1,1632,362,1755,409,$x,$y,100) = 1 Then
        MouseMove($x,$y,0)
        MsgBox(0,"Found","Found @ " & $x & " - " & $y & @CR)
    Else
        MsgBox(0,"Error","Not Found" & @CR)
    EndIf
EndFunc

Func _with_ResourceGet()
    $hBmp = _ResourceGet("TEST_BMP", $RT_BITMAP)
    if _ImageSearcharea($hBmp,1,1632,362,1755,409,$x,$y,100) = 1 Then
        MouseMove($x,$y,0)
        MsgBox(0,"Found","Found @ " & $x & " - " & $y & @CR)
    Else
        MsgBox(0,"Error","Not Found" & @CR)
    EndIf
EndFunc

func _normal()
    if _ImageSearcharea($image,1,1632,362,1755,409,$x,$y,100) = 1 Then
        MouseMove($x,$y,0)
        MsgBox(0,"Found","Found @ " & $x & " - " & $y & @CR)
    Else
        MsgBox(0,"Error","Not Found" & @CR)
    EndIf
EndFunc

All three "Resource" functions return me "Not Found". Is there a solution or am I doing something wrong?

Thanks,

M.

Create an account or sign in to comment

You need to be a member in order to leave a comment

Create an account

Sign up for a new account in our community. It's easy!

Register a new account

Sign in

Already have an account? Sign in here.

Sign In Now
  • Recently Browsing   0 members

    • No registered users viewing this page.
×
×
  • Create New...