ASut Posted January 16, 2011 Share Posted January 16, 2011 (edited) Hi, I need some help in the GUI. 1. how can I make the test() function to be effective if I have input something and press Enter in the $Input 2. how can I make main GUI can't be clicked if I press $Button, I have set the pop-up window always on the top, but it does not work. Thanks #include <GUIConstantsEx.au3> $Form = GUICreate("Form", 170, 70, 500, 270) $Input = GUICtrlCreateInput("", 8, 8, 153, 21) $Button = GUICtrlCreateButton("Button", 48, 40, 75, 25) GUISetState(@SW_SHOW) While 1 $nMsg = GUIGetMsg() Switch $nMsg Case $GUI_EVENT_CLOSE Exit Case $Button MsgBox(262144, "Top-most", "Test") EndSwitch WEnd Func test() MsgBox(64, "TEST", "ABC") EndFunc Edited January 16, 2011 by ASut Link to comment Share on other sites More sharing options...
UEZ Posted January 16, 2011 Share Posted January 16, 2011 I'm not an expert in creating GUIs but you can try this: expandcollapse popup#include <GUIConstantsEx.au3> #include <WindowsConstants.au3> $Form = GUICreate("Form", 170, 70, 500, 270) $Input = GUICtrlCreateInput("", 8, 8, 153, 21) $Button = GUICtrlCreateButton("Button", 48, 40, 75, 25) GUISetState(@SW_SHOW) $Dummy = GUICtrlCreateDummy() GUIRegisterMsg(0x0111, "Check_Input") ; $WM_COMMAND = 0x0111 While 1 $nMsg = GUIGetMsg() Switch $nMsg Case $GUI_EVENT_CLOSE GUIRegisterMsg(0x0111, "") Exit Case $Button, $Dummy ;~ MsgBox(262144, "Top-most", "Test") Test() EndSwitch WEnd Func test() Local $hGUI = GUICreate("", 170, 70, 0, 0, $WS_POPUP, BitOR($WS_EX_MDICHILD, $WS_EX_TOPMOST), $Form) Local $label = GUICtrlCreateLabel("Hello World", 30, 20, 170, 70) GUICtrlSetFont (-1, 16) GUISetState(@SW_SHOW, $hGUI) While GUIGetMsg() <> $GUI_EVENT_CLOSE WEnd GUIDelete($hGUI) EndFunc Func Check_Input($hWnd, $Msg, $wParam, $lParam) #forceref $hWnd, $Msg, $wParam, $lParam If Not BitAND($wParam, 0xFFFF0000) Then GUICtrlSendToDummy($Dummy) Return "GUI_RUNDEFMSG" EndFunc Br, UEZ 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!¯\_(ツ)_/¯ ٩(●̮̮̃•̃)۶ ٩(-̮̮̃-̃)۶ૐ Link to comment Share on other sites More sharing options...
ASut Posted January 16, 2011 Author Share Posted January 16, 2011 Thanks for the help It works fine for me Link to comment Share on other sites More sharing options...
ASut Posted January 16, 2011 Author Share Posted January 16, 2011 How can I modify the code in order to make this code works only at specific input field? Link to comment Share on other sites More sharing options...
AdmiralAlkex Posted January 16, 2011 Share Posted January 16, 2011 2. how can I make main GUI can't be clicked if I press $Button, I have set the pop-up window always on the top, but it does not work.Set the hwnd parameter of MsgBox(). .Some of my scripts: ShiftER, Codec-Control, Resolution switcher for HTC ShiftSome of my UDFs: SDL UDF, SetDefaultDllDirectories, Converting GDI+ Bitmap/Image to SDL Surface 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