PageRenderTime 29ms CodeModel.GetById 2ms app.highlight 11ms RepoModel.GetById 1ms app.codeStats 2ms

/lib/CControl.ahk

http://github.com/Skiouros/Macro
AutoHotKey | 585 lines | 390 code | 14 blank | 181 comment | 147 complexity | 3442b1143e626c15ce189e2ea37cfb41 MD5 | raw file
  1/*
  2Class: CControl
  3Basic control class from which all controls extend.
  4*/
  5Class CControl ;Never created directly
  6{
  7	__New(Name, Options, Text, GUINum) ;Basic constructor for all controls. The control is created in CGUI.AddControl()
  8	{
  9		;~ global CFont
 10		this.Insert("Name", Name)
 11		this.Insert("Options", Options)
 12		this.Insert("Content", Text)
 13		this.Insert("GUINum", GUINum) ;Store link to gui for GuiControl purposes (and possibly others later
 14		this.Insert("_", {}) ;Create proxy object to enable __Get and __Set calls for existing keys (like ClassNN which stores a cached value in the proxy)
 15		this.Insert("Font", new CFont(GUINum))
 16		this._.Insert("RegisteredEvents", {})
 17	}
 18	PostCreate()
 19	{
 20		this.Font._.hwnd := this.hwnd
 21	}
 22	/*
 23	Function: Show
 24	Shows the control if it was previously hidden.
 25	*/
 26	Show()
 27	{
 28		;~ global CGUI
 29		if(CGUI.GUIList[this.GUINum].IsDestroyed)
 30			return
 31		Control, Show,,,% "ahk_id " this.hwnd
 32	}
 33	
 34	/*
 35	Function: Hide
 36	Hides the control if it was previously visible.
 37	*/
 38	Hide()
 39	{
 40		;~ global CGUI
 41		if(CGUI.GUIList[this.GUINum].IsDestroyed)
 42			return
 43		Control, Hide,,,% "ahk_id " this.hwnd
 44	}
 45	
 46	/*
 47	Function: Enable
 48	Enables the control if it was previously diisabled.
 49	*/
 50	Enable()
 51	{
 52		Control, Enable,,,% "ahk_id " this.hwnd
 53	}
 54	
 55	/*
 56	Function: Disable
 57	Disables the control if it was previously enabled.
 58	*/
 59	Disable()
 60	{
 61		Control, Disable,,,% "ahk_id " this.hwnd
 62	}
 63	
 64	/*
 65	Function: Focus
 66	Sets the focus to this control.
 67	*/
 68	Focus()
 69	{
 70		;~ global CGUI
 71		if(CGUI.GUIList[this.GUINum].IsDestroyed)
 72			return
 73		ControlFocus,,% "ahk_id " this.hwnd
 74	}
 75	;~ Font(Options, Font="")
 76	;~ {
 77		;~ global CGUI
 78		;~ if(CGUI.GUIList[this.GUINum].IsDestroyed)
 79			;~ return
 80		;~ Gui, % this.GUINum ":Font", %Options%, %Font%
 81		;~ GuiControl, % this.GUINum ":Font", % this.ClassNN
 82		;~ Gui, % this.GUINum ":Font", % CGUI.GUIList[this.GUINum].Font.Options, % CGUI.GUIList[this.GUINum].Font.Font ;Restore current font
 83	;~ }
 84	
 85	
 86	/*
 87	Validates the text value of this control by calling a <Control.Validate> event function which needs to return the validated (or same) value.
 88	This value is then used as text for the control if it differs.
 89	*/
 90	Validate()
 91	{
 92		output := this.CallEvent("Validate", this.Text)
 93		if(output.Handled && output.Result != this.Text)
 94			this.Text := output.result
 95	}
 96	/*
 97	Function: RegisterEvent
 98	Assigns (or unassigns) a function to a specific event of this control so that the function will be called when the event occurs.
 99	This is normally not necessary because functions in the GUI class with the name ControlName_EventName()
100	will be called automatically without needing to be registered. However this can be useful if you want to handle
101	multiple events with a single function, e.g. for a group of radio controls. Right now only one registered function per event
102	is supported, let me know if you need more.
103	
104	Parameters:
105		Type - The event name for which the function should be registered. If a control normally calls "GUI.ControlName_TextChanged()", specify "TextChanged" here.
106		FunctionName - The name of the function specified in the window class that is supposed to handle the event. Specify only the name of the function, skip the class.
107	*/
108	RegisterEvent(Type, FunctionName)
109	{
110		;~ global CGUI
111		if(FunctionName)
112		{
113			;Make sure function name is valid (or tell the developer about it)
114			if(CGUI_Assert(IsFunc(this[FunctionName]), "Invalid function name passed to CControl.RegisterEvent()"), -2)
115				this._.RegisteredEvents[Type] := FunctionName
116		}
117		else
118			this._.RegisteredEvents.Remove(Type)
119	}
120	
121	/*
122	Calls an event with a specified name by looking up a possibly registered event handling function or calling the function with the default name.
123	Returns an object with Handled and Result keys, where Handled indicates if the function was successfully called and Result is the return value of the function.
124	*/
125	CallEvent(Name, Params*)
126	{
127		;~ global CGUI
128		if(CGUI.GUIList[this.GUINum].IsDestroyed)
129			return
130		if(this._.RegisteredEvents.HasKey(Name))
131		{
132			if(IsFunc(this[this._.RegisteredEvents[Name]]))
133				return {Handled : true, Result : this[this._.RegisteredEvents[Name]](CGUI.GUIList[this.GUINum], Params*)}
134			else if(IsFunc( `(CGUI.GUIList[this.GUINum])[this._.RegisteredEvents[Name]]))
135				return {Handled : true, Result : `(CGUI.GUIList[this.GUINum])[this._.RegisteredEvents[Name]](Params*)}
136		}
137		else if(IsFunc(this[Name]))
138			return {Handled : true, Result : this[Name](CGUI.GUIList[this.GUINum], Params*)}
139		else if(IsFunc(`(CGUI.GUIList[this.GUINum])[this.Name "_" Name]))
140		{
141			OutputDebug % call this.Name "_" Name
142			return {Handled : true, Result : `(CGUI.GUIList[this.GUINum])[this.Name "_" Name](Params*)}
143		}
144		else
145			return {Handled : false}
146	}
147	/*
148	Changes the state of controls assigned to an item of another control, making them (in)visible or (de)activating them.
149	The parameters are the previously selected item object (containing a controls array of controls assigned to it and the new selected item object.
150	*/
151	ProcessSubControlState(From, To)
152	{
153		;~ global CGUI
154		if(From != To && !CGUI.GUIList[this.GUINum].IsDestroyed)
155		{
156			if(From)
157				for index, Control in From.Controls
158				{
159					if(Control._.UseEnabledState)
160						Control.Disable()
161					else
162						Control.Hide()
163				}
164			for index, Control in To.Controls
165				if(Control._.UseEnabledState)
166					Control.Enable()
167				else
168					Control.Show()
169		}
170	}
171	
172	IsValidatableControlType()
173	{
174		return CGUI_IndexOf(["Edit", "ComboBox"], this.Type)
175	}
176	/*
177	Variable: x
178	x-Position of the control.
179	
180	Variable: y
181	y-Position of the control.
182	
183	Variable: width
184	Width of the control.
185	
186	Variable: height
187	Height of the control.
188	
189	Variable: Position
190	An object containing the x and y values. They can not be set separately through this object, only both at once.
191	
192	Variable: Size
193	An object containing the width and height values. They can not be set separately through this object, only both at once.
194	
195	Variable: Text
196	The text of the control. Some controls don't support this property.
197	
198	Variable: ClassNN
199	The control class together with a number identify the control.
200	
201	Variable: Enabled
202	Determines wether this control can be interacted with.
203	
204	Variable: Visible
205	Determines wether this control is currently visible.
206	
207	Variable: Style
208	The style of the control.
209	
210	Variable: ExStyle
211	The extended style of the control.
212	
213	Variable: Focused
214	True if the control currently has the focus. It's also possible to focus it by setting this value to true.
215	
216	Variable: Tooltip
217	If a text is set for this value, this control will show a tooltip when the mouse hovers over it.
218	Text and Picture controls require that you define a g-label for them to make this work.
219	
220	Variable: Menu
221	If this variable contains an instance of <CMenu> and there is no ContextMenu() event handler for this control, this menu will be shown when the user right clicks on this control or presses the AppsKey while this control has focus.
222	
223	Variable: Left
224	The control left-aligns its text. This is the default setting.
225	
226	Variable: Center
227	The control center-aligns its text.
228	
229	Variable: Right
230	The control right-aligns its text.
231	
232	Variable: TabStop
233	If set to false, this control will not receive the focus when pressing tab to cycle through all controls.
234	
235	Variable: Wrap
236	If enabled, the control will use word-wrapping for its text.
237	
238	Variable: HScroll
239	Provides a horizontal scroll bar for this control if appropriate.
240	
241	Variable: VScroll
242	Provides a vertical scroll bar for this control if appropriate.
243	
244	Variable: BackgroundTrans
245	Uses a transparent background, which allows any control that lies behind a Text, Picture, or GroupBox control to show through.
246	
247	Variable: Background
248	If disable, the control uses the standard background color rather than the one set by the CGUI.Color() function.
249	
250	Variable: Border
251	Provides a thin-line border around the control.
252	
253	Variable: hParentControl
254	If this control is a subcontrol of another control, this variable contains the window handle of the parent control.
255	*/
256	__Get(Name, Params*) 
257    { 
258        if(this.__GetEx(Result, Name, Params*) )
259            return Result 
260    }
261	
262	__GetEx(ByRef Result, Name, Params*)
263    {
264		;~ global CGUI
265		Handled := false
266		if Name not in base,_,GUINum
267			if(!CGUI.GUIList[this.GUINum].IsDestroyed)
268			{
269				DetectHidden := A_DetectHiddenWindows
270				DetectHiddenWindows, On
271				Handled := true
272				if(Name = "Text")
273					GuiControlGet, Result,% this.GuiNum ":", % this.ClassNN
274					;~ ControlGetText, Result,, % "ahk_id " this.hwnd
275				else if(Name = "GUI")
276					Result := CGUI.GUIList[this.GUINum]
277				else if(Name = "x" || Name = "y"  || Name = "width" || Name = "height")
278				{
279					ControlGetPos, x,y,width,height,,% "ahk_id " this.hwnd
280					Result := %Name%
281				}
282				else if(Name = "Position")
283				{
284					ControlGetPos, x,y,,,,% "ahk_id " this.hwnd
285					Result := {x:x, y:y}
286				}
287				else if(Name = "Size")
288				{
289					ControlGetPos,,,width,height,,% "ahk_id " this.hwnd
290					Result := {width:width, height:height}
291				}
292				else if(Name = "ClassNN")
293				{
294					if(this._.ClassNN != "" && this.hwnd && WinExist("ahk_class " this._.ClassNN) = this.hwnd) ;Check for cached Result first
295						return this._.ClassNN
296					else
297					{
298						win := DllCall("GetParent", "PTR", this.hwnd, "PTR")
299						WinGet ctrlList, ControlList, ahk_id %win%
300						Loop Parse, ctrlList, `n 
301						{
302							ControlGet hwnd, Hwnd, , %A_LoopField%, ahk_id %win%
303							if(hwnd=this.hwnd)
304							{
305								Result := A_LoopField
306								break
307							}
308						}
309						this._.ClassNN := Result
310					}
311				}
312				else if(Name = "Enabled")
313					ControlGet, Result, Enabled,,,% "ahk_id " this.hwnd
314				else if(Name = "Visible")
315					ControlGet, Result, Visible,,,% "ahk_id " this.hwnd
316				else if(Name = "Style")
317					ControlGet, Result, Style,,,% "ahk_id " this.hwnd
318				else if(Name = "ExStyle")
319					ControlGet, Result, ExStyle,,,% "ahk_id " this.hwnd
320				else if(Name = "Focused")
321				{
322					ControlGetFocus, Result, % "ahk_id " CGUI.GUIList[this.GUINum].hwnd
323					ControlGet, Result, Hwnd,, %Result%, % "ahk_id " CGUI.GUIList[this.GUINum].hwnd
324					Result := Result = this.hwnd
325				}
326				else if(key := {Left : "Left", Center : "Center", Right : "Right", TabStop : "TabStop", Wrap : "Wrap", HScroll : "HScroll", VScroll : "VScroll", BackgroundTrans : "BackgroundTrans", Background : "Background", Border : "Border"}[Name])
327					GuiControl, % this.GUINum ":", (Result ? "+" : "-") key
328				else if(Name = "Color")
329					GuiControl, % this.GUINum ":", "+c" Result
330				else if(this._.HasKey("ControlStyles") && Style := this._.ControlStyles[Name])
331				{
332					if(SubStr(Style, 1,1) = "-")
333					{
334						Negate := true
335						Style := SubStr(Style, 2)
336					}
337					ControlGet, Result, Style,,,% "ahk_id " this.hwnd
338					Result = Result & Style > 0
339					if(Negate)
340						Result := !Result
341				}
342				else if(this._.HasKey("ControlExStyles") && ExStyle := this._.ControlExStyles[Name])
343				{
344					if(SubStr(ExStyle, 1,1) = "-")
345					{
346						Negate := true
347						ExStyle := SubStr(ExStyle, 2)
348					}
349					ControlGet, Result, ExStyle,,,% "ahk_id " this.hwnd
350					Result = Result & ExStyle > 0
351					if(Negate)
352						Result := !Result
353				}
354				else if(Name = "Tooltip")
355					Result := this._.Tooltip
356				else
357					Handled := false
358				if(!DetectHidden)
359					DetectHiddenWindows, Off
360			}
361		return Handled
362    }
363	
364    __Set(Name, Value)
365    {
366		;~ global CGUI
367		if(Name != "_" && !CGUI.GUIList[this.GUINum].IsDestroyed)
368		{
369			DetectHidden := A_DetectHiddenWindows
370			DetectHiddenWindows, On
371			Handled := true
372			if(Name = "Text")
373				GuiControl, % this.GUINum ":",% this.ClassNN, %Value% ;Use GuiControl because of line endings
374			else if(Name = "x" || Name = "y"  || Name = "width" || Name = "height")
375				ControlMove,, % (Name = "x" ? Value : ""),% (Name = "y" ? Value : ""),% (Name = "width" ? Value : ""),% (Name = "height" ? Value : ""),% "ahk_id " this.hwnd
376			else if(Name = "Position")
377				ControlMove,, % Value.x,% Value.y,,,% "ahk_id " this.hwnd
378			else if(Name = "Size")
379				ControlMove,, % Value.width,% Value.height,% "ahk_id " this.hwnd
380			else if(Name = "Enabled" && Value)
381				this.Enable()
382			else if(Name = "Enabled" && !Value)
383				this.Disable()
384			else if(Name = "Visible" && Value)
385				this.Show()
386			else if(Name = "Visible" && !Value)
387				this.Hide()
388			else if(Name = "Style")
389				Control, Style, %Value%,,,% "ahk_id " this.hwnd
390			else if(Name = "ExStyle")
391				Control, ExStyle, %Value%,,,% "ahk_id " this.hwnd
392			else if(Name = "_") ;Prohibit setting the proxy object
393				Handled := true
394			else if(this._.HasKey("ControlStyles") && Style := this._.ControlStyles[Name]) ;Generic control styles which are only of boolean type can be handled simply by a list of name<->value assignments. Prepending "-" to a value in such a list inverts the behaviour here.
395			{
396				if(SubStr(Style, 1,1) = "-")
397				{
398					Value := !Value
399					Style := SubStr(Style, 2)
400				}
401				Style := (Value ? "+" : "-") Style
402				Control, Style, %Style%,, % "ahk_id " this.hwnd
403			}
404			else if(this._.HasKey("ControlExStyles") && ExStyle := this._.ControlExStyles[Name])
405			{
406				if(SubStr(ExStyle, 1,1) = "-")
407				{
408					Value := !Value
409					ExStyle := SubStr(ExStyle, 2)
410				}
411				ExStyle := (Value ? "+" : "-") ExStyle
412				Control, ExStyle, %ExStyle%,, % "ahk_id " this.hwnd
413			}
414			else if(Name = "Tooltip") ;Thanks art http://www.autohotkey.com/forum/viewtopic.php?p=452514#452514
415			{
416				TThwnd := CGUI.GUIList[this.GUINum]._.TThwnd
417				Guihwnd := CGUI.GUIList[this.GUINum].hwnd
418				Controlhwnd := [this.hwnd]
419				if(this.type = "ComboBox") ;'ComboBox' = Drop-Down button + Edit
420				{
421					VarSetCapacity(CBBINFO, 52, 0)
422					NumPut(52, CBBINFO,0, "UINT")
423					result := DllCall("GetComboBoxInfo", "UInt", Controlhwnd[1], "PTR", &CBBINFO)
424					Controlhwnd.Insert(Numget(CBBINFO,44))
425				}
426				else if(this.type = "ListView")
427					Controlhwnd.Insert(DllCall("SendMessage", "UInt", Controlhwnd[1], "UInt", 0x101f, "PTR", 0, "PTR", 0))
428				; - 'Text' and 'Picture' Controls requires a g-label to be defined. 
429				if(!TThwnd){         
430					; - 'ListView' = ListView + Header       (Get hWnd of the 'Header' control using "ControlGet" command). 
431					TThwnd := CGUI.GUIList[this.GUINum]._.TThwnd := DllCall("CreateWindowEx","Uint",0,"Str","TOOLTIPS_CLASS32","Uint",0,"Uint",2147483648 | 3,"Uint",-2147483648 
432									,"Uint",-2147483648,"Uint",-2147483648,"Uint",-2147483648,"Ptr",GuiHwnd,"Uint",0,"Uint",0,"Uint",0, "PTR") 
433					DllCall("uxtheme\SetWindowTheme","Ptr",TThwnd,"Ptr",0,"UintP",0)   ; TTM_SETWINDOWTHEME 
434				}
435				for index, chwnd in Controlhwnd
436				{
437					Varsetcapacity(TInfo,44,0), Numput(44,TInfo), Numput(1|16,TInfo,4), Numput(GuiHwnd,TInfo,8), Numput(chwnd,TInfo,12), Numput(&Value,TInfo,36) 
438					!this._.Tooltip   ? (DllCall("SendMessage",Ptr,TThwnd,"Uint",1028,Ptr,0,Ptr,&TInfo,Ptr))         ; TTM_ADDTOOL = 1028 (used to add a tool, and assign it to a control) 
439					. (DllCall("SendMessage",Ptr,TThwnd,"Uint",1048,Ptr,0,Ptr,A_ScreenWidth))      ; TTM_SETMAXTIPWIDTH = 1048 (This one allows the use of multiline tooltips) 
440					DllCall("SendMessage",Ptr,TThwnd,"UInt",(A_IsUnicode ? 0x439 : 0x40c),Ptr,0,Ptr,&TInfo,Ptr)   ; TTM_UPDATETIPTEXT (OLD_MSG=1036) (used to adjust the text of a tip)
441				}
442			}
443			else
444				Handled := false
445			if(!DetectHidden)
446				DetectHiddenWindows, Off
447			if(Handled)
448				return Value
449		}
450    }
451	
452	/*
453	Event: Introduction
454	To handle control events you need to create a function with this naming scheme in your window class: ControlName_EventName(params)
455	The parameters depend on the event and there may not be params at all in some cases.
456	Additionally it is required to create a label with this naming scheme: GUIName_ControlName
457	GUIName is the name of the window class that extends CGUI. The label simply needs to call CGUI.HandleEvent(). 
458	For better readability labels may be chained since they all execute the same code.
459	Instead of using ControlName_EventName() you may also call <CControl.RegisterEvent> on a control instance to register a different event function name.
460	
461	Event: FocusEnter
462	Invoked when the control receives keyboard focus. This event does not require that the control has a matching g-label since it is implemented through window messages.
463	This event is not supported for all input-capable controls unfortunately.
464	
465	Event: FocusLeave
466	Invoked when the control loses keyboard focus. This event does not require that the control has a matching g-label since it is implemented through window messages.
467	This event is not supported for all input-capable controls unfortunately.
468	
469	Event: ContextMenu
470	Invoked when the user right clicks on the control or presses the AppsKey while this control has focus. If this event is not handled a static context menu can be shown by setting the Menu variable of this control to an instance of <CMenu>.
471	
472	Event: Validate
473	Invoked when the control is asked to validate its (textual) contents. This event is only valid for controls containing text, which are only Edit and ComboBox controls as of now.
474	
475	Parameters:
476		Text - The current text of the control that should be validated. The function can return this value if it is valid or another valid value.
477	*/	
478	
479	/*
480	Class: CImageListManager
481	This class is used internally to manage the ImageLists of ListView/TreeView/Tab controls. Does not need to be used directly.
482	*/
483	Class CImageListManager
484	{
485		__New(GUINum, hwnd)
486		{
487			this.Insert("_", {})
488			this._.GUINum := GUINum
489			this._.hwnd := hwnd
490			this._.IconList := {}
491		}
492		SetIcon(ID, PathOrhBitmap, IconNumber)
493		{
494			;~ global CGUI
495			GUI := CGUI.GUIList[this._.GUINum]
496			Control := GUI.Controls[this._.hwnd]
497			GUI, % this._.GUINum ":Default"
498			if(Control.Type = "ListView")
499				GUI, ListView, % Control.ClassNN
500			else if(Control.Type = "TreeView")
501				Gui, TreeView, % Control.ClassNN
502			if(!this._.IconList.SmallIL_ID)
503			{
504				if(Control.Type = "ListView") ;Listview also has large icons
505				{
506					this._.IconList.LargeIL_ID := IL_Create(5,5,1)
507					LV_SetImageList(this._.IconList.LargeIL_ID)
508				}
509				this._.IconList.SmallIL_ID := IL_Create(5,5,0)
510				if(Control.Type = "ListView")
511					LV_SetImageList(this._.IconList.SmallIL_ID)
512				else if(Control.Type = "TreeView")
513				{
514					SendMessage, 0x1109, 0, this._.IconList.SmallIL_ID, % Control.ClassNN, % "ahk_id " GUI.hwnd  ; 0x1109 is TVM_SETIMAGELIST
515					if ErrorLevel  ; The TreeView had a previous ImageList.
516						IL_Destroy(ErrorLevel)
517				}
518				else if(Control.Type = "Tab")
519				{
520					SendMessage, 0x1303, 0, this._.IconList.SmallIL_ID, % Control.ClassNN, % "ahk_id " GUI.hwnd  ; 0x1109 is TVM_SETIMAGELIST					
521				}
522			}
523			if(FileExist(PathorhBitmap))
524			{
525				Loop % this._.IconList.MaxIndex() ;IDs and paths and whatnot are identical in both lists so one is enough here
526					if(this._.IconList[A_Index].Path = PathorhBitmap && this._.IconList[A_Index].IconNumber = IconNumber)
527					{
528						Icon := this._.IconList[A_Index]
529						break
530					}
531				
532				if(!Icon)
533				{
534					IID := IL_Add(this._.IconList.SmallIL_ID, PathorhBitmap, IconNumber, 1)
535					if(Control.Type = "ListView")
536						IID := IL_Add(this._.IconList.LargeIL_ID, PathorhBitmap, IconNumber, 1)
537					this._.IconList.Insert(Icon := {Path : PathorhBitmap, IconNumber : IconNumber, ID : IID})
538				}
539			}
540			else
541			{
542				Loop % this._.IconList.MaxIndex() ;IDs and paths and whatnot are identical in both lists so one is enough here
543					if(this._.IconList[A_Index].Path = PathorhBitmap && this._.IconList[A_Index].IconNumber = IconNumber)
544					{
545						Icon := this._.IconList[A_Index]
546						break
547					}
548				if(!Icon)
549				{
550					IID := DllCall("ImageList_ReplaceIcon", "Ptr", this._.IconList.SmallIL_ID, Int, -1, "Ptr", PathorhBitmap) + 1
551					if(Control.Type = "ListView")
552						IID := DllCall("ImageList_ReplaceIcon", "Ptr", this._.IconList.LargeIL_ID, Int, -1, "Ptr", PathorhBitmap) + 1
553					this._.IconList.Insert(Icon := {Path : PathorhBitmap, IconNumber : 1, ID : IID})
554				}
555			}
556			if(Control.Type = "ListView")
557				LV_Modify(ID, "Icon" (Icon ? Icon.ID : -1))
558			else if(Control.Type = "TreeView")
559				TV_Modify(ID, "Icon" (Icon ? Icon.ID : -1))
560			else if(Control.Type = "Tab")
561			{
562				VarSetCapacity(TCITEM, 20 + 2 * A_PtrSize, 0)
563				NumPut(2, TCITEM, 0, "UInt") ;State mask TCIF_IMAGE
564				NumPut(Icon.ID - 1, TCITEM, 16 + A_PtrSize, "UInt") ;ID of icon in image list
565				SendMessage, 0x1306, ID-1, &TCITEM, % Control.ClassNN, % "ahk_id " GUI.hwnd ;TCM_SETITEM
566			}
567		}
568	}
569}
570
571#include <CTextControl>
572#include <CEditControl>
573#include <CButtonControl>
574#include <CCheckboxControl>
575#include <CChoiceControl>
576#include <CListViewControl>
577#include <CPictureControl>
578#include <CGroupBoxControl>
579#include <CStatusBarControl>
580#include <CTreeViewControl>
581#include <CTabControl>
582#include <CProgressControl>
583#include <CSliderControl>
584#include <CHotkeyControl>
585#include <CActiveXControl>