AutoHotkey Community

It is currently May 26th, 2012, 4:36 pm

All times are UTC [ DST ]




Post new topic Reply to topic  [ 34 posts ]  Go to page 1, 2, 3  Next
Author Message
PostPosted: June 27th, 2005, 8:26 pm 
Offline

Joined: March 2nd, 2004, 3:36 pm
Posts: 10720
Here are the changes for v1.0.36:

Fixed double syntax error for a bad function call in a block.

Improved "Process, Exist" to fetch the script's own PID when no other parameters are given. [thanks Junyx]


CHANGES FOR GUI

Added GuiContextMenu, which facilitates the display of custom Gui context menus.

Added Gui +Delimiter`n as a means to change the separator between fields.

Added A_EventInfo for use by OnClipboardChange, ListBox, GuiSize, and GuiDropFiles.

Added A_GuiEvent as a synonym for A_GuiControlEvent.

Added +/-Redraw as a means to accelerate the filling of a ListBox.

Adding new control type ListView, which is a tabular view of rows and columns. It features built-in sorting and support for displaying icons.

http://www.autohotkey.com/download/

If you've been using the alpha-test version of the ListView, "Gui, Add, Row" has been replaced by LV_Add(). Also, GetNextItem() has been renamed to GetNext(). There have also been many enhancements.


Top
 Profile  
Reply with quote  
 Post subject:
PostPosted: June 27th, 2005, 8:46 pm 
Offline

Joined: January 31st, 2005, 9:50 am
Posts: 3910
Location: Bremen, Germany
Yieeepppiiieeee,
Thanks Chris.

_________________
Ciao
toralf
Image


Top
 Profile  
Reply with quote  
 Post subject:
PostPosted: June 27th, 2005, 10:10 pm 
Offline

Joined: January 31st, 2005, 9:50 am
Posts: 3910
Location: Bremen, Germany
In the beginning I was a little bit confused, due to the functions. It is a different style to write code compared to the rest of GUI/GUIControl commands. Since text has to be in "" and variables do not need %%, but I think I can get used to it. I see the benefit in the loops. It will result in very short code compared to normal commands.

Thanks for this new feature.

_________________
Ciao
toralf
Image


Top
 Profile  
Reply with quote  
PostPosted: June 27th, 2005, 10:18 pm 
Offline

Joined: April 17th, 2005, 7:47 pm
Posts: 289
Location: Sauerland
Marvelously figured out.
Thanks!


Top
 Profile  
Reply with quote  
 Post subject:
PostPosted: June 27th, 2005, 11:15 pm 
Offline

Joined: March 16th, 2005, 10:33 pm
Posts: 969
Location: Frisia
Excellent! 8)

(RichEdit and InternetExplorerContainerWindow too please :P )

Need to fiddle around with them ListView rightaway...

Rajat, I know you are having some bad days right now, but can you please add preliminary support for ListView (so that it doesn't error out) to SmartGUI?

I'm speechless...

All I really need now is some more info/teachmyself on dll calling to avoid weird errors with DLLCall :P

_________________
Image mirror 1mirror 2mirror 3ahk4.me • PM or Image


Top
 Profile  
Reply with quote  
 Post subject:
PostPosted: June 28th, 2005, 12:37 am 
Offline

Joined: March 2nd, 2004, 3:36 pm
Posts: 10720
daonlyfreez wrote:
(RichEdit and InternetExplorerContainerWindow too please :P )
Those would be good additions. In case you want to use them right away, I don't think there's anything that would prevent you from using DllCall("CreateWindow"...) to create any control of your choice inside a parent GUI window. After creation, you could send the control some messages to set it up and get things back out of it.


Top
 Profile  
Reply with quote  
 Post subject:
PostPosted: June 28th, 2005, 8:45 am 
Offline

Joined: March 28th, 2004, 3:53 pm
Posts: 1870
congrats on another big achievment Chris!

listview looks great, though the example script looks complicated and i'm kinda afraid to get my feet wet!

by the way it doesn't show the actual icons of files, so i did a li'l research and found that shell32.dll\ExtractAssociatedIcon gives the correct icon (returns the handle of an indexed icon found in a file or an icon found in an associated executable file). but to use it i need App.hInstance which i don't know much about. i'm sure there'll be ppl asking for this soon, so shouldn't this be built-in?

daonlyfreez,
i'll try to put in basic support soon. but by that time u can create a listbox in sgui and rename it to listview in script.

_________________
Image


Top
 Profile  
Reply with quote  
 Post subject:
PostPosted: June 28th, 2005, 8:54 am 
Offline

Joined: April 1st, 2004, 12:00 am
Posts: 87
Location: Philippines
Alright! Even AutoIt's ListView doesn't have sorting.


Top
 Profile  
Reply with quote  
 Post subject:
PostPosted: June 28th, 2005, 11:09 am 
Offline

Joined: March 2nd, 2004, 3:36 pm
Posts: 10720
Rajat wrote:
the example script looks complicated and i'm kinda afraid to get my feet wet!
I wanted to have both a simple and a complex example. If you wanted to reduce it to the bare minimum, the following is a fully functional ListView script that displays some files in report view:
Code:
Gui, Add, ListView, r20 w700, Name|Size (KB)
; Gather a list of file names from a folder and put them into the ListView:
Loop, %A_MyDocuments%\*.*
   LV_Add("", A_LoopFileName, A_LoopFileSizeKB)
Gui Show

Quote:
i did a li'l research and found that shell32.dll\ExtractAssociatedIcon gives the correct icon
I was wondering how to do that and now I know. Thanks.

I think the following script segment can get the associated icon because ExtractAssociatedIcon() does not seem to strictly require a valid hInstance:
Code:
; Gather a list of file names from a folder and append them to the ListView:
Loop %Folder%\*.*
{
   FileName := A_LoopFileFullPath  ; Must save to writable variable for use below.
   StringReplace, FileName, FileName, \\, \  ; Due to root drive having backslash from FileSelectFolder.
   hIcon := DllCall("Shell32\ExtractAssociatedIconA", UInt, 0, str, FileName, UShortP, iIndex)
   if hIcon
   {
      DllCall("ImageList_ReplaceIcon", UInt, ImageListID1, int, -1, UInt, hIcon)
      IconNumber := DllCall("ImageList_ReplaceIcon", UInt, ImageListID2, int, -1, UInt, hIcon) + 1  ; +1 to convert to one-based.
      DllCall("DestroyIcon", Uint, hIcon)  ; Free the memory.
   }
   else
      IconNumber = 1

   ; Create the new row and assign it an icon number:
   LV_Add("Icon" . IconNumber, A_LoopFileName, A_LoopFileDir, A_LoopFileSizeKB)
}

The above is not the most efficient way to do it because it extracts the icon separately for every single file. For non-EXE files, memory and loading time could be reduced by maintaining an array of file extensions along with their associated index in the image list.

Quote:
shouldn't [App.hInstance] be built-in?
If there turns out to be a need for it, perhaps it should become a built-in variable A_hInstance. But perhaps someone knows if there's a function the script can call to discover its own hInstance value.

Thanks.

Edit: Changed one comment to "Due to root drive having backslash from FileSelectFolder."


Last edited by Chris on June 28th, 2005, 11:27 pm, edited 1 time in total.

Top
 Profile  
Reply with quote  
 Post subject:
PostPosted: June 28th, 2005, 12:52 pm 
Offline

Joined: March 28th, 2004, 3:53 pm
Posts: 1870
its slow but if icons are to be shown than random icon won't help. and the idea of maintaining an array of file extensions and imagelist is good.

thanx!

_________________
Image


Top
 Profile  
Reply with quote  
 Post subject:
PostPosted: June 28th, 2005, 1:19 pm 
Offline

Joined: March 16th, 2005, 10:33 pm
Posts: 969
Location: Frisia
@Rajat: Thank you for your answer. Am using the 'workaround' as you described already (I always use a copy of a script for fiddling with the GUI with your tool, and copy the generated GUI definitions to my 'real' script). Did replace ListView with ListBox to avoid erroring out yes, but please add something like: 'IfTheLineStartsWith "Gui, Add, ListView", just ignore it and put it back in when generating the resultfile' 8)

@Chris: I really like the potential power of the DLLCall command, but it's very hard to understand (for me) and also very hard to get the right 'commands' to use, and frankly the whole syntax 'scares me'....

Quote:
In case you want to use them right away, I don't think there's anything that would prevent you from using DllCall("CreateWindow"...) to create any control of your choice inside a parent GUI window. After creation, you could send the control some messages to set it up and get things back out of it.


You make this sound so simple, but it's mumbo jumbo to me for now...

I hate the VB-style syntax, don't understand it, and when I look around the net to find useful DLLCalls, I always end up with finding exactly that, VB code... :(

I think we need to try to collect 'useful DLLCalls' somewhere, maybe in the 'Utilities & Resources' section? If everybody can post his/hers experiences with the different Hotkeys, PostMessages and DLLCalls in programs, that would be a great timesaver...

_________________
Image mirror 1mirror 2mirror 3ahk4.me • PM or Image


Top
 Profile  
Reply with quote  
 Post subject:
PostPosted: June 28th, 2005, 2:52 pm 
Offline

Joined: May 29th, 2005, 11:20 am
Posts: 34
Location: The Netherlands
Chris,

Another fantastic improvement! I fully agree with all the positive comments written here. Fantastic.

Thanks!

Neyon


Top
 Profile  
Reply with quote  
 Post subject:
PostPosted: June 28th, 2005, 11:26 pm 
Offline

Joined: March 2nd, 2004, 3:36 pm
Posts: 10720
Rajat wrote:
i did a li'l research and found that shell32.dll\ExtractAssociatedIcon gives the correct icon
I've improved the script at the bottom of the ListView page to contain your idea. Now it gets the correct icon for the file type, just like Explorer. It also caches the icons by keeping them in an array, which makes file-loading much quicker.

Quote:
You make this sound so simple, but it's mumbo jumbo to me for now...
It was only suggested in case you were needed RichEdit or other controls right away. You're right that it would definitely take some time studying the documentation at MSDN. But I don't think you would have to have any programming experience to understand most of it.

Quote:
I think we need to try to collect 'useful DLLCalls' somewhere, maybe in the 'Utilities & Resources' section?
I agree. Either there or in Scripts/Functions, whichever seems more appropriate (case by case). Hopefully the collection will grow over time.


Top
 Profile  
Reply with quote  
 Post subject:
PostPosted: June 28th, 2005, 11:29 pm 
Offline

Joined: March 2nd, 2004, 3:36 pm
Posts: 10720
Here are the changes for v1.0.36.01:

Fixed FileCopy and FileMove to avoid deleting a file that is copied/moved onto itself. In such a case, FileCopy still counts it as a failure but FileMove now counts it as a success. [thanks mario_a]

Fixed continuation sections so that accents and commas after the word Join don't change the behavior of accents and commas in the section. [thanks Nemroth]

Added "WinSet Top", which attempts to bring a window to the top of the stack without activating it. [thanks catweazle]


Top
 Profile  
Reply with quote  
 Post subject:
PostPosted: June 29th, 2005, 5:01 pm 
Chris wrote:
Rajat wrote:
i did a li'l research and found that shell32.dll\ExtractAssociatedIcon gives the correct icon
I've improved the script at the bottom of the ListView page to contain your idea. Now it gets the correct icon for the file type, just like Explorer. It also caches the icons by keeping them in an array, which makes file-loading much quicker.


The last example had a small portion, where you specified different shell32.dll for different OS. I would need that part now. But I have already updated. damn. Could you please post that snippet. Thanks.


Top
  
Reply with quote  
Display posts from previous:  Sort by  
Post new topic Reply to topic  [ 34 posts ]  Go to page 1, 2, 3  Next

All times are UTC [ DST ]


Who is online

Users browsing this forum: No registered users and 2 guests


You cannot post new topics in this forum
You can reply to topics in this forum
You cannot edit your posts in this forum
You cannot delete your posts in this forum
You cannot post attachments in this forum

Search for:
Powered by phpBB® Forum Software © phpBB Group