MWIProd Posted March 19, 2024 Posted March 19, 2024 Hi, If I use _ArrayDisplay() in WM_NOTIFY function, windows will be blank and freeze. I use _AdlibRegister() as an alternativ. What is your advice ? Best regards. Quote Warning: blocking of running user functions which executes window messages with commands such as "MsgBox()" can lead to unexpected behavior, the return to the system should be as fast as possible !!!
Danyfirex Posted March 19, 2024 Posted March 19, 2024 Show us a running example. Saludos Danysys.com AutoIt... UDFs: VirusTotal API 2.0 UDF - libZPlay UDF - Apps: Guitar Tab Tester - VirusTotal Hash Checker Examples: Text-to-Speech ISpVoice Interface - Get installed applications - Enable/Disable Network connection PrintHookProc - WINTRUST - Mute Microphone Level - Get Connected NetWorks - Create NetWork Connection ShortCut
Guest Posted March 19, 2024 Posted March 19, 2024 (edited) 24 minutes ago, MWIProd said: What is your advice ? As long as the output of the array is sufficient within SciTE, you can take a look at the following UDF from @AspirinJunkie https://github.com/Sylvan86/autoit-arrayplus-udf There is a function that outputs formatted 1D and 2D arrays in the console. _Array2String print a 1D/2D-array to console or variable clearly arranged Edited March 19, 2024 by Musashi
Andreik Posted March 19, 2024 Posted March 19, 2024 (edited) Or you can use a dummy control. Here is an example: expandcollapse popup#include <WindowsConstants.au3> #include <GUIConstantsEx.au3> AutoItSetOption('GUIOnEventMode', 1) $hGUI = GUICreate('Example', 400, 400, Default, Default, BitOR($WS_SYSMENU, $WS_MINIMIZEBOX)) $cLabel = GUICtrlCreateLabel('Minimize or restore the window', 10, 10, 380, 380, 0x201) $cDummy = GUICtrlCreateDummy() GUISetState(@SW_SHOW, $hGUI) GUISetOnEvent($GUI_EVENT_CLOSE, 'Quit') GUICtrlSetOnEvent($cDummy, 'ReadMsg') GUIRegisterMsg($WM_SIZE, 'WM_SIZE') While True Sleep(10) WEnd Func ReadMsg() Local $iData = GUICtrlRead($cDummy) Switch $iData Case 1 MsgBox(0, '', 'Window has been minimized') Case 0 MsgBox(0, '', 'Window has been restored') EndSwitch EndFunc Func WM_SIZE($hWnd, $iMsg, $wParam, $lParam) #forceref $iMsg, $lParam If $hWnd = $hGUI Then GUICtrlSendToDummy($cDummy, $wParam) Return True EndIf Return $GUI_RUNDEFMSG EndFunc Func Quit() Exit EndFunc Edited March 19, 2024 by Andreik
Moderators Melba23 Posted March 19, 2024 Moderators Posted March 19, 2024 MWIProd, Quote What is your advice ? Do as the Help file tells you and do not use blocking functions in a Windows message handler. We did not write that warning for fun. 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
argumentum Posted March 19, 2024 Posted March 19, 2024 2 hours ago, MWIProd said: I use _AdlibRegister() as an alternativ. Make a Global $g_iWM_NOTIFY = 0 then inside WM_NOTIFY switch to = 1 In your While loop, if $g_iWM_NOTIFY = 1 then clear the 1 and do your _ArrayDisplay() Follow the link to my code contribution ( and other things too ). FAQ - Please Read Before Posting.
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