PhoenixXL Posted November 16, 2012 Share Posted November 16, 2012 (edited) Hello Everyone This it the Code expandcollapse popup#NoTrayIcon #include <WindowsConstants.au3> #include <WinAPI.au3> #include <Constants.au3> #include <GUIConstants.au3> $hGUI = GUICreate(@ScriptName,500,400) Global $nInput = GUICtrlCreateInput('', 10, 50, 480, 30) Global $hInput = GUICtrlGetHandle(-1) Global $nList = GUICtrlCreateList('', 10, 80, 480, 70) GUICtrlSetState(-1, BitOR($GUI_HIDE,$GUI_ONTOP)) GUICtrlSetData(-1, 'Hello|Hie|Height|How') Global $hList = GUICtrlGetHandle(-1) ; Set Input Proc Global $InputProc = DllCallbackRegister("_InputProc", "long_ptr", "hwnd;uint;wparam;lparam") Global $IProc = _WinAPI_SetWindowLong($hInput, $GWL_WNDPROC, DllCallbackGetPtr($InputProc)) ; Set GUI Proc Global $ListProc = DllCallbackRegister("_GUIProc", "long_ptr", "hwnd;uint;wparam;lparam") Global $LProc = _WinAPI_SetWindowLong($hGUI, $GWL_WNDPROC, DllCallbackGetPtr($ListProc)) GUISetState() Do Sleep(10) Until GUIGetMsg() = -3 _Exit() Func _Exit() _WinAPI_SetWindowLong($hInput, $GWL_WNDPROC, $IProc) _WinAPI_SetWindowLong($hGUI , $GWL_WNDPROC, $LProc) DllCallbackFree($InputProc) DllCallbackFree($ListProc) EndFunc Func _InputProc($hWnd, $iMsg, $wParam, $lParam) Switch $iMsg Case $WM_CHAR Switch $wParam Case 72 ; H GUICtrlSetState($nList, $GUI_SHOW) EndSwitch EndSwitch Return _WinAPI_CallWindowProc($IProc, $hWnd, $iMsg, $wParam, $lParam) EndFunc Func _GUIProc($hWnd, $iMsg, $wParam, $lParam) Return _WinAPI_CallWindowProc($LProc, $hWnd, $iMsg, $wParam, $lParam) EndFunc I Subclassed the GUI to receive ListBox Notifications through WM_COMMAND and the input to receive WM_CHAR Upon typing the H in the input the Listbox is dropped and this is where the Deadlock occurs Maybe something is getting Invoked continuously but Im not able to find so Thanks for your time Edited December 28, 2012 by PhoenixXL My code: PredictText: Predict Text of an Edit Control Like Scite. Remote Gmail: Execute your Scripts through Gmail. StringRegExp:Share and learn RegExp.Run As System: A command line wrapper around PSEXEC.exe to execute your apps scripts as System (LSA). Database: An easier approach for _SQ_LITE beginners. MathsEx: A UDF for Fractions and LCM, GCF/HCF. FloatingText: An UDF for make your text floating. Clipboard Extendor: A clipboard monitoring tool. Custom ScrollBar: Scroll Bar made with GDI+, user can use bitmaps instead. RestrictEdit_SRE: Restrict text in an Edit Control through a Regular Expression. Link to comment Share on other sites More sharing options...
JScript Posted November 16, 2012 Share Posted November 16, 2012 I do not understand the problem, for me it worked normally! What you want is that the list then disappears? JS http://forum.autoitbrasil.com/ (AutoIt v3 Brazil!!!) Somewhere Out ThereJames Ingram Download Dropbox - Simplify your life!Your virtual HD wherever you go, anywhere! Link to comment Share on other sites More sharing options...
PhoenixXL Posted November 16, 2012 Author Share Posted November 16, 2012 (edited) After pressing "H" the List appearsClick the Listafter that click the Input again to receive FocusThat causes some sort of deadlock and the GUI freezesfor me it worked normally! Edited November 16, 2012 by PhoenixXL My code: PredictText: Predict Text of an Edit Control Like Scite. Remote Gmail: Execute your Scripts through Gmail. StringRegExp:Share and learn RegExp.Run As System: A command line wrapper around PSEXEC.exe to execute your apps scripts as System (LSA). Database: An easier approach for _SQ_LITE beginners. MathsEx: A UDF for Fractions and LCM, GCF/HCF. FloatingText: An UDF for make your text floating. Clipboard Extendor: A clipboard monitoring tool. Custom ScrollBar: Scroll Bar made with GDI+, user can use bitmaps instead. RestrictEdit_SRE: Restrict text in an Edit Control through a Regular Expression. Link to comment Share on other sites More sharing options...
JScript Posted November 16, 2012 Share Posted November 16, 2012 (edited) I did this procedure and no deadlock occurs and the GUI not freezes! Environment(Language:0416 Keyboard:00010416 OS:WIN_7/Service Pack 1 CPU:X64 OS:X64) Edit: If you use WM_KEYDOWN will be much better because it works with lowercase letters JS Edited November 16, 2012 by JScript http://forum.autoitbrasil.com/ (AutoIt v3 Brazil!!!) Somewhere Out ThereJames Ingram Download Dropbox - Simplify your life!Your virtual HD wherever you go, anywhere! Link to comment Share on other sites More sharing options...
PhoenixXL Posted November 16, 2012 Author Share Posted November 16, 2012 (edited) Im Having Environment(Language:0409 Keyboard:00000409 OS:WIN_7/ CPU:X64 OS:X86) Can anybody try it on x86 OS Edited November 16, 2012 by PhoenixXL My code: PredictText: Predict Text of an Edit Control Like Scite. Remote Gmail: Execute your Scripts through Gmail. StringRegExp:Share and learn RegExp.Run As System: A command line wrapper around PSEXEC.exe to execute your apps scripts as System (LSA). Database: An easier approach for _SQ_LITE beginners. MathsEx: A UDF for Fractions and LCM, GCF/HCF. FloatingText: An UDF for make your text floating. Clipboard Extendor: A clipboard monitoring tool. Custom ScrollBar: Scroll Bar made with GDI+, user can use bitmaps instead. RestrictEdit_SRE: Restrict text in an Edit Control through a Regular Expression. Link to comment Share on other sites More sharing options...
JScript Posted November 16, 2012 Share Posted November 16, 2012 Try the following example: Example.zip Works on OSx86! JS http://forum.autoitbrasil.com/ (AutoIt v3 Brazil!!!) Somewhere Out ThereJames Ingram Download Dropbox - Simplify your life!Your virtual HD wherever you go, anywhere! Link to comment Share on other sites More sharing options...
PhoenixXL Posted November 16, 2012 Author Share Posted November 16, 2012 (edited) JScript,Thanks for the HelpBut the problem is upon subclassing the GUI still freezesIt is required to subclass the GUI to receive WM_COMMANDCodeexpandcollapse popup#include <GUIConstantsEx.au3> #include <ButtonConstants.au3> #include <EditConstants.au3> #include <WindowsConstants.au3> #include "_GUIRegisterMsgEx.au3" Global $iInput, $iList Global $pOld_WndProc, $GUIProc _Example() Func _Example() Local $hForm $hForm = GUICreate(@ScriptName, 455, 163) $iInput = GUICtrlCreateInput("", 97, 64, 247, 21) $iList = GUICtrlCreateList("", 97, 86, 247, 70) GUICtrlSetState(-1, BitOR($GUI_HIDE, $GUI_ONTOP)) GUICtrlSetData(-1, 'Hello|Hie|Height|How|Jscript') $GUIProc = DllCallbackRegister("_GUIProc", "long_ptr", "hwnd;uint;wparam;lparam") $pOld_WndProc = _WinAPI_SetWindowLong($hForm, $GWL_WNDPROC, DllCallbackGetPtr($GUIProc)) GUISetState(@SW_SHOW) _GUICtrlMsg_Register($iInput, $WM_KEYUP, "_WndProc") While 1 Switch GUIGetMsg() Case $GUI_EVENT_CLOSE _WinAPI_SetWindowLong($hForm, $GWL_WNDPROC, $pOld_WndProc) DllCallbackFree($GUIProc) Exit EndSwitch WEnd EndFunc ;==>_Example Func _WndProc($hWnd, $iMsg, $wParam, $lParam) Switch $wParam Case 72, 74 Return GUICtrlSetState($iList, $GUI_SHOW) Case Else If GUICtrlRead($iInput) = "" Then GUICtrlSetState($iList, $GUI_HIDE) EndIf EndSwitch Return $GUI_RUNDEFMSG EndFunc ;==>_WndProc Func _GUIProc($hWnd, $iMsg, $wParam, $lParam) Return _WinAPI_CallWindowProc($pOld_WndProc, $hWnd, $iMsg, $wParam, $lParam) EndFunc ;==>_GUIProcIts basically for an UDFHence I cannot use GUIRegisterMsg Edited November 16, 2012 by PhoenixXL My code: PredictText: Predict Text of an Edit Control Like Scite. Remote Gmail: Execute your Scripts through Gmail. StringRegExp:Share and learn RegExp.Run As System: A command line wrapper around PSEXEC.exe to execute your apps scripts as System (LSA). Database: An easier approach for _SQ_LITE beginners. MathsEx: A UDF for Fractions and LCM, GCF/HCF. FloatingText: An UDF for make your text floating. Clipboard Extendor: A clipboard monitoring tool. Custom ScrollBar: Scroll Bar made with GDI+, user can use bitmaps instead. RestrictEdit_SRE: Restrict text in an Edit Control through a Regular Expression. Link to comment Share on other sites More sharing options...
JScript Posted November 16, 2012 Share Posted November 16, 2012 Hence I cannot use GUIRegisterMsg_GUICtrlMsg_Register() not used GUIRegisterMsgTake a look at UDF _GUIRegisterMsgEx.au3The example in your post above works on my Win7 - x86JS http://forum.autoitbrasil.com/ (AutoIt v3 Brazil!!!) Somewhere Out ThereJames Ingram Download Dropbox - Simplify your life!Your virtual HD wherever you go, anywhere! Link to comment Share on other sites More sharing options...
PhoenixXL Posted November 16, 2012 Author Share Posted November 16, 2012 Thanks for the help JScript maybe some problem in my computer or maybe 2GB RAM I would try to find a workaround My code: PredictText: Predict Text of an Edit Control Like Scite. Remote Gmail: Execute your Scripts through Gmail. StringRegExp:Share and learn RegExp.Run As System: A command line wrapper around PSEXEC.exe to execute your apps scripts as System (LSA). Database: An easier approach for _SQ_LITE beginners. MathsEx: A UDF for Fractions and LCM, GCF/HCF. FloatingText: An UDF for make your text floating. Clipboard Extendor: A clipboard monitoring tool. Custom ScrollBar: Scroll Bar made with GDI+, user can use bitmaps instead. RestrictEdit_SRE: Restrict text in an Edit Control through a Regular Expression. Link to comment Share on other sites More sharing options...
JScript Posted December 14, 2012 Share Posted December 14, 2012 Already one month will do what you posted, you already managed to solve the problem? JS http://forum.autoitbrasil.com/ (AutoIt v3 Brazil!!!) Somewhere Out ThereJames Ingram Download Dropbox - Simplify your life!Your virtual HD wherever you go, anywhere! Link to comment Share on other sites More sharing options...
Moderators JLogan3o13 Posted December 14, 2012 Moderators Share Posted December 14, 2012 Im Having Environment(Language:0409 Keyboard:00000409 OS:WIN_7/ CPU:X64 OS:X86)Can anybody try it on x86 OSFor what it is worth, ran it in x86 environment and saw the same things as JScript. "Profanity is the last vestige of the feeble mind. For the man who cannot express himself forcibly through intellect must do so through shock and awe" - Spencer W. Kimball How to get your question answered on this forum! Link to comment Share on other sites More sharing options...
PhoenixXL Posted December 28, 2012 Author Share Posted December 28, 2012 (edited) _GUICtrlMsg_Register() not used GUIRegisterMsgYour UDF is the same as subclassing, it didnt solve the problemAlready one month will do what you posted, you already managed to solve the problem?Still the problem is UNRESOLVED,The code was for AutoSuggestion UDFI tried to find a workaround with using WM_COMMAND and with GUIRegisterMsg rather than hooks,But it feels odd for using GUIRegisterMsg in a UDF, then the User cannot use WM_COMMAND. Edited December 28, 2012 by PhoenixXL My code: PredictText: Predict Text of an Edit Control Like Scite. Remote Gmail: Execute your Scripts through Gmail. StringRegExp:Share and learn RegExp.Run As System: A command line wrapper around PSEXEC.exe to execute your apps scripts as System (LSA). Database: An easier approach for _SQ_LITE beginners. MathsEx: A UDF for Fractions and LCM, GCF/HCF. FloatingText: An UDF for make your text floating. Clipboard Extendor: A clipboard monitoring tool. Custom ScrollBar: Scroll Bar made with GDI+, user can use bitmaps instead. RestrictEdit_SRE: Restrict text in an Edit Control through a Regular Expression. Link to comment Share on other sites More sharing options...
Moderators Melba23 Posted December 28, 2012 Moderators Share Posted December 28, 2012 PhoenixXL. But it feels odd for using GUIRegisterMsg in a UDF, the User cannot use WM_COMMANDTake a look at my ChooseFileFolder UDF and you will see how I get around this problem of existing message handlers: ; From the list of functions: ; _CFF_RegMsg: Registers WM_NOTIFY to action doubleclick and item expansion on TreeView ; _CFF_WM_NOTIFY_Handler: Windows message handler for WM_NOTIFY - reacts to doubleclick and item expansion on TreeView ; And then in the headers for the 2 functions: ; Remarks .......: If the script already has a WM_NOTIFY handler then call the _CFF_WM_NOTIFY_Handler function ; from within it ; Remarks .......: If a WM_NOTIFY handler is already registered, then call this function from within that handler Many of my UDFs use the same "trick" to enable them to use GUIRegisterMsg - after all sometimes you just cannot do without it. M23 Any of my own code posted anywhere on the forum is available for use by others without any restriction of any kind Open spoiler to see my UDFs: Spoiler ArrayMultiColSort ---- Sort arrays on multiple columnsChooseFileFolder ---- Single and multiple selections from specified path treeview listingDate_Time_Convert -- Easily convert date/time formats, including the language usedExtMsgBox --------- A highly customisable replacement for MsgBoxGUIExtender -------- Extend and retract multiple sections within a GUIGUIFrame ---------- Subdivide GUIs into many adjustable framesGUIListViewEx ------- Insert, delete, move, drag, sort, edit and colour ListView itemsGUITreeViewEx ------ Check/clear parent and child checkboxes in a TreeViewMarquee ----------- Scrolling tickertape GUIsNoFocusLines ------- Remove the dotted focus lines from buttons, sliders, radios and checkboxesNotify ------------- Small notifications on the edge of the displayScrollbars ----------Automatically sized scrollbars with a single commandStringSize ---------- Automatically size controls to fit textToast -------------- Small GUIs which pop out of the notification area Link to comment Share on other sites More sharing options...
PhoenixXL Posted December 28, 2012 Author Share Posted December 28, 2012 GUIRegisterMsg - after all sometimes you just cannot do without it.I believe it is possible to register a GUI WinProc Hook and receive the messages internally through it [until and unless its single], but it goes way too complex. Your Tip looks promising. Thanks for the advice My code: PredictText: Predict Text of an Edit Control Like Scite. Remote Gmail: Execute your Scripts through Gmail. StringRegExp:Share and learn RegExp.Run As System: A command line wrapper around PSEXEC.exe to execute your apps scripts as System (LSA). Database: An easier approach for _SQ_LITE beginners. MathsEx: A UDF for Fractions and LCM, GCF/HCF. FloatingText: An UDF for make your text floating. Clipboard Extendor: A clipboard monitoring tool. Custom ScrollBar: Scroll Bar made with GDI+, user can use bitmaps instead. RestrictEdit_SRE: Restrict text in an Edit Control through a Regular Expression. 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