From 1cf8bd66e625b0d40e58b114bb6582de41fd69e4 Mon Sep 17 00:00:00 2001 From: Banaanae <83927639+Banaanae@users.noreply.github.com> Date: Mon, 19 Aug 2024 19:23:54 +1000 Subject: [PATCH] fix +hwnd in gui new see #281 --- ConvertFuncs.ahk | 13 +++++++++---- .../Gui-Hwnd_ex4.ah1 | 15 +++++++++++++++ .../Gui-Hwnd_ex4.ah2 | 19 +++++++++++++++++++ 3 files changed, 43 insertions(+), 4 deletions(-) create mode 100644 tests/Test_Folder/Graphical User Interfaces/Gui-Hwnd_ex4.ah1 create mode 100644 tests/Test_Folder/Graphical User Interfaces/Gui-Hwnd_ex4.ah2 diff --git a/ConvertFuncs.ahk b/ConvertFuncs.ahk index 3f48ed35..2aac73d9 100644 --- a/ConvertFuncs.ahk +++ b/ConvertFuncs.ahk @@ -1702,6 +1702,7 @@ _Gui(p) { ControlLabel := "" ControlName := "" ControlObject := "" + GuiOpt := "" if (p[1] = "New" && gGuiList != "") { if (!InStr(gGuiList, gGuiNameDefault)) { @@ -1759,8 +1760,7 @@ _Gui(p) { } } } - if (RegExMatch(Var3, "i)\b\+?\bhwnd[\w]*\b")) { - RegExMatch(Var3, "i)\+?HWND(.*?)(?:\s|$)", &match) + if (RegExMatch(Var3, "i)\+?HWND(.*?)(?:\s|$)", &match)) { ControlHwnd := match[1] Var3 := StrReplace(Var3, match[]) if (ControlObject = "" && Var4 != "") { @@ -1771,11 +1771,16 @@ _Gui(p) { } gmGuiCtrlObj["%" ControlHwnd "%"] := ControlObject gmGuiCtrlObj["% " ControlHwnd] := ControlObject + } else if (RegExMatch(Var2, "i)\+?HWND(.*?)(?:\s|$)", &match)) + && (RegExMatch(Var1, "i)(?