youtuber Posted September 28, 2017 Posted September 28, 2017 (edited) There is a problem form3 data form2 written to Input2 fields https://i.hizliresim.com/JO4lXj.gif expandcollapse popup#include <ButtonConstants.au3> #include <EditConstants.au3> #include <GUIConstantsEx.au3> #include <WindowsConstants.au3> #include <ComboConstants.au3> #include <StringConstants.au3> #include <Crypt.au3> #include <WinAPI.au3> Global $g_iAlgorithm = $CALG_SHA1, $g_idInputEdit = -1, $g_idOutputEdit = -1 $Form1 = GUICreate("Form1", 441, 333) $ButtonGui2Open = GUICtrlCreateButton("ButtonGui2Open", 112, 152, 201, 41) $ButtonCryptGuiOpen = GUICtrlCreateButton("ButtonCryptGuiOpen", 112, 200, 201, 41) $Input1 = GUICtrlCreateInput("", 104, 32, 225, 21) $Input2 = GUICtrlCreateInput("", 104, 64, 225, 21) GUISetState(@SW_SHOW) While 1 $nMsg = GUIGetMsg() Switch $nMsg Case $GUI_EVENT_CLOSE Exit Case $ButtonCryptGuiOpen _Form3() Case $ButtonGui2Open _Form2() EndSwitch WEnd Func _Form2() GUISetState(@SW_DISABLE, $Form1) $aMetagGui = GUICreate("Form2", 706, 350, -1, -1,-1,-1, $Form1) $Input1 = GUICtrlCreateInput("", 16, 64, 169, 21) GUICtrlSendMsg($Input1, $EM_SETCUEBANNER, False, "sample asdf.") $Input2 = GUICtrlCreateInput("", 16, 131, 169, 21); GUICtrlSendMsg($Input2, $EM_SETCUEBANNER, False, "samle asdf.") $Label1 = GUICtrlCreateLabel("(Title)", 16, 40, 84, 17) $Label2 = GUICtrlCreateLabel("(Description)", 16, 107, 145, 17) GUISetState(@SW_SHOW, $aMetagGui) While 1 $nMsg = GUIGetMsg() Switch $nMsg Case $GUI_EVENT_CLOSE GUISetState(@SW_ENABLE, $Form1) GUIDelete($aMetagGui) ExitLoop EndSwitch WEnd EndFunc Func _Form3() GUISetState(@SW_DISABLE, $Form1) Local $aForm3 = GUICreate("Form3", 550, 320, -1, -1,-1,-1, $Form1) $g_idInputEdit = GUICtrlCreateEdit("", 0, 0, 550, 150, $ES_WANTRETURN) $g_idOutputEdit = GUICtrlCreateEdit("", 0, 150, 550, 150, $ES_READONLY) Local $idCombo = GUICtrlCreateCombo("", 0, 300, 100, 20, $CBS_DROPDOWNLIST) GUICtrlSetData($idCombo, "MD2|MD4|MD5|SHA1", "SHA1") GUIRegisterMsg($WM_COMMAND, "WM_COMMAND") GUISetState(@SW_SHOW, $aForm3) _Crypt_Startup() Local $dHash = 0, _ $sRead = "" While 1 $nMsg = GUIGetMsg() Switch $nMsg Case $GUI_EVENT_CLOSE GUISetState(@SW_ENABLE, $Form1) GUIDelete($aForm3) _Crypt_Shutdown() ExitLoop Case $idCombo Switch GUICtrlRead($idCombo) Case "MD2" $g_iAlgorithm = $CALG_MD2 Case "MD4" $g_iAlgorithm = $CALG_MD4 Case "MD5" $g_iAlgorithm = $CALG_MD5 Case "SHA1" $g_iAlgorithm = $CALG_SHA1 EndSwitch $sRead = GUICtrlRead($g_idInputEdit) If StringStripWS($sRead, $STR_STRIPALL) <> "" Then $dHash = _Crypt_HashData($sRead, $g_iAlgorithm) GUICtrlSetData($g_idOutputEdit, StringTrimLeft($dHash, 2)) EndIf EndSwitch WEnd EndFunc Func WM_COMMAND($hWnd, $iMsg, $wParam, $lParam) #forceref $hWnd, $iMsg, $lParam Switch _WinAPI_LoWord($wParam) Case $g_idInputEdit Switch _WinAPI_HiWord($wParam) Case $EN_CHANGE Local $dHash = _Crypt_HashData(GUICtrlRead($g_idInputEdit), $g_iAlgorithm) GUICtrlSetData($g_idOutputEdit, StringTrimLeft($dHash, 2)) EndSwitch EndSwitch EndFunc Edited September 28, 2017 by youtuber
youtuber Posted September 28, 2017 Author Posted September 28, 2017 My problem is that _Form3 () I am opening any login I'm closing _Form3 () I open _Form2 () but it still seems _Form3 () to be active you can understand from my gif picture above my problem
UEZ Posted September 28, 2017 Posted September 28, 2017 expandcollapse popup#include <ButtonConstants.au3> #include <EditConstants.au3> #include <GUIConstantsEx.au3> #include <WindowsConstants.au3> #include <ComboConstants.au3> #include <StringConstants.au3> #include <Crypt.au3> #include <WinAPI.au3> Global $g_iAlgorithm = $CALG_SHA1, $g_idInputEdit = -1, $g_idOutputEdit = -1 $Form1 = GUICreate("Form1", 441, 333) $ButtonGui2Open = GUICtrlCreateButton("ButtonGui2Open", 112, 152, 201, 41) $ButtonCryptGuiOpen = GUICtrlCreateButton("ButtonCryptGuiOpen", 112, 200, 201, 41) $Input1 = GUICtrlCreateInput("", 104, 32, 225, 21) $Input2 = GUICtrlCreateInput("", 104, 64, 225, 21) GUISetState(@SW_SHOW) While 1 $nMsg = GUIGetMsg() Switch $nMsg Case $GUI_EVENT_CLOSE Exit Case $ButtonCryptGuiOpen GUIRegisterMsg($WM_COMMAND, "WM_COMMAND") _Form3() GUIRegisterMsg($WM_COMMAND, "") Case $ButtonGui2Open _Form2() EndSwitch WEnd Func _Form2() GUISetState(@SW_DISABLE, $Form1) $aMetagGui = GUICreate("Form2", 706, 350, -1, -1, -1, -1, $Form1) $Input1 = GUICtrlCreateInput("", 16, 64, 169, 21) GUICtrlSendMsg($Input1, $EM_SETCUEBANNER, False, "sample asdf.") $Input2 = GUICtrlCreateInput("", 16, 131, 169, 21) ; GUICtrlSendMsg($Input2, $EM_SETCUEBANNER, False, "samle asdf.") $Label1 = GUICtrlCreateLabel("(Title)", 16, 40, 84, 17) $Label2 = GUICtrlCreateLabel("(Description)", 16, 107, 145, 17) GUISetState(@SW_SHOW, $aMetagGui) While 1 $nMsg = GUIGetMsg() Switch $nMsg Case $GUI_EVENT_CLOSE GUISetState(@SW_ENABLE, $Form1) GUIDelete($aMetagGui) ExitLoop EndSwitch WEnd EndFunc ;==>_Form2 Func _Form3() GUISetState(@SW_DISABLE, $Form1) Local $aForm3 = GUICreate("Form3", 550, 320, -1, -1, -1, -1, $Form1) $g_idInputEdit = GUICtrlCreateEdit("", 0, 0, 550, 150, $ES_WANTRETURN) $g_idOutputEdit = GUICtrlCreateEdit("", 0, 150, 550, 150, $ES_READONLY) Local $idCombo = GUICtrlCreateCombo("", 0, 300, 100, 20, $CBS_DROPDOWNLIST) GUICtrlSetData($idCombo, "MD2|MD4|MD5|SHA1", "SHA1") GUISetState(@SW_SHOW, $aForm3) _Crypt_Startup() Local $dHash = 0, _ $sRead = "" While 1 $nMsg = GUIGetMsg() Switch $nMsg Case $GUI_EVENT_CLOSE GUISetState(@SW_ENABLE, $Form1) GUIDelete($aForm3) _Crypt_Shutdown() ExitLoop Case $idCombo Switch GUICtrlRead($idCombo) Case "MD2" $g_iAlgorithm = $CALG_MD2 Case "MD4" $g_iAlgorithm = $CALG_MD4 Case "MD5" $g_iAlgorithm = $CALG_MD5 Case "SHA1" $g_iAlgorithm = $CALG_SHA1 EndSwitch $sRead = GUICtrlRead($g_idInputEdit) If StringStripWS($sRead, $STR_STRIPALL) <> "" Then $dHash = _Crypt_HashData($sRead, $g_iAlgorithm) GUICtrlSetData($g_idOutputEdit, StringTrimLeft($dHash, 2)) EndIf EndSwitch WEnd EndFunc ;==>_Form3 Func WM_COMMAND($hWnd, $iMsg, $wParam, $lParam) #forceref $hWnd, $iMsg, $lParam Switch _WinAPI_LoWord($wParam) Case $g_idInputEdit Switch _WinAPI_HiWord($wParam) Case $EN_CHANGE Local $dHash = _Crypt_HashData(GUICtrlRead($g_idInputEdit), $g_iAlgorithm) GUICtrlSetData($g_idOutputEdit, StringTrimLeft($dHash, 2)) EndSwitch EndSwitch EndFunc ;==>WM_COMMAND youtuber and Xandy 2 Please don't send me any personal message and ask for support! I will not reply! Selection of finest graphical examples at Codepen.io The own fart smells best! ✌Her 'sikim hıyar' diyene bir avuç tuz alıp koşma!¯\_(ツ)_/¯ ٩(●̮̮̃•̃)۶ ٩(-̮̮̃-̃)۶ૐ
BrewManNH Posted September 28, 2017 Posted September 28, 2017 In case you're wondering why this change works, it's because the 2 controls have the same value, even though you deleted one, the Form2 input2 and the Form3 $g_idOutputEdit both equal 8, so the WM_COMMAND is writing the contents to both inputs. Xandy and youtuber 2 If I posted any code, assume that code was written using the latest release version unless stated otherwise. Also, if it doesn't work on XP I can't help with that because I don't have access to XP, and I'm not going to.Give a programmer the correct code and he can do his work for a day. Teach a programmer to debug and he can do his work for a lifetime - by Chirag GudeHow to ask questions the smart way! I hereby grant any person the right to use any code I post, that I am the original author of, on the autoitscript.com forums, unless I've specifically stated otherwise in the code or the thread post. If you do use my code all I ask, as a courtesy, is to make note of where you got it from. Back up and restore Windows user files _Array.au3 - Modified array functions that include support for 2D arrays. - ColorChooser - An add-on for SciTE that pops up a color dialog so you can select and paste a color code into a script. - Customizable Splashscreen GUI w/Progress Bar - Create a custom "splash screen" GUI with a progress bar and custom label. - _FileGetProperty - Retrieve the properties of a file - SciTE Toolbar - A toolbar demo for use with the SciTE editor - GUIRegisterMsg demo - Demo script to show how to use the Windows messages to interact with controls and your GUI. - Latin Square password generator
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