MrCreatoR Posted May 17, 2020 Author Share Posted May 17, 2020 (edited) 3 minutes ago, Danyfirex said: compare if they have same value Yes they are the same, i don't know why i didn't thought about that in the first place. Thanks. 4 minutes ago, Danyfirex said: maybe I can do it in my dreams meanwhile It's always good to dream! But soon everything will be better! 🍻 Edited May 17, 2020 by MrCreatoR Danyfirex 1 Spoiler Using OS: Win 7 Professional, Using AutoIt Ver(s): 3.3.6.1 / 3.3.8.1 AutoIt Russian Community My Work... Spoiler Projects: ATT - Application Translate Tool {new}| BlockIt - Block files & folders {new}| SIP - Selected Image Preview {new}| SISCABMAN - SciTE Abbreviations Manager {new}| AutoIt Path Switcher | AutoIt Menu for Opera! | YouTube Download Center! | Desktop Icons Restorator | Math Tasks | KeyBoard & Mouse Cleaner | CaptureIt - Capture Images Utility | CheckFileSize ProgramUDFs: OnAutoItErrorRegister - Handle AutoIt critical errors {new}| AutoIt Syntax Highlight {new}| Opera Library! | Winamp Library | GetFolderToMenu | Custom_InputBox()! | _FileRun UDF | _CheckInput() UDF | _GUIInputSetOnlyNumbers() UDF | _FileGetValidName() UDF | _GUICtrlCreateRadioCBox UDF | _GuiCreateGrid() | _PathSplitByRegExp() | _GUICtrlListView_MoveItems - UDF | GUICtrlSetOnHover_UDF! | _ControlTab UDF! | _MouseSetOnEvent() UDF! | _ProcessListEx - UDF | GUICtrl_SetResizing - UDF! | Mod. for _IniString UDFs | _StringStripChars UDF | _ColorIsDarkShade UDF | _ColorConvertValue UDF | _GUICtrlTab_CoverBackground | CUI_App_UDF | _IncludeScripts UDF | _AutoIt3ExecuteCode | _DragList UDF | Mod. for _ListView_Progress | _ListView_SysLink | _GenerateRandomNumbers | _BlockInputEx | _IsPressedEx | OnAutoItExit Handler | _GUICtrlCreateTFLabel UDF | WinControlSetEvent UDF | Mod. for _DirGetSizeEx UDF Examples: ScreenSaver Demo - Matrix included | Gui Drag Without pause the script | _WinAttach()! | Turn Off/On Monitor | ComboBox Handler Example | Mod. for "Thinking Box" | Cool "About" Box | TasksBar Imitation Demo Like the Projects/UDFs/Examples? Please rate the topic (up-right corner of the post header: Rating ) * === My topics === * ================================================== ================================================== AutoIt is simple, subtle, elegant. © AutoIt Team Link to comment Share on other sites More sharing options...
argumentum Posted May 17, 2020 Share Posted May 17, 2020 ...I'm kind of lost. The main script sends "_StringRepeat('Send', Random(10, 100))" The child responds "_StringRepeat('Return', Random(10, 100))" Where can I read what the main sent to the child in the child ? Follow the link to my code contribution ( and other things too ). FAQ - Please Read Before Posting. Link to comment Share on other sites More sharing options...
Danyfirex Posted May 17, 2020 Share Posted May 17, 2020 Inside _WM_COPYDATA check $tData.Data Saludos argumentum 1 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 Link to comment Share on other sites More sharing options...
argumentum Posted May 17, 2020 Share Posted May 17, 2020 (edited) @Danyfirex, this look awesome, very cool. The _WM_COPYDATA is used as an event, to trigger the read memory. Is there a way, that is not too far out of your way, to trigger the memory read without using a GUI for it ?, as a memory write that triggers a memory read, or simple in the main loop read, that is not heavy for AutoIt ? I know this is not the OP question but, can't help to wonder since is all a memory read/write and the GUI is just for the event handler. No GUI dependency would be like, WOW. Thanks. Edited May 17, 2020 by argumentum grammar :) Danyfirex 1 Follow the link to my code contribution ( and other things too ). FAQ - Please Read Before Posting. Link to comment Share on other sites More sharing options...
Bilgus Posted May 17, 2020 Share Posted May 17, 2020 You still need a message loop Windows doesn't give you one without a GUI Non CLI Autoit apps have an internal window You could use the internal autoit window AutoItWinSetTitle(@ScriptName) $hAutoitInternal = WinGetHandle(@ScriptName) Link to comment Share on other sites More sharing options...
argumentum Posted May 17, 2020 Share Posted May 17, 2020 5 minutes ago, Bilgus said: You still need a message loop ...the script needs a loop, OnEvent or not. So, a loop is not a big deal. 6 minutes ago, Bilgus said: You could use the internal autoit window actually no. I can not GUIRegisterMsg() it. Follow the link to my code contribution ( and other things too ). FAQ - Please Read Before Posting. Link to comment Share on other sites More sharing options...
Bilgus Posted May 17, 2020 Share Posted May 17, 2020 (edited) nah you need to use SetWindowSubclass AutoItWinSetTitle(@ScriptName) $hAutoitInternal = WinGetHandle(@ScriptName) $hMsgProc = DllCallbackRegister(NewMessage, 'lresult', 'hwnd;uint;wparam;lparam;uint_ptr;dword_ptr') _WinAPI_SetWindowSubclass($hAutoitInternal, DllCallbackGetPtr($hMsgProc), $iMyID) Func NewMessage($hWnd, $iMsg, $wParam, $lParam, $iId, $pData) #forceref $iID, $pData Return _WinAPI_DefSubclassProc($hWnd, $iMsg, $wParam, $lParam) EndFunc Func _Exit() If $hMsgProc Then _WinAPI_RemoveWindowSubclass($hAutoitInternal, DllCallbackGetPtr($hMsgProc), $iMyID) DllCallbackFree($g_hMsgProc) EndIf Edited May 17, 2020 by Bilgus Add #forceref $iID, $pData Return _WinAPI_DefSubclassProc($hWnd, $iMsg, $wParam, $lParam) Danyfirex and argumentum 1 1 Link to comment Share on other sites More sharing options...
argumentum Posted May 17, 2020 Share Posted May 17, 2020 1 minute ago, Bilgus said: nah you need to use SetWindowsSubclass WOW, thanks. So... , will AutoIt still receive it's messages or am I now in charge of every event ? Follow the link to my code contribution ( and other things too ). FAQ - Please Read Before Posting. Link to comment Share on other sites More sharing options...
Bilgus Posted May 17, 2020 Share Posted May 17, 2020 Quote ...the script needs a loop, OnEvent or not. So, a loop is not a big deal. When you do your own message loop it has to be pumped in a timely manner so it sometimes becomes a big deal at least with the subclass you can still have AutoIt take care of the minute Link to comment Share on other sites More sharing options...
Bilgus Posted May 17, 2020 Share Posted May 17, 2020 (edited) No you just pass on what you don't want to handle to the default with _WinAPI_DefSubclassProc() The helpfile explains it pretty clearly Edited May 17, 2020 by Bilgus argumentum 1 Link to comment Share on other sites More sharing options...
argumentum Posted May 17, 2020 Share Posted May 17, 2020 2 minutes ago, Bilgus said: When you do your own message loop it has to be pumped in a timely manner so it sometimes becomes a big deal ... ...all this is way above my pay grade !. I would have to build some coding experience to comfortably code with sub-classing. Thanks for the coding class I'll give a try in one of those moments when I'm bored. It'll be good to expand my knowing to the point that this technique is in my arsenal Follow the link to my code contribution ( and other things too ). FAQ - Please Read Before Posting. Link to comment Share on other sites More sharing options...
Bilgus Posted May 17, 2020 Share Posted May 17, 2020 (edited) OH don't conflate the two, Subclassing an existing winproc is not doing your own message loop its the same idea as GUIRegister message doing your own message loop isn't near as simple Edited May 17, 2020 by Bilgus argumentum 1 Link to comment Share on other sites More sharing options...
KaFu Posted May 18, 2020 Share Posted May 18, 2020 (edited) Using COM for IPC and triggering events without a loop but via ObjEvent() could be a good method too. Edit: Or do something like this in a loop and look for changes / reset the var when read. Edited May 18, 2020 by KaFu argumentum 1 OS: Win10-22H2 - 64bit - German, AutoIt Version: 3.3.16.1, AutoIt Editor: SciTE, Website: https://funk.eu AMT - Auto-Movie-Thumbnailer (2024-Oct-13) BIC - Batch-Image-Cropper (2023-Apr-01) COP - Color Picker (2009-May-21) DCS - Dynamic Cursor Selector (2024-Oct-13) HMW - Hide my Windows (2024-Oct-19) HRC - HotKey Resolution Changer (2012-May-16) ICU - Icon Configuration Utility (2018-Sep-16) SMF - Search my Files (2024-Oct-20) - THE file info and duplicates search tool SSD - Set Sound Device (2017-Sep-16) Link to comment Share on other sites More sharing options...
argumentum Posted May 18, 2020 Share Posted May 18, 2020 (edited) looks like a solution to my question ...it does crash running x64 @trancexx, ..it been about a decade since the code. Can it be fixed ? ..it won't run on v3.3.6.1 or 3.3.8.1 either ( on Win10 ), so maybe there was no solution from the get go, regarding x64. Not that I "need" to run x64 but your view regarding this is welcomed. Edit: ..now that I read more about it, this would be an overkill, and misused to fit the purpose of triggering an event. Edited May 18, 2020 by argumentum Follow the link to my code contribution ( and other things too ). FAQ - Please Read Before Posting. 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