EditFoucs não funcina?

Post a reply


In an effort to prevent automatic submissions, we require that you complete the following challenge.
Smilies
:D :) ;) :( :o :shock: :? 8-) :lol: :x :P :oops: :cry: :evil: :twisted: :roll: :!: :?: :idea: :| :mrgreen: :geek: :ugeek: :arrow: :angel: :clap: :crazy: :eh: :lolno: :problem: :shh: :shifty: :sick: :silent: :think: :thumbup: :thumbdown: :salute: :wave: :wtf: :yawn: :facepalm: :bravo: :dance: :beard: :morebeard: :xmas: :HeHe: :trollface: :cookie: :rainbow: :monkeysee: :monkeysay: :happybday: :headwall: :offtopic: :superhappy: :terms: :beer:
View more smilies

BBCode is ON
[img] is OFF
[flash] is OFF
[url] is ON
Smilies are ON

Topic review
   

Expand view Topic review: EditFoucs não funcina?

Re: EditFoucs não funcina?

by garry » 21 Nov 2023, 10:49

;- exemplo > login + password > ENTER

Code: Select all

;- exemplo > login + password > ENTER
#Warn
#NoEnv
setworkingdir,%a_scriptdir%
Filename1=Login_Password_ENTER
Gui,2: Color,Black,Black       
Gui,2:show,x0 y0 w400 h70,%filename1%
Gui,2:Font,cYellow S14 ,Lucida Console
Gui,2:add,edit  ,x10  y5   h35  w120 vED1 hwndHED11 left -vscroll,
Gui,2:add,edit  ,x140 y5   h35  w120 vED2 hwndHED12 left +Password -vscroll,  ;- 123456
Gui,2:add,button,x0 y0  h0  w0 gA1 default,ENTER
SetEditCueBanner(HED11, "Username")
SetEditCueBanner(HED12, "Password")
GuiControl,2: Focus,ED1
return
;----------------------
2Guiclose:
exitapp
;----------------------
A1:
Gui,2:submit,nohide
if ED2=123456
   gosub,A2
else
   msgbox, 262160,PASSWORD ,senha incorreta
return
;--------------
A2:
try,run,https://news.google.com/home?hl=pt-PT&gl=PT&ceid=PT:pt-150
exitapp
;--------------
SetEditCueBanner(HWND, Cue) {  ; requires AHL_L
   Static EM_SETCUEBANNER := (0x1500 + 1)
   Return DllCall("User32.dll\SendMessageW", "Ptr", HWND, "Uint", EM_SETCUEBANNER, "Ptr", True, "WStr", Cue)
}
;=====================
exemplo-2

Code: Select all

 
#NoEnv
setworkingdir,%a_scriptdir%
Filename1=TEST
Gui,2: Color,Black,Black       
aa:=" Digite a palavra-chave  "
Gui,2:show,x0 y0 w570 h110,%filename1%
Gui,2:Font,cYellow S14 ,Lucida Console
Gui,2:add,edit  ,x10 y5   h35  w540 vED1 left readonly,%aa%
Gui,2:add,button,x10 y65  h35  w100 gA1,CHANGE
return
;----------------------
2Guiclose:
exitapp
;----------------------
A1:
Gui,2:submit,nohide
if ed1=%aa%
   GuiControl,2:,ED1,
if ed1=
   GuiControl,2:,ED1,%aa%
return
;============================

EditFoucs não funcina?

by AutoHotkeyHelpMe » 20 Nov 2023, 20:06

Estou tendo problemas com esse pedaço de script, o EditFocus não esvazia a caixa Edit

Code: Select all

EditFocus:
    GuiControlGet, palavraChave
    if (palavraChave = "Digite a palavra-chave")
    {
        GuiControl, , palavraChave, ""
        GuiControl, Font, cBlack
    }
return

EditFocusLost:
    GuiControlGet, palavraChave
    if (palavraChave = "")
    {
        GuiControl, , palavraChave, Digite a palavra-chave
        GuiControl, Font, cGray
    }
return
[Mod edit: Changed codebox type from text to AuotHotkey.]

Top