This 9-page topic was a good Thursday evening read.
==================================================
LIST OF POTENTIAL OBJECT PROPERTIES/METHODS
I have had some ideas for a window object, with syntax such as below, which could act as a useful checklist of properties for the GUI API:
Basic tip: take into consideration all the WinXXX and ControlXXX functions.
None of these names are 'set in stone':
Code: Select all
oWin := WinObjFromID(hWnd)
oWins := WinObjFromClass("Notepad")
oWin.containswin[hWnd]
oWin.containsctl[hWnd]
oWins.count
oWin.hwnd
oWins[1].hwnd
oWin.pname ;process name
oWin.ppath ;process path
oWin.pid ;process ID
oWin.pdesc ;description
oWin.ppriority
oWin.pbits ;e.g. 32/64
oWin.pcreated
oWin.title ;the title the last time it was retrieved, if not retrieved yet, get title now
oWin.title_r ;'refresh', get current title (cf. 'submit' principle)
oWin.pos_cs ;comma-and-space-separated
oWin.pos_k ;comma-and-space-separated
oWin.pos_c ;comma-separated
oWin.pos_s ;space-separated
oWin.pos_p ;pipe-separated
oWin.pos_l ;with letters
oWin.pos_csl ;with letters e.g. 'x0, y0, w0, h0'
oWin.pos_r ;or oWin.pos_refresh or oWin.pos_update 'refresh', get current position
oWin.pos_c["xywh"]
oWin.pos_c["xyrb"]
oWin.posrelative[hWnd2] ;relative to another window, screen/window/client
oWin.xy_r
oWin.wh_r
oWin.parent
oWin.owner
oWin.childcount ;or oWin.children.length
oWin.class
oWin.classnn (relative to parent)
oWin.isvisible
oWin.isenabled
oWin.style
oWin.exstyle
oWin.minmaxstate ;or oWin.minmax
oWin.transcolor
oWin.transvalue ;or oWin.translevel or oWin.transparency
oWin.ontop
oWin.exists
oWin.isactive ;or oWin.isfocused
oWin.children
oWin.children[1].hwnd
oWin.children[1].classnn
oWin.region
oWin.iswin ;determined when object created
oWin.isctl ;determined when object created
oWin.minimize() ;(minimise)
oWin.maximize() ;(maximise)
oWin.restore()
oWin.center() ;or oWin.movecenter (centre)
oWin.show()
oWin.hide()
oWin.kill()
oWin.close()
oWin.redraw()
oWin.ctlfocus()
oWin.ctlselect()
oWin.send()
oWin.flash()
(where oCtl has same object blueprint as oWin)
oCtl.text ;text last time it was retrieved, or current text if it wasn't retrieved before
oCtl.text_lastornow ;same as above
oCtl.text_r ;or oCtl.text_now retrieve current text
oCtl.text_last ;text last time it was retrieved, or nothing, if it hasn't been retrieved yet
oCtl.textitems("10,1-4", "`r`n") ;get item text in a certain order with a certain delimiter (handle selected/focus/column)
oCtl.rangestart ;or oCtl.range1 or oCtl.rangeleft
oCtl.rangeend ;or oCtl.range2 or oCtl.rangeright
oCtl.rangeanchor
oCtl.rangeactive
oCtl.rangetext ;or oCtl.textsel (selected text)
oCtl.linestart
oCtl.lineend
oCtl.linecount
oCtl.linetext
oCtl.col ;column
oCtl.ischecked ;(is ticked)
oWin.bkcolor ;name based on SetBkColor function (colour)
oWin.bkcolor_rgb ;name based on SetBkColor function (colour)
oWin.bkcolor_bgr ;name based on SetBkColor function (colour)
oCtl.fontcolor
oCtl.fontcolor_rgb
oCtl.fontcolor_bgr
oCtl.hfont
oCtls.text_r ;update text stored value for controls
oCtl.choose()
oCtl.choosestring()
oCtl.focus()
oCtl.select()
oCtl.deselect()
oCtl.dodefaultaction()
oCtl.moverelative() ;some other name probably
oCtl.check()
oCtl.uncheck()
oCtl.showdropdown()
oCtl.hidedropdown()
oCtl.itemdel()
oCtl.editpaste()
things like this can be handy
oWin.pos_s := "100,100,300,300"
oWin.pos_cs := "100, 100, 300, 300"
oWin.pos_s := "x100 y100 w300 h300" (where letters are ignored)
oWin.pos_parse := "w300 h300 x100 y100" (where letters are not ignored)
==================================================
LINKS
I may have missed the relevant page, but I haven't found good information regarding key GUI issues in AHK v1/v2: key combinations that cause beeps in a GUI, how to properly define hotkeys for a GUI, and how AutoHotkey handles multiple GUIs or MsgBoxes/InputBoxes, since multithreading is not possible.
[beeps + hotkeys]
send keys to a GUI window/control without causing beeps (+ the standard way to define an AHK GUI hotkey) - AutoHotkey Community
https://autohotkey.com/boards/viewtopic.php?f=5&t=29940
[threads]
An attempt at a script that creates MsgBoxes/InputBoxes for other scripts - AutoHotkey Community
https://autohotkey.com/boards/viewtopic ... 53#p138253
==================================================
AREAS OF CONCERN (FIX AUTOHOTKEY V1)
CLASS NAME/NO ICON
- ability to create a GUI window based on a WNDCLASS/WNDCLASSEX struct, or to take ownership of a window that the user created by other means
... e.g. choose GUI class name, specify no icon
FONTS
- make it easy to resize/reposition controls based on a font size
... and thus easy to respond to ^{WheelUp} / ^{WheelDown}
- what is being done regarding calculating dimensions based on text/font/control size (e.g. via DrawTextEx)?
- how are fonts handled (is there still a limit to the number of hFonts that can be created)?
INTERNAL/EXTERNAL CONTROLS
- is there the ability to use the same methods for internal/external controls?
(E.g. AHK has the ability to interact with internal listviews/treeviews, it should have all those same abilities for interacting with external treeviews, I am working on a library to do this.)
(I would want to use the same object methods for both internal and external windows/controls.)
CONTROL TYPES
- what control types are supported?
FILESELECT
- does FileSelect have the option to choose whether to display the prompt in pre/post-Vista style?
#PERSISTENT
- what is the situation regarding #Persistent?
SYNTAX
- do listviews still have all the quirky letters syntax?
MESSAGE QUEUE
- options/tips for taking more/complete control of the message queue, versus letting AHK look after it (i.e. good documentation on how to override what the GUI API does for special situations)
[A summary of my views regarding the problems with the AHK v1 Gui command]
GUI COMMANDS: COMPLETE RETHINK - AutoHotkey Community
https://autohotkey.com/boards/viewtopic.php?f=5&t=25893
==================================================
AREAS OF CONCERN (GENERAL)
SPREADSHEET CONTROL
- what is our current best option for a spreadsheet control?
EXAMPLES, PROGRESS/SPLASHIMAGE
- is there a working example for the Progress/SplashImage commands?
- how many of the AHK documentation GUI examples have been recreated?
MULTITHREADING
- what advantages do AHK default functions have over custom functions made by users e.g. regarding multithreading?
CONVERSION
- how easy will it be to convert from the Gui command to the new API?
V. OTHER PROGRAMMING LANGUAGES
- do other programming languages use a GUI API like this one, how 'quirky' is it, how easy is it to learn/use for a beginner who is proficient in a different language
- one guiding principle could be to write AHK code as though it was pseudocode for another language such as C++, so that it could be converted to another language relatively easily, if desired
- any considerations regarding GUIs that are cross-platform (i.e. marrying AHK and Linux)
==================================================
SOME NICE GUI EXAMPLES CITED IN THIS TOPIC
Dynamic GUI Demo
http://screencast-o-matic.com/watch/c2jec3nK4Z
Narrated GUI Demo
http://screencast-o-matic.com/watch/c2jeYjnKgC
Cheers evilC.