Info:
EM_SETCUEBANNER message -> Sets the textual cue, or tip, that is displayed by the edit control to prompt the user for information.
CB_SETCUEBANNER message -> Sets the cue banner text that is displayed for the edit control of a combo box.
Example (it might look like this) in v2:
Code: Select all
MyEdit := Gui.Add("Edit", "x10 y10 w250")
MyEdit.SetCue("Enter Text here...")
; Gui.Add("Edit", "x10 y10 w250").SetCue("Enter Text here...") ; alternate
MyCombo := Gui.Add("ComboBox", "x10 y10 w250")
MyCombo.SetCue("Enter Text here...")
; Gui.Add("ComboBox", "x10 y10 w250").SetCue("Enter Text here...") ; alternate
How I use it atm in v1.1 as functions:
Code: Select all
; ===============================================================================================================================
; Message ..................: EM_SETCUEBANNER
; Minimum supported client .: Windows Vista
; Minimum supported server .: Windows Server 2003
; Links ....................: https://docs.microsoft.com/en-us/windows/win32/controls/em-setcuebanner
; Description ..............: Sets the textual cue, or tip, that is displayed by the edit control to prompt the user for information.
; Option ...................: True -> if the cue banner should show even when the edit control has focus
; False -> if the cue banner disappears when the user clicks in the control
; ===============================================================================================================================
EM_SETCUEBANNER(handle, string, option := true)
{
static ECM_FIRST := 0x1500
static EM_SETCUEBANNER := ECM_FIRST + 1
if (DllCall("user32\SendMessage", "ptr", handle, "uint", EM_SETCUEBANNER, "int", option, "str", string, "int"))
return true
return false
}
; ===============================================================================================================================
Code: Select all
; ===============================================================================================================================
; Message ..................: CB_SETCUEBANNER
; Minimum supported client .: Windows Vista
; Minimum supported server .: Windows Server 2008
; Links ....................: https://docs.microsoft.com/en-us/windows/win32/controls/cb-setcuebanner
; Description ..............: Sets the cue banner text that is displayed for the edit control of a combo box.
; ===============================================================================================================================
CB_SETCUEBANNER(handle, string)
{
static CBM_FIRST := 0x1700
static CB_SETCUEBANNER := CBM_FIRST + 3
if (DllCall("user32\SendMessage", "ptr", handle, "uint", CB_SETCUEBANNER, "int", 0, "str", string, "int"))
return true
return false
}
; ===============================================================================================================================