Paulie Posted October 22, 2011 Share Posted October 22, 2011 (edited) Hey gang, So I'm running into a problem. I'm trying to make a GUI with 5 Labels and 2 Inputboxes. 1 of the Inputs is Hidden. I want the user to enter a word, and then i want them to try to type the same word again, but I want the labels to reflect what they type except I want 1 character per label. It's hard to explain lol, Here is a demo that explains my problem. expandcollapse popup#include <GUIConstantsEx.au3> #include <StaticConstants.au3> #include <WindowsConstants.au3> Opt("GUIOnEventMode",1) Dim $Label[5] $GUI = GUICreate("Form1", 400, 250, 192, 124) GUISetOnEvent($GUI_EVENT_CLOSE, "Quit") $Input = GUICtrlCreateInput("", 72, 192, 129, 21) GUIctrlSetState(-1,$GUI_HIDE) GUICtrlSetLimit(-1,5) GUICtrlSetOnEvent(-1, "Compare") For $x = 0 to 4 $Label[$x] = GUICtrlCreateLabel("", 72+40*$x, 136, 36, 17) Next $Compare = GUICtrlCreateInput("",200,200, 150,17) GUICtrlSetLimit(-1,5) GUICtrlSetOnEvent(-1, "Start") GUISetState(@SW_SHOW) While 1 Sleep(100) ToolTip("Enter a 5-letter word in the box and push ENTER") WEnd Func Start() ToolTip("Now that the labels work, the GUI is unresponsive"&@CRLF&"Notice, you can't close the window"&@CRLF&"And Pressing ENTER doesnt trigger OnEvent") While 1 ControlFocus($GUI,"", $Input) $Array = StringSplit(GuiCtrlRead($Input),"") For $x = 0 to $Array[0]-1 IF GUICtrlRead($Label[$x]) <> $Array[$x+1] Then GUICtrlSetData($Label[$x], $Array[$x+1]) EndIf Next For $x = 0 to 4 If $x >= UBound($Array)-1 and GUICtrlRead($Label[$x]) <> "_" then GUICtrlSetData($Label[$x], "_") EndIf Next WEnd EndFunc Func Quit() Exit EndFunc Func Compare() MsgBox(0,"", "Comparing: " &@CRLF& GuiCtrlRead(@GUI_CtrlId) &@CRLF& GuiCtrlRead($Compare)) EndFunc Any ideas on how to make this work correctly? Edited October 22, 2011 by Paulie Link to comment Share on other sites More sharing options...
Skitty Posted October 22, 2011 Share Posted October 22, 2011 $HMOD = _WinAPI_GetModuleHandle(0) $HHOOK = _WinAPI_SetWindowsHookEx($WH_KEYBOARD_LL, DllCallbackGetPtr($HSTUB_KEYPROC), $HMOD) Link to comment Share on other sites More sharing options...
Paulie Posted October 23, 2011 Author Share Posted October 23, 2011 Thanks a bunch, I knew there was something I was forgetting about. Link to comment Share on other sites More sharing options...
Recommended Posts
Create an account or sign in to comment
You need to be a member in order to leave a comment
Create an account
Sign up for a new account in our community. It's easy!
Register a new accountSign in
Already have an account? Sign in here.
Sign In Now