litlmike Posted May 2, 2006 Share Posted May 2, 2006 Is it possible to embed Calc.exe (Standard Windows Calculator) in a GUI? The next question, if so, can the GUI use the data from the Calc? _ArrayPermute()_ArrayUnique()Excel.au3 UDF Link to comment Share on other sites More sharing options...
Thatsgreat2345 Posted May 3, 2006 Share Posted May 3, 2006 control get text can get the info $var = ControlGetText("Calculator", "", "Edit1") MsgBox(0,"asdf",$var) Link to comment Share on other sites More sharing options...
Valuater Posted May 3, 2006 Share Posted May 3, 2006 you can create your own too... or i did it for youexpandcollapse popup#include <GuiConstants.au3> Opt("GUIOnEventMode", 1) Dim $BTN_[37] Dim $NBTN_[10] Dim $x Dim $ver = "1.0.1" Dim $left = 0 Dim $top = 0 $key = StringSplit("1,2,3,4,5,6,7,8,9,0,Q,W,E,R,T,Y,U,I,O,P,A,S,D,F,G,H,J,K,L,Z,X,C,V,B,N,M", ",") $mainwindow = GUICreate("Keyboard - Enter Your PIN Number", 545, 200, 20, @DesktopHeight - 300 ) ; BUTTONS For $i = 1 To 36 $BTN_[$i] = GUICtrlCreateButton($key[$i], $left, $top, 40, 40) GUICtrlSetOnEvent($BTN_[$i], "ButtonPressed") $left = $left + 40 If $i = 10 Or $i = 20 Or $i = 29 Then $top = $top + 40 If $i = 10 Then $left = 0 If $i = 20 Then $left = 20 If $i = 29 Then $left = 40 Next $BackSpace = GUICtrlCreateButton("<-", 320, 120, 40, 40) GUICtrlSetFont(-1, 10, 500) $Input = GUICtrlCreateInput("", 40, 170, 150, 20) GUICtrlSetFont(-1, 10) $Send = GUICtrlCreateButton("&ENTER", 205, 165, 150, 30) GUICtrlSetOnEvent($BackSpace, "Back_Space") GUICtrlSetOnEvent($Send, "Send_it") GUISetOnEvent($GUI_EVENT_CLOSE, "CLOSEClicked") GUISetState(@SW_SHOW) GuiCreate("Pass", 142, 198, 405, 0 , BitOR($WS_CHILD, $WS_TABSTOP) + $WS_DLGFRAME, -1, $mainwindow) $Num = StringSplit("1,2,3,4,5,6,7,8,9", ",") $n = 1 $NBTN_[$n] = GuiCtrlCreateButton("1", 10, 20, 40, 40) GUICtrlSetOnEvent( -1, "Set_Num") $n = $n + 1 $NBTN_[$n] = GuiCtrlCreateButton("2", 50, 20, 40, 40) GUICtrlSetOnEvent( -1, "Set_Num") $n = $n + 1 $NBTN_[$n] = GuiCtrlCreateButton("3", 90, 20, 40, 40) GUICtrlSetOnEvent( -1, "Set_Num") $n = $n + 1 $NBTN_[$n] = GuiCtrlCreateButton("4", 10, 60, 40, 40) GUICtrlSetOnEvent( -1, "Set_Num") $n = $n + 1 $NBTN_[$n] = GuiCtrlCreateButton("5", 50, 60, 40, 40) GUICtrlSetOnEvent( -1, "Set_Num") $n = $n + 1 $NBTN_[$n] = GuiCtrlCreateButton("6", 90, 60, 40, 40) GUICtrlSetOnEvent( -1, "Set_Num") $n = $n + 1 $NBTN_[$n] = GuiCtrlCreateButton("7", 10, 100, 40, 40) GUICtrlSetOnEvent( -1, "Set_Num") $n = $n + 1 $NBTN_[$n] = GuiCtrlCreateButton("8", 50, 100, 40, 40) GUICtrlSetOnEvent( -1, "Set_Num") $n = $n + 1 $NBTN_[$n] = GuiCtrlCreateButton("9", 90, 100, 40, 40) GUICtrlSetOnEvent( -1, "Set_Num") $button_reset = GUICtrlCreateButton("Reset", 0, 0, 40, 20) $Send2 = GuiCtrlCreateButton("Enter", 10, 140, 120, 30) GUICtrlSetOnEvent( -1, "Send_it") $Label_11 = GuiCtrlCreateLabel("Please Enter Password", 10, 170, 110, 20) $pass = 0 GuiSetState() While (1) Sleep(20) WEnd Func Show_keys() GUISetState(@SW_SHOW, $mainwindow) EndFunc;==>Show_keys Func ButtonPressed() $i = @GUI_CtrlId - $BTN_[1] + 1; array starts at item 1, so add 1 $info1 = GUICtrlRead($Input) GUICtrlSetData($Input, $info1 & $key[$i]) EndFunc;==>ButtonPressed Func Set_Num() $n = @GUI_CtrlId - $NBTN_[1] + 1; array starts at item 1, so add 1 $info1 = GUICtrlRead($Input) GUICtrlSetData($Input, $info1 & $key[$n]) EndFunc;==>ButtonPressed Func Back_Space() $info1 = GUICtrlRead($Input) $info1 = StringTrimRight($info1, 1) GUICtrlSetData($Input, $info1) EndFunc;==>Back_Space Func CLOSEClicked() If @GUI_WinHandle = $mainwindow Then Exit EndIf EndFunc;==>CLOSEClicked Func Send_it() MsgBox(0,"", GUICtrlRead($Input)) EndFunc;==>Send_itthe calc only is here toohttp://www.autoitscript.com/forum/index.ph...57&hl=keyboard#calc controls are here...http://www.autoitscript.com/forum/index.ph...91&hl=keyboard#8) Link to comment Share on other sites More sharing options...
Thatsgreat2345 Posted May 3, 2006 Share Posted May 3, 2006 reset doesnt work expandcollapse popup#include <GuiConstants.au3> Opt("GUIOnEventMode", 1) Dim $BTN_[37] Dim $NBTN_[10] Dim $x Dim $ver = "1.0.1" Dim $left = 0 Dim $top = 0 $key = StringSplit("1,2,3,4,5,6,7,8,9,0,Q,W,E,R,T,Y,U,I,O,P,A,S,D,F,G,H,J,K,L,Z,X,C,V,B,N,M", ",") $mainwindow = GUICreate("Keyboard - Enter Your PIN Number", 545, 200, 20, @DesktopHeight - 300 ) ; BUTTONS For $i = 1 To 36 $BTN_[$i] = GUICtrlCreateButton($key[$i], $left, $top, 40, 40) GUICtrlSetOnEvent($BTN_[$i], "ButtonPressed") $left = $left + 40 If $i = 10 Or $i = 20 Or $i = 29 Then $top = $top + 40 If $i = 10 Then $left = 0 If $i = 20 Then $left = 20 If $i = 29 Then $left = 40 Next $BackSpace = GUICtrlCreateButton("<-", 320, 120, 40, 40) GUICtrlSetFont(-1, 10, 500) $Input = GUICtrlCreateInput("", 40, 170, 150, 20) GUICtrlSetFont(-1, 10) $Send = GUICtrlCreateButton("&ENTER", 205, 165, 150, 30) GUICtrlSetOnEvent($BackSpace, "Back_Space") GUICtrlSetOnEvent($Send, "Send_it") GUISetOnEvent($GUI_EVENT_CLOSE, "CLOSEClicked") GUISetState(@SW_SHOW) GuiCreate("Pass", 142, 198, 405, 0 , BitOR($WS_CHILD, $WS_TABSTOP) + $WS_DLGFRAME, -1, $mainwindow) $Num = StringSplit("1,2,3,4,5,6,7,8,9", ",") $n = 1 $NBTN_[$n] = GuiCtrlCreateButton("1", 10, 20, 40, 40) GUICtrlSetOnEvent( -1, "Set_Num") $n = $n + 1 $NBTN_[$n] = GuiCtrlCreateButton("2", 50, 20, 40, 40) GUICtrlSetOnEvent( -1, "Set_Num") $n = $n + 1 $NBTN_[$n] = GuiCtrlCreateButton("3", 90, 20, 40, 40) GUICtrlSetOnEvent( -1, "Set_Num") $n = $n + 1 $NBTN_[$n] = GuiCtrlCreateButton("4", 10, 60, 40, 40) GUICtrlSetOnEvent( -1, "Set_Num") $n = $n + 1 $NBTN_[$n] = GuiCtrlCreateButton("5", 50, 60, 40, 40) GUICtrlSetOnEvent( -1, "Set_Num") $n = $n + 1 $NBTN_[$n] = GuiCtrlCreateButton("6", 90, 60, 40, 40) GUICtrlSetOnEvent( -1, "Set_Num") $n = $n + 1 $NBTN_[$n] = GuiCtrlCreateButton("7", 10, 100, 40, 40) GUICtrlSetOnEvent( -1, "Set_Num") $n = $n + 1 $NBTN_[$n] = GuiCtrlCreateButton("8", 50, 100, 40, 40) GUICtrlSetOnEvent( -1, "Set_Num") $n = $n + 1 $NBTN_[$n] = GuiCtrlCreateButton("9", 90, 100, 40, 40) GUICtrlSetOnEvent( -1, "Set_Num") $button_reset = GUICtrlCreateButton("Reset", 0, 0, 40, 20) GUICtrlSetOnEvent(-1,"reset") $Send2 = GuiCtrlCreateButton("Enter", 10, 140, 120, 30) GUICtrlSetOnEvent( -1, "Send_it") $Label_11 = GuiCtrlCreateLabel("Please Enter Password", 10, 170, 110, 20) $pass = 0 GuiSetState() While (1) Sleep(20) WEnd Func Show_keys() GUISetState(@SW_SHOW, $mainwindow) EndFunc;==>Show_keys Func ButtonPressed() $i = @GUI_CtrlId - $BTN_[1] + 1; array starts at item 1, so add 1 $info1 = GUICtrlRead($Input) GUICtrlSetData($Input, $info1 & $key[$i]) EndFunc;==>ButtonPressed Func Set_Num() $n = @GUI_CtrlId - $NBTN_[1] + 1; array starts at item 1, so add 1 $info1 = GUICtrlRead($Input) GUICtrlSetData($Input, $info1 & $key[$n]) EndFunc;==>ButtonPressed Func reset() GUICtrlSetData($Input,"") EndFunc Func Back_Space() $info1 = GUICtrlRead($Input) $info1 = StringTrimRight($info1, 1) GUICtrlSetData($Input, $info1) EndFunc;==>Back_Space Func CLOSEClicked() If @GUI_WinHandle = $mainwindow Then Exit EndIf EndFunc;==>CLOSEClicked Func Send_it() MsgBox(0,"", GUICtrlRead($Input)) EndFunc;==>Send_it Link to comment Share on other sites More sharing options...
Valuater Posted May 3, 2006 Share Posted May 3, 2006 reset doesnt work you mean... after i do all that work, thats all you have to say.... andyou cant do 1 little part?8) Link to comment Share on other sites More sharing options...
Thatsgreat2345 Posted May 3, 2006 Share Posted May 3, 2006 no i added it in for you, because im so generous and for the dude that posted the topic ahahhah Link to comment Share on other sites More sharing options...
litlmike Posted May 3, 2006 Author Share Posted May 3, 2006 You guys are awesome. How would I assign the keypad to equal the keypad on the GUI? Would it be something like: If msg$ = {NUM1} Then ButtonPressed() Sorry I am so bad at programming. _ArrayPermute()_ArrayUnique()Excel.au3 UDF Link to comment Share on other sites More sharing options...
Thatsgreat2345 Posted May 4, 2006 Share Posted May 4, 2006 check out _ispressed its in beta Link to comment Share on other sites More sharing options...
litlmike Posted May 4, 2006 Author Share Posted May 4, 2006 check out _ispressed its in betaExcellent, I didn't know that existed. Here is a question, using this script, how do I say:If _IsPressed(60) Then Press 0 _ArrayPermute()_ArrayUnique()Excel.au3 UDF Link to comment Share on other sites More sharing options...
Valuater Posted May 4, 2006 Share Posted May 4, 2006 Excellent, I didn't know that existed. Here is a question, using this script, how do I say:If _IsPressed(60) Then Press 0use Send("0")8) Link to comment Share on other sites More sharing options...
litlmike Posted May 4, 2006 Author Share Posted May 4, 2006 use Send("0")8)Lol! O yeah! :"> Thanks _ArrayPermute()_ArrayUnique()Excel.au3 UDF Link to comment Share on other sites More sharing options...
GaryFrost Posted May 4, 2006 Share Posted May 4, 2006 expandcollapse popup#include <GuiConstants.au3> #include <Misc.au3> Opt("GUIOnEventMode", 1) Dim $BTN_[37] Dim $NBTN_[11] Dim $x Dim $ver = "1.0.1" Dim $left = 0 Dim $top = 0 $key = StringSplit("1,2,3,4,5,6,7,8,9,0,Q,W,E,R,T,Y,U,I,O,P,A,S,D,F,G,H,J,K,L,Z,X,C,V,B,N,M", ",") $mainwindow = GUICreate("Keyboard - Enter Your PIN Number", 545, 200, 20, @DesktopHeight - 300) ; BUTTONS For $i = 1 To 36 $BTN_[$i] = GUICtrlCreateButton($key[$i], $left, $top, 40, 40) GUICtrlSetOnEvent($BTN_[$i], "ButtonPressed") $left = $left + 40 If $i = 10 Or $i = 20 Or $i = 29 Then $top = $top + 40 If $i = 10 Then $left = 0 If $i = 20 Then $left = 20 If $i = 29 Then $left = 40 Next $BackSpace = GUICtrlCreateButton("<-", 320, 120, 40, 40) GUICtrlSetFont(-1, 10, 500) $Input = GUICtrlCreateInput("", 40, 170, 150, 20) GUICtrlSetFont(-1, 10) $Send = GUICtrlCreateButton("&ENTER", 205, 165, 150, 30) GUICtrlSetOnEvent($BackSpace, "Back_Space") GUICtrlSetOnEvent($Send, "Send_it") GUISetOnEvent($GUI_EVENT_CLOSE, "CLOSEClicked") GUISetState(@SW_SHOW) GUICreate("Pass", 142, 198, 405, 0, BitOR($WS_CHILD, $WS_TABSTOP) + $WS_DLGFRAME, -1, $mainwindow) $Num = StringSplit("1,2,3,4,5,6,7,8,9", ",") $n = 1 $NBTN_[$n] = GUICtrlCreateButton("1", 10, 100, 40, 40) ;~ $NBTN_[$n] = GuiCtrlCreateButton("1", 10, 20, 40, 40) GUICtrlSetOnEvent(-1, "Set_Num") $n = $n + 1 $NBTN_[$n] = GUICtrlCreateButton("2", 50, 100, 40, 40) ;~ $NBTN_[$n] = GuiCtrlCreateButton("2", 50, 20, 40, 40) GUICtrlSetOnEvent(-1, "Set_Num") $n = $n + 1 $NBTN_[$n] = GUICtrlCreateButton("3", 90, 100, 40, 40) ;~ $NBTN_[$n] = GuiCtrlCreateButton("3", 90, 20, 40, 40) GUICtrlSetOnEvent(-1, "Set_Num") $n = $n + 1 $NBTN_[$n] = GUICtrlCreateButton("4", 10, 60, 40, 40) GUICtrlSetOnEvent(-1, "Set_Num") $n = $n + 1 $NBTN_[$n] = GUICtrlCreateButton("5", 50, 60, 40, 40) GUICtrlSetOnEvent(-1, "Set_Num") $n = $n + 1 $NBTN_[$n] = GUICtrlCreateButton("6", 90, 60, 40, 40) GUICtrlSetOnEvent(-1, "Set_Num") $n = $n + 1 $NBTN_[$n] = GUICtrlCreateButton("7", 10, 20, 40, 40) ;~ $NBTN_[$n] = GuiCtrlCreateButton("7", 10, 100, 40, 40) GUICtrlSetOnEvent(-1, "Set_Num") $n = $n + 1 $NBTN_[$n] = GUICtrlCreateButton("8", 50, 20, 40, 40) ;~ $NBTN_[$n] = GuiCtrlCreateButton("8", 50, 100, 40, 40) GUICtrlSetOnEvent(-1, "Set_Num") $n = $n + 1 $NBTN_[$n] = GUICtrlCreateButton("9", 90, 20, 40, 40) ;~ $NBTN_[$n] = GuiCtrlCreateButton("9", 90, 100, 40, 40) GUICtrlSetOnEvent(-1, "Set_Num") $n = $n + 1 $NBTN_[$n] = GUICtrlCreateButton("0", 10, 140, 40, 40) GUICtrlSetOnEvent(-1, "Set_Num") $button_reset = GUICtrlCreateButton("Reset", 0, 0, 40, 20) GUICtrlSetOnEvent(-1, "reset") ;~ $Send2 = GuiCtrlCreateButton("Enter", 10, 140, 120, 30) $Send2 = GUICtrlCreateButton("Enter", 50, 140, 80, 40) GUICtrlSetOnEvent(-1, "Send_it") $Label_11 = GUICtrlCreateLabel("Please Enter Password", 10, 180, 110, 20) $pass = 0 GUISetState() $dll = DllOpen("user32.dll") While (1) For $x = 60 To 69 If _IsPressed(String($x), $dll) Then KeyPressed($x) ExitLoop EndIf Next If _IsPressed("0D", $dll) Then Send_it() Sleep(100) WEnd Func Show_keys() GUISetState(@SW_SHOW, $mainwindow) EndFunc ;==>Show_keys Func KeyPressed($i_key) $n = $i_key - 60 If $n = 0 Then $n = 10 $info1 = GUICtrlRead($Input) GUICtrlSetData($Input, $info1 & $key[$n]) EndFunc ;==>KeyPressed Func ButtonPressed() $i = @GUI_CtrlId - $BTN_[1] + 1; array starts at item 1, so add 1 $info1 = GUICtrlRead($Input) GUICtrlSetData($Input, $info1 & $key[$i]) EndFunc ;==>ButtonPressed Func Set_Num() $n = @GUI_CtrlId - $NBTN_[1] + 1; array starts at item 1, so add 1 $info1 = GUICtrlRead($Input) GUICtrlSetData($Input, $info1 & $key[$n]) EndFunc ;==>Set_Num Func reset() GUICtrlSetData($Input, "") EndFunc ;==>reset Func Back_Space() $info1 = GUICtrlRead($Input) $info1 = StringTrimRight($info1, 1) GUICtrlSetData($Input, $info1) EndFunc ;==>Back_Space Func CLOSEClicked() If @GUI_WinHandle = $mainwindow Then DllClose($dll) Exit EndIf EndFunc ;==>CLOSEClicked Func Send_it() MsgBox(0, "", GUICtrlRead($Input)) EndFunc ;==>Send_it SciTE for AutoItDirections for Submitting Standard UDFs  Don't argue with an idiot; people watching may not be able to tell the difference.  Link to comment Share on other sites More sharing options...
litlmike Posted May 4, 2006 Author Share Posted May 4, 2006 use Send("0") 8)Wait a minute! That won't work with your script! For that to work, that would have already have to be true. Maybe there is a misunderstanding. I want to physically press the Numeric Keypad 0, and have that mimiced on your GUI keypad. I am thinking, but it didn't work. Not sure why. expandcollapse popupWhile (1) Sleep(20) ;~ If _IsPressed(60) Then ;~ ControlClick ("Keyboard","", "4102") ;~ EndIf If _IsPressed(61) Then ControlClick ("Keyboard","", "4102") EndIf If _IsPressed(62) Then ControlClick ("Keyboard","", "4103") EndIf If _IsPressed(63) Then ControlClick ("Keyboard","", "4104") EndIf If _IsPressed(64) Then ControlClick ("Keyboard","", "4105") EndIf If _IsPressed(65) Then ControlClick ("Keyboard","", "4106") EndIf If _IsPressed(66) Then ControlClick ("Keyboard","", "4107") EndIf If _IsPressed(67) Then ControlClick ("Keyboard","", "4108") EndIf If _IsPressed(68) Then ControlClick ("Keyboard","", "4109") EndIf If _IsPressed(69) Then ControlClick ("Keyboard","", "4110") EndIf WEnd _ArrayPermute()_ArrayUnique()Excel.au3 UDF Link to comment Share on other sites More sharing options...
Valuater Posted May 4, 2006 Share Posted May 4, 2006 the way gafrost enhanced the code.. you can press number keys on the physical keyboard and it shows on the screen keyboard 8) Link to comment Share on other sites More sharing options...
litlmike Posted May 4, 2006 Author Share Posted May 4, 2006 the way gafrost enhanced the code..you can press number keys on the physical keyboard and it shows on the screen keyboard8)Awesome! You must have posted seconds before I posted. SOrry I missed you Gary. _ArrayPermute()_ArrayUnique()Excel.au3 UDF 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