Jump to content

Iconator


smashly
 Share

Recommended Posts

obsolete...

I notice this old thread come up again..

I never supplied the source for iconator and I only supplied an executable. I felt it wasn't really an example that people could learn from and it was just adding to the forums clutter.

For those that wanted to see what it was you can still find it at http://www.funk.eu/iconator/

I have nothing to do with the site where it's at, I was asked by one of the members here on the forum if I minded them posting my program on their site.

I just did a google search with the words "Iconator smashly" and discovered where iconator was hosted..lol

Edited by smashly
Link to comment
Share on other sites

Hi.

For have a resizing window, remplace part of create interface by this code:

$hGui = GUICreate("Iconator", 670, 345, -1, -1, BitOR($WS_MAXIMIZEBOX,$WS_MINIMIZEBOX,$WS_SIZEBOX,$WS_THICKFRAME,$WS_SYSMENU,$WS_CAPTION,$WS_OVERLAPPEDWINDOW,$WS_TILEDWINDOW,$WS_POPUP,$WS_POPUPWINDOW,$WS_GROUP,$WS_TABSTOP,$WS_BORDER,$WS_CLIPSIBLINGS))
GUISetIcon(@AutoItExe, -1, $hGUI)
GUISetOnEvent($GUI_EVENT_DROPPED, "GuiEvent", $hGui)
GUISetOnEvent($GUI_EVENT_CLOSE, "GuiEvent", $hGui)
GUISetOnEvent($GUI_EVENT_RESIZED, "GuiEvent", $hGui)
GUISetOnEvent($GUI_EVENT_MAXIMIZE, "GuiEvent", $hGui)
GUISetOnEvent($GUI_EVENT_RESTORE, "GuiEvent", $hGui)
$Gr[1] = GUICtrlCreateGroup("Open", 10, 5, 82, 80)
GUICtrlSetResizing(-1, $GUI_DOCKLEFT+$GUI_DOCKTOP+$GUI_DOCKWIDTH+$GUI_DOCKHEIGHT)
$Gr[2] = GUICtrlCreateGroup("Filter", 91, 5, 110, 80)
GUICtrlSetResizing(-1, $GUI_DOCKLEFT+$GUI_DOCKTOP+$GUI_DOCKWIDTH+$GUI_DOCKHEIGHT)
$Gr[3] = GUICtrlCreateGroup("When adding files...", 200, 5, 130, 80)
GUICtrlSetResizing(-1, $GUI_DOCKLEFT+$GUI_DOCKTOP+$GUI_DOCKWIDTH+$GUI_DOCKHEIGHT)
$Gr[4] = GUICtrlCreateGroup("Files in list:", 10, 90, 320, 245)
GUICtrlSetResizing(-1, $GUI_DOCKLEFT+$GUI_DOCKTOP+$GUI_DOCKBOTTOM+$GUI_DOCKWIDTH)
$Gr[5] = GUICtrlCreateGroup("Icons found in file: 0", 340, 5, 320, 330)
GUICtrlSetResizing(-1, $GUI_DOCKLEFT+$GUI_DOCKRIGHT+$GUI_DOCKTOP+$GUI_DOCKBOTTOM)
$LV[2] = GUICtrlCreateListView(-1, 350, 25, 300, 270, $LVS_ICON, BitOR($LVS_EX_CHECKBOXES, $WS_EX_CLIENTEDGE, $LVS_EX_DOUBLEBUFFER))
_GUICtrlListView_SetView($LV[2], 1)
GUICtrlSetResizing(-1, $GUI_DOCKLEFT+$GUI_DOCKTOP+$GUI_DOCKBOTTOM+$GUI_DOCKRIGHT)
_GUICtrlListView_SetIconSpacing($LV[2], 65, 35)
$LV[1] = GUICtrlCreateListView("File Name|Path", 20, 110, 300, 185, BitOR($GUI_SS_DEFAULT_LISTVIEW, $LVS_ICON), $LV1_EXS)
GUICtrlSetResizing(-1, $GUI_DOCKLEFT+$GUI_DOCKTOP+$GUI_DOCKBOTTOM+$GUI_DOCKWIDTH)
GUICtrlSetState(-1, $GUI_DROPACCEPTED)
_GUICtrlListView_SetColumnWidth(-1, 0, 120)
_GUICtrlListView_SetColumnWidth(-1, 1, 170)
$When[3] = GUICtrlCreateCheckbox("Clear Previous List", 210, 60, 110, 20)
GUICtrlSetResizing(-1, $GUI_DOCKLEFT+$GUI_DOCKTOP+$GUI_DOCKWIDTH+$GUI_DOCKHEIGHT)
GUICtrlSetState(-1, $GUI_CHECKED)
$Open[1] = GUICtrlCreateButton("File(s)", 21, 25, 60, 20)
GUICtrlSetResizing(-1, $GUI_DOCKLEFT+$GUI_DOCKTOP+$GUI_DOCKWIDTH+$GUI_DOCKHEIGHT)
$Open[2] = GUICtrlCreateButton("Directory", 21, 55, 60, 20)
GUICtrlSetResizing(-1, $GUI_DOCKLEFT+$GUI_DOCKTOP+$GUI_DOCKWIDTH+$GUI_DOCKHEIGHT)
$Fltr[1] = GUICtrlCreateCheckbox("CPL", 100, 20, 40, 20)
GUICtrlSetResizing(-1, $GUI_DOCKLEFT+$GUI_DOCKTOP+$GUI_DOCKWIDTH+$GUI_DOCKHEIGHT)
$Fltr[2] = GUICtrlCreateCheckbox("DLL", 100, 40, 40, 20)
GUICtrlSetResizing(-1, $GUI_DOCKLEFT+$GUI_DOCKTOP+$GUI_DOCKWIDTH+$GUI_DOCKHEIGHT)
$Fltr[3] = GUICtrlCreateCheckbox("EXE", 100, 60, 40, 20)
GUICtrlSetResizing(-1, $GUI_DOCKLEFT+$GUI_DOCKTOP+$GUI_DOCKWIDTH+$GUI_DOCKHEIGHT)
$Fltr[4] = GUICtrlCreateCheckbox("ICL", 150, 20, 40, 20)
GUICtrlSetResizing(-1, $GUI_DOCKLEFT+$GUI_DOCKTOP+$GUI_DOCKWIDTH+$GUI_DOCKHEIGHT)
$Fltr[5] = GUICtrlCreateCheckbox("OCX", 150, 40, 40, 20)
GUICtrlSetResizing(-1, $GUI_DOCKLEFT+$GUI_DOCKTOP+$GUI_DOCKWIDTH+$GUI_DOCKHEIGHT)
SetFilter()
$When[1] = GUICtrlCreateCheckbox("Recuse Drop x1", 210, 20, 110, 20)
GUICtrlSetResizing(-1, $GUI_DOCKLEFT+$GUI_DOCKTOP+$GUI_DOCKWIDTH+$GUI_DOCKHEIGHT)
GUICtrlSetState(-1, $GUI_CHECKED)
$When[2] = GUICtrlCreateCheckbox("Recuse All", 210, 40, 110, 20)
GUICtrlSetResizing(-1, $GUI_DOCKLEFT+$GUI_DOCKTOP+$GUI_DOCKWIDTH+$GUI_DOCKHEIGHT)

$BLV1[1] = GUICtrlCreateButton("Select All", 20, 305, 96, 20)
GUICtrlSetResizing(-1, $GUI_DOCKLEFT+$GUI_DOCKBOTTOM+$GUI_DOCKWIDTH+$GUI_DOCKHEIGHT)
$BLV1[2] = GUICtrlCreateButton("Invert Selection", 122, 305, 96, 20)
GUICtrlSetResizing(-1, $GUI_DOCKLEFT+$GUI_DOCKBOTTOM+$GUI_DOCKWIDTH+$GUI_DOCKHEIGHT)
$BLV1[3] = GUICtrlCreateButton("Remove Selected", 224, 305, 96, 20)
GUICtrlSetResizing(-1, $GUI_DOCKLEFT+$GUI_DOCKBOTTOM+$GUI_DOCKWIDTH+$GUI_DOCKHEIGHT)


$BLV2[1] = GUICtrlCreateButton("Select All", 350, 305, 96, 20)
GUICtrlSetResizing(-1, $GUI_DOCKLEFT+$GUI_DOCKBOTTOM+$GUI_DOCKWIDTH+$GUI_DOCKHEIGHT)
$BLV2[2] = GUICtrlCreateButton("Invert Selection", 452, 305, 96, 20)
GUICtrlSetResizing(-1, $GUI_DOCKLEFT+$GUI_DOCKBOTTOM+$GUI_DOCKWIDTH+$GUI_DOCKHEIGHT)
$BLV2[3] = GUICtrlCreateButton("Extract Selected", 554, 305, 96, 20)
GUICtrlSetResizing(-1, $GUI_DOCKLEFT+$GUI_DOCKBOTTOM+$GUI_DOCKWIDTH+$GUI_DOCKHEIGHT)

and to manage event MAXIMIZE, RESTORE, ... add to Func GuiEvent :

Case $GUI_EVENT_RESIZED, $GUI_EVENT_MAXIMIZE, $GUI_EVENT_RESTORE
            _GUICtrlListView_SetIconSpacing($LV[2], 65, 65)
            _GUICtrlListView_Arrange($LV[2])

You can now maximize to full screen with respect size of component.

Edited by dmoniac
Link to comment
Share on other sites

Hi and thank you all for the positive feedback, glad you all like it muttley

Update may be coming soon.

@dmoniac instead of all those lines of the same

GUICtrlSetResizing(-1, $GUI_DOCKLEFT+$GUI_DOCKTOP+$GUI_DOCKWIDTH+$GUI_DOCKHEIGHT)

Maybe something like

For $i = $Gr[1] To $BLV2[3]
    GUICtrlSetResizing($i, BitOr($GUI_DOCKLEFT,$GUI_DOCKBOTTOM,$GUI_DOCKWIDTH,$GUI_DOCKHEIGHT))
Next

Cheers

Edited by smashly
Link to comment
Share on other sites

Maybe something like

Or just:

Opt("GUIResizeMode", BitOr($GUI_DOCKLEFT,$GUI_DOCKBOTTOM,$GUI_DOCKWIDTH,$GUI_DOCKHEIGHT))

muttley

Edited by MrCreatoR

 

Spoiler

Using OS: Win 7 Professional, Using AutoIt Ver(s): 3.3.6.1 / 3.3.8.1

AutoIt_Rus_Community.png AutoIt Russian Community

My Work...

Spoiler

AutoIt_Icon_small.pngProjects: ATT - Application Translate Tool {new}| BlockIt - Block files & folders {new}| SIP - Selected Image Preview {new}| SISCABMAN - SciTE Abbreviations Manager {new}| AutoIt Path Switcher | AutoIt Menu for Opera! | YouTube Download Center! | Desktop Icons Restorator | Math Tasks | KeyBoard & Mouse Cleaner | CaptureIt - Capture Images Utility | CheckFileSize Program

AutoIt_Icon_small.pngUDFs: OnAutoItErrorRegister - Handle AutoIt critical errors {new}| AutoIt Syntax Highlight {new}| Opera Library! | Winamp Library | GetFolderToMenu | Custom_InputBox()! | _FileRun UDF | _CheckInput() UDF | _GUIInputSetOnlyNumbers() UDF | _FileGetValidName() UDF | _GUICtrlCreateRadioCBox UDF | _GuiCreateGrid() | _PathSplitByRegExp() | _GUICtrlListView_MoveItems - UDF | GUICtrlSetOnHover_UDF! | _ControlTab UDF! | _MouseSetOnEvent() UDF! | _ProcessListEx - UDF | GUICtrl_SetResizing - UDF! | Mod. for _IniString UDFs | _StringStripChars UDF | _ColorIsDarkShade UDF | _ColorConvertValue UDF | _GUICtrlTab_CoverBackground | CUI_App_UDF | _IncludeScripts UDF | _AutoIt3ExecuteCode | _DragList UDF | Mod. for _ListView_Progress | _ListView_SysLink | _GenerateRandomNumbers | _BlockInputEx | _IsPressedEx | OnAutoItExit Handler | _GUICtrlCreateTFLabel UDF | WinControlSetEvent UDF | Mod. for _DirGetSizeEx UDF
 
AutoIt_Icon_small.pngExamples: 
ScreenSaver Demo - Matrix included | Gui Drag Without pause the script | _WinAttach()! | Turn Off/On Monitor | ComboBox Handler Example | Mod. for "Thinking Box" | Cool "About" Box | TasksBar Imitation Demo

Like the Projects/UDFs/Examples? Please rate the topic (up-right corner of the post header: Rating AutoIt_Rating.gif)

* === My topics === *

==================================================
My_Userbar.gif
==================================================

 

 

 

AutoIt is simple, subtle, elegant. © AutoIt Team

Link to comment
Share on other sites

Awesome. Awesome. I was hoping to script something like this one day but I couldn't even get close the icon retrieval func, much less create a great GUI like you have. Bravo!

Link to comment
Share on other sites

This is awesome. I needed something like this to replace an old app i've used for years called IconCollector. Thnaks for sharing. muttley

HKTunes:Softpedia | GoogleCodeLyricToy:Softpedia | GoogleCodeRCTunes:Softpedia | GoogleCodeMichtaToolsProgrammer n. - An ingenious device that turns caffeine into code.
Link to comment
Share on other sites

@smashly

Very nice Application !! muttley

One handy thing missing.

If we could export the ICON in a Binary string that would come in very handy to use together with ZEDNA's _SetImageBinaryToCtrl in inaryImage.au3.

This put's a Image on a GUI using a Binary string from an Image.

Regards

ptrex

Link to comment
Share on other sites

@smashly

Could you add a function like this :

_GraphicsToHexString("C:\Tmp\5_mycomput_32x32-4bit.ico")

Func _GraphicsToHexString($sSource)
$hFile = FileOpen($sSource, 16)

; Check if file opened for reading OK
If $hFile = -1 Then
    MsgBox(0, "Error", "Unable to open file.")
    Exit
EndIf

$iCntr = 0
; Write Hex String
While 1
    $sChars = FileRead($hFile, 60)
    If @error = -1 Then ExitLoop
    
    If $iCntr = 0 Then
    $sTemp = 'Func _LOGOBin()' & @CR & 'Local $FileName = "0x' & StringMid($sChars,3) & '"' & @LF
        Else
    $sTemp = '$FileName &= "' & StringMid($sChars,3) & '"' & @LF
    Endif

        ConsoleWrite( $sTemp )
    $iCntr += 1
Wend
        ConsoleWrite("Return $FileName" & @CR & "EndFunc" & @CR )

FileClose($hFile)
EndFuncoÝ÷ Ù8b³
.ÖÞj
ÞjØ^§rã¹Ëb¢|"¶ay'­"f x§j¼ +kúèúè ÝÉ©Ýeçgi«­¢+Ø¥¹±Õ±ÐíU%
½¹ÍѹÑÍà¹ÔÌÐì(¥¹±Õ±Ðí]¥¹½ÝÍ
½¹ÍѹÑ̹ÔÌÐì(¥¹±ÕÅÕ½Ðí ¥¹Éå%µ¹ÔÌÅÕ½Ðì((É¥½¸´U$
ÉÑ)U%
ÉÑ Ìäí%µÉ½´MÑɴ͵¥±¹¥Ìäì°ÈÀÀ°àÀ°´Ä°´Ä°ÀÌØí]M}
AQ%=8¬ÀÌØí]M}MeM59T¤(ìøMÑÉÐ¥µ
ÉÑ¥½¸(ÀÌØíÁ¥½àôU%
Ñɱ
ÉÑA¥ ÅÕ½ÐìÅÕ½Ðì°ÄÀ°ÄÀ°Ðà°Ðà¤ìUÍ|ÐáàÐà´á¥Ð¹¥¼)U%
ÑɱMÑ
ÕÉÍ½È ´Ä°À¤(ÀÌØí1=

Regards,

ptrex

Link to comment
Share on other sites

Why should this be added? This is just hex-reading of the file... But if you really want to do it, you can use this as source muttley It reads a file and splits it's binary content into multiple lines.

http://www.autoit.de/index.php?page=Thread...45682#post45682 (by me)

*GERMAN* [note: you are not allowed to remove author / modified info from my UDFs]My UDFs:[_SetImageBinaryToCtrl] [_TaskDialog] [AutoItObject] [Animated GIF (GDI+)] [ClipPut for Image] [FreeImage] [GDI32 UDFs] [GDIPlus Progressbar] [Hotkey-Selector] [Multiline Inputbox] [MySQL without ODBC] [RichEdit UDFs] [SpeechAPI Example] [WinHTTP]UDFs included in AutoIt: FTP_Ex (as FTPEx), _WinAPI_SetLayeredWindowAttributes

Link to comment
Share on other sites

@smashly

.........

Regards,

ptrex

I can add something like that but I really can't see the point..

You can add the icon to your compiled exe as an icon ..

Then you get the ordinal name of the RT_ICON that you've added to your compiled exe and then you can get a handle to the raw bmp data of the RT_ICON that's in your compiled exe and then use zedna's/progandy's function to set the raw bmp or png data to any control as an image.

To get the ordinal name of the RT_ICON that's in your compiled exe you read the header of the RT_GROUP_ICON header.

The only function I truely believe that is missing from zedna's resource udf is the _ResourceEnumNames().

This function would save you having to manually byte/hex read the ordinal name of the RT_ICON from an RT_GROUP_ICON.

Other functions that Zedna's udf could do with are the _EnumResourceTypes() and _EnumResourceLanguages().

The reason I say this is since his udf now supports extraction/reading of resources in external modules it would make it easier for a user to find and error check the resource from any module they want to use.

Cheers

Edited by smashly
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...