textbox inside a menu

Get help with using AutoHotkey and its commands and hotkeys
Azev
Posts: 74
Joined: 11 Dec 2015, 08:06

textbox inside a menu

10 Dec 2019, 02:49

Hi,
Is it possible to attach a textbox to a menu with AHK?
just me
Posts: 7102
Joined: 02 Oct 2013, 08:51
Location: Germany

Re: textbox inside a menu

10 Dec 2019, 04:25

Hi,
why do you want to do it?
tmplinshi
Posts: 1560
Joined: 01 Oct 2013, 14:57

Re: textbox inside a menu

10 Dec 2019, 08:18

Like this?
lv.png
lv.png (3.03 KiB) Viewed 313 times

Code: Select all

Gui, -Caption +ToolWindow
Gui, Font, s12, Arial
Gui, Margin, 0, 0
Gui, Add, Edit, w200 gInputChanged vkw, 
Gui, Add, ListView, y+-1 w200 h200 +HWNDhLV -Hdr AltSubmit gLvEvent, Items

Loop, 10 {
	LV_Add("", "Item-" A_Index)
}
LV_ModifyCol(1, 179)
lvCtrl_SetRowHeight(30)
lvCtrl_SetWindowTheme(hLV)
ControlGet, lvData, List,,, ahk_id %hLV%

Gui, Show
Return

InputChanged:
	GuiControlGet, kw

	GuiControl, -Redraw, %hLV%
	LV_Delete()
	Loop, Parse, lvData, `n, `r
	{
		if (kw = "") || InStr(A_LoopField, kw)
			LV_Add("", A_LoopField)
	}
	GuiControl, +Redraw, %hLV%
Return

LvEvent:
	if (A_GuiEvent = "Normal") && (RowNumber := A_EventInfo)
	{
		LV_GetText(SelectedText, RowNumber, 1)
		Gui, Destroy
		MsgBox, % RowNumber "," SelectedText
	}
Return

GuiEscape:
GuiClose:
ExitApp

lvCtrl_SetRowHeight(Height) {
	LV_SetImageList( DllCall( "ImageList_Create", Int,2, Int, Height, Int,0x18, Int,1, Int,1 ), 1 )
}

lvCtrl_SetWindowTheme(hLV) {
	DllCall("UxTheme.dll\SetWindowTheme", "Ptr", hLV, "WStr", "Explorer", "Ptr", 0)
	GuiControl, +LV0x14000, %hLV%
}

Return to “Ask For Help”

Who is online

Users browsing this forum: barbudo2005, Bing [Bot], boiler, burque505, Getfree, Google [Bot], TAC109, vsub, WeThotUWasAToad and 153 guests