Jump to content

Icons UDF


Yashied
 Share

Recommended Posts

this is awesome!!! though is it possible to remove the picture? cause i need this:

i have a Label control...

_setimage () on it works beautifully!!

but then i need the label to be able to have text written on it... Guictrlsetdata(label,'text')

i just used _setimage (label, '') to make it blank... but i dunno how to turn it back into a label control

Why do you need such complexity? Use GUICtrlCreateLabel() for labels and GUICtrlCreatePic() for images.
Link to comment
Share on other sites

its for a chess game.. the labels are so that an X is placed where the possible moves can be... but with setimage the labels aren't labels anymore

Link to comment
Share on other sites

  • 4 weeks later...
  • 3 weeks later...

i have error (((

i added in "C:\Program Files\AutoIt3\Include" file "Icons.au3"

but me gives error like can't open this file((( "Error open this file" #Include <Icons.au3>

Edited by toader

[center][font=courier new,courier,monospace]Die die die my darling[/font][/center][center][font=courier new,courier,monospace]Don't utter a single word[/font][/center][center][font=courier new,courier,monospace]Die die die my darling[/font][/center][center][font=courier new,courier,monospace]Just shut your pretty mouth[/font][/center][center][font=courier new,courier,monospace]I'll be seeing you again[/font][/center][center][font=courier new,courier,monospace]I'll be seeing you[/font][/center][center][font=courier new,courier,monospace]In hell[/font][/center]

Link to comment
Share on other sites

i have error (((

i added in "C:\Program Files\AutoIt3\Include" file "Icons.au3"

but me gives error like can't open this file((( "Error open this file" #Include <Icons.au3>

I think you are using the Beta. If so, then

C:\Program Files\AutoIt3\Beta\Include

Link to comment
Share on other sites

  • 3 weeks later...
Link to comment
Share on other sites

  • 1 month later...
Link to comment
Share on other sites

Link to comment
Share on other sites

  • 2 months later...

Excellent work and searched very often in the past. Now any search is over.

But while playing around a bit and recognizing the huge quality-difference between GUICtrlCreateIcon and your _SetIcon-Function:

What are the reasons that the _SetIcon-Function is able to resize the icon to a specified size BUT _SetHIcon is NOT ?

I guess it's not possible to resize it with the _SetHIcon-Function (because you sure have thought about that) but its hard to believe... ?!

And damn, I'm not able to prove otherwise. ;)

UTA

Link to comment
Share on other sites

OK, but this is my argumentation:

I used the inbuilt internal function to convert icons to bitmaps, resize bitmaps and convert bitmaps to icons again.

The new code of your _SetHIcon-function is the following:

Func _SetHIcon($hWnd, $hIcon, $iWidth = -1, $iHeight = -1, $hOverlap = 0)

    Local $hBitmap

    $hWnd = _Icons_Control_CheckHandle($hWnd)
    If $hWnd = 0 Then
        Return SetError(1, 0, 0)
    EndIf

    _Icons_Control_CheckSize($hWnd, $iWidth, $iHeight)

    If Not ($hOverlap < 0) Then
        $hOverlap = _Icons_Control_CheckHandle($hOverlap)
    EndIf

    $hBitmap=_Icons_Bitmap_CreateFromIcon($hIcon)
    $hBitmap=_Icons_Bitmap_Resize($hBitmap, $iWidth, $iHeight)


    $hIcon = _Icons_Icon_CreateFromBitmap($hBitmap)
    If $hBitmap Then
        _WinAPI_DeleteObject($hBitmap)
    EndIf
    If Not _Icons_Control_SetImage($hWnd, $hIcon, $IMAGE_ICON, $hOverlap) Then
        If $hIcon Then
            _WinAPI_DestroyIcon($hIcon)
        EndIf
        Return SetError(1, 0, 0)
    EndIf
    Return 1

#cs
    ;Original Code of this function:
    $hWnd = _Icons_Control_CheckHandle($hWnd)
    If $hWnd = 0 Then
        Return SetError(1, 0, 0)
    EndIf

    If Not ($hOverlap < 0) Then
        $hOverlap = _Icons_Control_CheckHandle($hOverlap)
    EndIf
    $hIcon = _Icons_Icon_Duplicate($hIcon)
    If Not _Icons_Control_SetImage($hWnd, $hIcon, $IMAGE_ICON, $hOverlap) Then
        If $hIcon Then
            _WinAPI_DestroyIcon($hIcon)
        EndIf
        Return SetError(1, 0, 0)
    EndIf
    Return 1
#ce
EndFunc   ;==>_SetHIcon

It's not quite a stretch, I know. And it's absolutely not that smooth as it is with _SetIcon (compared the quality is worse) but it's working. And at the moment I wouldn't want to miss the possibility to work the same way _SetIcon does (resize it, if necessary), if there is no need to. But maybe there is a better/smoother idea of the "how to resize" somewhere?

Does anybody of you have such an idea?

UTA

Edited by UTA
Link to comment
Share on other sites

When I Obfuscated the script by this udf, It isn't worked and have a problem:

-### Obfuscation Error: Found Eval() statement using unsolvable Func, which will/could lead to problems running your obfuscated script.

>### current Func: __GUICtrl_SetOnHover_Call_Proc

C:\Users\Le Quoc Nam\Desktop\vtc\Icons_Hover\UDFs\GUICtrlSetOnHover.au3(371,1) Warning for line:$sEval = Eval("sParam" & $i-1)

-###2 Obfuscation Error: Found Execute() statement which will lead to problems running your obfuscated script.

>### current Func: __GUICtrl_SetOnHover_Call_Proc

C:\Users\Le Quoc Nam\Desktop\vtc\Icons_Hover\UDFs\GUICtrlSetOnHover.au3(383,1) Warning for line:Local $iRet = Execute($sCall_Params)

-###2 Obfuscation Error: Found Execute() statement which will lead to problems running your obfuscated script.

>### current Func: __GUICtrl_SetOnHover_Call_Proc

C:\Users\Le Quoc Nam\Desktop\vtc\Icons_Hover\UDFs\GUICtrlSetOnHover.au3(390,1) Warning for line:$iRet = Execute($sCall_Params)

-### Obfuscation Error: Found Call() statement using unsolvable Func, which will/could lead to problems running your obfuscated script.

>### current Func: __GUICtrl_SetOnHover_OnAutoItExit

C:\Users\Le Quoc Nam\Desktop\vtc\Icons_Hover\UDFs\GUICtrlSetOnHover.au3(412,1) Warning for line:Call($__GUICtrl_SetOnHover_sOriginal_OnExitFunc)

-#############################################################################################

-#### Obfuscator Found 4 Error(s)!!!! This means your script could have problems running properly. ####

-#############################################################################################

+> Obfuscator v1.0.26.13 finished obfuscating 6791 lines, stripped 12039 comment lines. created:C:\Users\Le Quoc Nam\Desktop\vtc\Icons_Hover\Demo_Obfuscated.au3

Please tell me the way tho correct it. Thanks all. ;)
Forever (freeze_love)Blog at: http://freeze_love.summerhost.info/
Link to comment
Share on other sites

Link to comment
Share on other sites

  • 2 months later...

Hi,

Tried running Demo.au3 from Icons_Hover.zip. I get this error:

D:\Icons UDF\UDFs\GUICtrlSetOnHover.au3(15,107) : ERROR: Opt() called with illegal argument 1: "OnExitFunc"

Global $__GUICtrl_SetOnHover_sOriginal_OnExitFunc = Opt("OnExitFunc", "__GUICtrl_SetOnHover_OnAutoItExit")

Link to comment
Share on other sites

Hi,

Tried running Demo.au3 from Icons_Hover.zip. I get this error:

D:\Icons UDF\UDFs\GUICtrlSetOnHover.au3(15,107) : ERROR: Opt() called with illegal argument 1: "OnExitFunc"

Global $__GUICtrl_SetOnHover_sOriginal_OnExitFunc = Opt("OnExitFunc", "__GUICtrl_SetOnHover_OnAutoItExit")

This is MrCreatoR's GUICtrlSetOnHover UDF. Try to download the latest version.
Link to comment
Share on other sites

  • 7 months later...

I've found a error in the package..

I've made a post But I think posting it as well can be related

Hello ,

I have a gui problem.. I don't know if its the right sub-forum to post But because its not that I have a question how to do something its just that the something go bad I decided to post in here.

Anyway a few examples:

Before Minimize it look good like this

Posted Image

After minimize and then restore from task-bar it look like this

Posted Image

Any reason why? and How can I fix it?

For the background I use

GUICtrlCreatePic ( "BackPic.jpg", 1, 1,800,600)
 GuiCtrlSetState(-1,$GUI_DISABLE)
 GUISetState(@sw_show)

and for the pieces I use (Example..)

$Board[1][$s][0] = guictrlcreatepic("",720,30+40*$s)
$hGreen1  = _Icons_Bitmap_Load(@ScriptDir & "\white.png")
_SetHImage($Board[1][$s][0],$hGreen1 )
GuiCtrlSetState(-1,$GUI_DISABLE)

I've added a example Just download all the file and extract to the same dir and run ForumTest minimize and restore from desk-top and you'll see

Forum.rar

Link to comment
Share on other sites

  • 6 months later...

Yashied, the download links are not working today.

Is there an update to allow for the change in the images supplied with the latest AutoIt, or have I lost some images?

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.
Link to comment
Share on other sites

Just checked the links and they seem to working again.

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

Link to comment
Share on other sites

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
 Share

  • Recently Browsing   0 members

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