Jump to content
Sign in to follow this  
t1ck3ts

Call bigger size icon from res

Recommended Posts

t1ck3ts

Hey again guys

Im having an issue calling icon's from within the compiled .exe.

When i call the icon from resource, i get some crappy sized one and not a 128x128 sized icon, using Resource Hacker, i did find it and its in there.

Here is a make up snipet of my code:

 

#Region ;**** Directives created by AutoIt3Wrapper_GUI ****
#AutoIt3Wrapper_Res_Icon_Add=D:\AutoIt Projects\Remote View Backup\source\notfound.ico ; -5
#AutoIt3Wrapper_Res_Icon_Add=D:\AutoIt Projects\Remote View Backup\source\found.ico ; -6
#AutoIt3Wrapper_Res_Icon_Add=D:\AutoIt Projects\Remote View Backup\source\icon.ico ; -7
#EndRegion ;**** Directives created by AutoIt3Wrapper_GUI ****
#include <GUIConstantsEx.au3>
#include <WindowsConstants.au3>
#include <ComboConstants.au3>
#include <ProgressConstants.au3>

GUICreate("Backup",347, 72,-1,-1,BitOR($WS_SYSMENU,$WS_CAPTION))
$CancelButton = GUICtrlCreateButton("Cancel",283,39,55,25)
$Progress = GUICtrlCreateProgress(83,53,190,10,$PBS_SMOOTH)
GUICtrlCreateIcon(@ScriptFullPath,-7,9,4,64,64)
GUISetFont(8, 400, 0, "")
GUICtrlCreateLabel("SQL", 95, 5, 71, 12)

$SQLCheck = 1

If $SQLCheck = 1 Then
    GUICtrlCreateIcon(@ScriptFullPath,-6,83,7,8,8)
Else
    GUICtrlCreateIcon(@ScriptFullPath,-5,83,7,8,8)
EndIf

GUISetState()

; all my other functions and codes go here..

While 1
    Switch GUIGetMsg()
        Case $GUI_EVENT_CLOSE
            ExitLoop
        Case $CancelButton
            ExitLoop
    EndSwitch
WEnd

Here is an image showing you the called icon (-7) and what it should look like (if i call the icon directly from file)
 

compare.jpg

Am i doing something wrong?

Share this post


Link to post
Share on other sites
UEZ

Try this:

#Region ;**** Directives created by AutoIt3Wrapper_GUI ****
;~ #AutoIt3Wrapper_Res_Icon_Add=notfound.ico ; -5
;~ #AutoIt3Wrapper_Res_Icon_Add=found.ico ; -6
;~ #AutoIt3Wrapper_Res_Icon_Add=icon.ico ; -7
#AutoIt3Wrapper_Res_File_Add=notfound.ico, RT_ICON, ICO_1, 0
#AutoIt3Wrapper_Res_File_Add=found.ico, RT_ICON, ICO_2, 0
#AutoIt3Wrapper_Res_File_Add=icon.ico, RT_ICON, ICO_3, 0

#EndRegion ;**** Directives created by AutoIt3Wrapper_GUI ****
#include <GUIConstantsEx.au3>
#include <WindowsConstants.au3>
#include <ComboConstants.au3>
#include <ProgressConstants.au3>
#include "ResourcesEx.au3" ;adjust path

GUICreate("Backup",347, 72,-1,-1,BitOR($WS_SYSMENU,$WS_CAPTION))
$CancelButton = GUICtrlCreateButton("Cancel",283,39,55,25)
$Progress = GUICtrlCreateProgress(83,53,190,10,$PBS_SMOOTH)
$iIcon = GUICtrlCreateIcon("",0,9,4,64,64)
GUISetFont(8, 400, 0, "")
GUICtrlCreateLabel("SQL", 95, 5, 71, 12)

$SQLCheck = 1

If $SQLCheck = 1 Then
    _Resource_SetToCtrlID($iIcon, 'ICO_1', $RT_ICON, Default, False)
Else
    _Resource_SetToCtrlID($iIcon, 'ICO_2', $RT_ICON, Default, False)
EndIf

GUISetState()

; all my other functions and codes go here..

While 1
    Switch GUIGetMsg()
        Case $GUI_EVENT_CLOSE
            ExitLoop
        Case $CancelButton
            ExitLoop
    EndSwitch
WEnd

You need the >ResourcesEx.au3 UDF!

Br,

UEZ


Please don't send me any personal message and ask for support! I will not reply!

Selection of finest graphical examples at Codepen.io

The own fart smells best!
Her 'sikim hıyar' diyene bir avuç tuz alıp koşma!
¯\_(ツ)_/¯  ٩(●̮̮̃•̃)۶ ٩(-̮̮̃-̃)۶ૐ

Share this post


Link to post
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
Sign in to follow this  

×