xjf Posted March 19, 2022 Share Posted March 19, 2022 the window title and class from "AutoIt v3 Window Info" is : title: NCRE服务器设置 class: WindowsForms10.Window.8.app.0.21373f6_r14_ad1 and then _ArrayDisplay(WinList("[TITLE:NCRE服务器设置]")) ; 1 window _ArrayDisplay(WinList("[REGEXPTITLE:NCRE服务器设置]")) ; 0 window, why ? _ArrayDisplay(WinList("[REGEXPTITLE:服务器设置]")) ; 1 window _ArrayDisplay(WinList("[REGEXPTITLE:NCRE]")) ; 0 windows, why ? _ArrayDisplay(WinList("[CLASS:WindowsForms10.Window.8.app.0.21373f6_r14_ad1]")) ; 1 window _ArrayDisplay(WinList("[REGEXPCLASS:WindowsForms10.Window.8.app.0.21373f6_r14_ad1]")) ; 0 window, why ? _ArrayDisplay(WinList("[REGEXPCLASS:WindowsForms10]")) ; 0 window, why ? why that ? need some help. i'll be appreciate. Link to comment Share on other sites More sharing options...
ad777 Posted March 19, 2022 Share Posted March 19, 2022 @xjf i tested your script & working fine,below script: expandcollapse popup#include <WinAPIGdi.au3> #include <WinAPIIcons.au3> #include <WinAPIRes.au3> #include <WinAPISys.au3> #include <WinAPISysWin.au3> #include <WindowsConstants.au3> #include <array.au3> Global $g_bExit = False _Example() Func _Example() Local Const $sClass = 'WindowsForms10.Window.8.app.0.21373f6_r14_ad1' Local Const $sName = 'NCRE服务器设置' ; Get module handle for the current process Local $hInstance = _WinAPI_GetModuleHandle(0) ; Create a class cursor Local $hCursor = _WinAPI_LoadCursor(0, 32512) ; IDC_ARROW ; Create a class icons (large and small) Local $tIcons = DllStructCreate('ptr;ptr') _WinAPI_ExtractIconEx(@SystemDir & '\shell32.dll', 130, DllStructGetPtr($tIcons, 1), DllStructGetPtr($tIcons, 2), 1) Local $hIcon = DllStructGetData($tIcons, 1) Local $hIconSm = DllStructGetData($tIcons, 2) ; Create DLL callback function (window procedure) Local $hProc = DllCallbackRegister('_WndProc', 'lresult', 'hwnd;uint;wparam;lparam') ; Create and fill $tagWNDCLASSEX structure Local $tWCEX = DllStructCreate($tagWNDCLASSEX & ';wchar szClassName[' & (StringLen($sClass) + 1) & ']') DllStructSetData($tWCEX, 'Size', DllStructGetPtr($tWCEX, 'szClassName') - DllStructGetPtr($tWCEX)) DllStructSetData($tWCEX, 'Style', 0) DllStructSetData($tWCEX, 'hWndProc', DllCallbackGetPtr($hProc)) DllStructSetData($tWCEX, 'ClsExtra', 0) DllStructSetData($tWCEX, 'WndExtra', 0) DllStructSetData($tWCEX, 'hInstance', $hInstance) DllStructSetData($tWCEX, 'hIcon', $hIcon) DllStructSetData($tWCEX, 'hCursor', $hCursor) DllStructSetData($tWCEX, 'hBackground', _WinAPI_CreateSolidBrush(_WinAPI_GetSysColor($COLOR_3DFACE))) DllStructSetData($tWCEX, 'MenuName', 0) DllStructSetData($tWCEX, 'ClassName', DllStructGetPtr($tWCEX, 'szClassName')) DllStructSetData($tWCEX, 'hIconSm', $hIconSm) DllStructSetData($tWCEX, 'szClassName', $sClass) ; Register a window class _WinAPI_RegisterClassEx($tWCEX) ; Create a window _WinAPI_CreateWindowEx(0, $sClass, $sName, BitOR($WS_CAPTION, $WS_POPUPWINDOW, $WS_VISIBLE), (@DesktopWidth - 400) / 2, (@DesktopHeight - 400) / 2, 400, 400, 0) _ArrayDisplay(WinList("[TITLE:NCRE服务器设置]")) ; 1 window _ArrayDisplay(WinList("[REGEXPTITLE:NCRE服务器设置]")) ; 0 window, why ? _ArrayDisplay(WinList("[REGEXPTITLE:服务器设置]")) ; 1 window _ArrayDisplay(WinList("[REGEXPTITLE:NCRE]")) ; 0 windows, why ? _ArrayDisplay(WinList("[CLASS:WindowsForms10.Window.8.app.0.21373f6_r14_ad1]")) ; 1 window _ArrayDisplay(WinList("[REGEXPCLASS:WindowsForms10.Window.8.app.0.21373f6_r14_ad1]")) ; 0 window, why ? _ArrayDisplay(WinList("[REGEXPCLASS:WindowsForms10]")) ; 0 window, why ? While 1 Sleep(100) If $g_bExit Then ExitLoop EndIf WEnd ; Unregister window class and release unnecessary resources _WinAPI_UnregisterClass($sClass, $hInstance) _WinAPI_DestroyCursor($hCursor) _WinAPI_DestroyIcon($hIcon) _WinAPI_DestroyIcon($hIconSm) DllCallbackFree($hProc) EndFunc ;==>_Example ; Func _WinAPI_DefWindowProcW($hWnd, $iMsg, $wParam, $lParam) ; Local $aRet = DllCall('user32.dll', 'lresult', 'DefWindowProcW', 'hwnd', $hWnd, 'uint', $iMsg, 'wparam', $wParam, 'lparam', $lParam) ; If @error Then ; Return SetError(1, 0, 0) ; EndIf ; Return $aRet[0] ; EndFunc ;==>_WinAPI_DefWindowProcW Func _WndProc($hWnd, $iMsg, $wParam, $lParam) Switch $iMsg Case $WM_CLOSE $g_bExit = True EndSwitch Return _WinAPI_DefWindowProcW($hWnd, $iMsg, $wParam, $lParam) EndFunc ;==>_WndProc iam ِAutoit programmer. best thing in life is to use your Brain to Achieve everything you want. Link to comment Share on other sites More sharing options...
xjf Posted March 19, 2022 Author Share Posted March 19, 2022 @ad777 i test your script with v3.3.16.0 on win7 x64 _ArrayDisplay show WinList count is : 1st,1 2nd,0 3rd,1 4th,0 5th,1 6th,0 7th,0 just like what i said ... Link to comment Share on other sites More sharing options...
ad777 Posted March 19, 2022 Share Posted March 19, 2022 (edited) @xjf my script was tested on win 7 32bit & v3.3.15.4(beta) & working fine. Edited March 19, 2022 by ad777 iam ِAutoit programmer. best thing in life is to use your Brain to Achieve everything you want. Link to comment Share on other sites More sharing options...
xjf Posted March 19, 2022 Author Share Posted March 19, 2022 @ad777 v3.3.14.5 & win7 x64 works fine Link to comment Share on other sites More sharing options...
xjf Posted March 19, 2022 Author Share Posted March 19, 2022 @ad777 would your please submit a bug report this ? My English really sucks ... Link to comment Share on other sites More sharing options...
ad777 Posted March 19, 2022 Share Posted March 19, 2022 17 minutes ago, xjf said: @ad777 would your please submit a bug report this ? My English really sucks ... i already did. the new ver.Autoit v3.3.16.0 i think it work for substr:(below script): expandcollapse popup#include <WinAPIGdi.au3> #include <WinAPIIcons.au3> #include <WinAPIRes.au3> #include <WinAPISys.au3> #include <WinAPISysWin.au3> #include <WindowsConstants.au3> #include <array.au3> Global $g_bExit = False _Example() Func _Example() Local Const $sClass = 'WindowsForms10.Window.8.app.0.21373f6_r14_ad1' Local Const $sName = 'NCRE服务器设置' ; Get module handle for the current process Local $hInstance = _WinAPI_GetModuleHandle(0) ; Create a class cursor Local $hCursor = _WinAPI_LoadCursor(0, 32512) ; IDC_ARROW ; Create a class icons (large and small) Local $tIcons = DllStructCreate('ptr;ptr') _WinAPI_ExtractIconEx(@SystemDir & '\shell32.dll', 130, DllStructGetPtr($tIcons, 1), DllStructGetPtr($tIcons, 2), 1) Local $hIcon = DllStructGetData($tIcons, 1) Local $hIconSm = DllStructGetData($tIcons, 2) ; Create DLL callback function (window procedure) Local $hProc = DllCallbackRegister('_WndProc', 'lresult', 'hwnd;uint;wparam;lparam') ; Create and fill $tagWNDCLASSEX structure Local $tWCEX = DllStructCreate($tagWNDCLASSEX & ';wchar szClassName[' & (StringLen($sClass) + 1) & ']') DllStructSetData($tWCEX, 'Size', DllStructGetPtr($tWCEX, 'szClassName') - DllStructGetPtr($tWCEX)) DllStructSetData($tWCEX, 'Style', 0) DllStructSetData($tWCEX, 'hWndProc', DllCallbackGetPtr($hProc)) DllStructSetData($tWCEX, 'ClsExtra', 0) DllStructSetData($tWCEX, 'WndExtra', 0) DllStructSetData($tWCEX, 'hInstance', $hInstance) DllStructSetData($tWCEX, 'hIcon', $hIcon) DllStructSetData($tWCEX, 'hCursor', $hCursor) DllStructSetData($tWCEX, 'hBackground', _WinAPI_CreateSolidBrush(_WinAPI_GetSysColor($COLOR_3DFACE))) DllStructSetData($tWCEX, 'MenuName', 0) DllStructSetData($tWCEX, 'ClassName', DllStructGetPtr($tWCEX, 'szClassName')) DllStructSetData($tWCEX, 'hIconSm', $hIconSm) DllStructSetData($tWCEX, 'szClassName', $sClass) ; Register a window class _WinAPI_RegisterClassEx($tWCEX) ; Create a window _WinAPI_CreateWindowEx(0, $sClass, $sName, BitOR($WS_CAPTION, $WS_POPUPWINDOW, $WS_VISIBLE), (@DesktopWidth - 400) / 2, (@DesktopHeight - 400) / 2, 400, 400, 0) _ArrayDisplay(WinList("[TITLE:NCRE服务器设置]")) ; 1 window _ArrayDisplay(WinList("[REGEXPTITLE:服务器设置]")) ; 0 window, why ? _ArrayDisplay(WinList("[REGEXPTITLE:服务器设置]")) ; 1 window _ArrayDisplay(WinList("[REGEXPTITLE:服务器设置]")) ; 0 windows, why ? _ArrayDisplay(WinList("[CLASS:WindowsForms10.Window.8.app.0.21373f6_r14_ad1]")) ; 1 window _ArrayDisplay(WinList("[REGEXPCLASS:21373f6_r14_ad1]")) ; 0 window, why ? _ArrayDisplay(WinList("[REGEXPCLASS:21373f6_r14_ad1]")) ; 0 window, why ? While 1 Sleep(100) If $g_bExit Then ExitLoop EndIf WEnd ; Unregister window class and release unnecessary resources _WinAPI_UnregisterClass($sClass, $hInstance) _WinAPI_DestroyCursor($hCursor) _WinAPI_DestroyIcon($hIcon) _WinAPI_DestroyIcon($hIconSm) DllCallbackFree($hProc) EndFunc ;==>_Example ; Func _WinAPI_DefWindowProcW($hWnd, $iMsg, $wParam, $lParam) ; Local $aRet = DllCall('user32.dll', 'lresult', 'DefWindowProcW', 'hwnd', $hWnd, 'uint', $iMsg, 'wparam', $wParam, 'lparam', $lParam) ; If @error Then ; Return SetError(1, 0, 0) ; EndIf ; Return $aRet[0] ; EndFunc ;==>_WinAPI_DefWindowProcW Func _WndProc($hWnd, $iMsg, $wParam, $lParam) Switch $iMsg Case $WM_CLOSE $g_bExit = True EndSwitch Return _WinAPI_DefWindowProcW($hWnd, $iMsg, $wParam, $lParam) EndFunc ;==>_WndProc iam ِAutoit programmer. best thing in life is to use your Brain to Achieve everything you want. Link to comment Share on other sites More sharing options...
pixelsearch Posted March 23, 2022 Share Posted March 23, 2022 @jpm: concerning this thread, I just read your answer in Trac ticket #3870 (opened by @ad777 as indicated in his post just above) : "For me, the script works the same for 3.3.14.5, 3.3.15.4, 3.3.15.5, 3.3.16.0" If it can help, here is what I experience with a simpler script, when launched from AutoIt 3.3.14.5 then 3.3.16.0 : #include <Array.au3> #include <GUIConstantsEx.au3> Example() Func Example() Local $sTitle = "example" Local $hGUI = GUICreate($sTitle, 200, 100) Local $idOK = GUICtrlCreateButton("OK", 60, 35, 80, 30) GUISetState(@SW_SHOW, $hGUI) While 1 Switch GUIGetMsg() Case $GUI_EVENT_CLOSE ExitLoop Case $idOK _ArrayDisplay(WinList("[REGEXPTITLE:example]"), @AutoItVersion) EndSwitch WEnd GUIDelete($hGUI) EndFunc ;==>Example RegExp changes were made recently, as indicated in the beta's change log. Maybe there's a link, maybe not : 3.3.15.6 (Unreleased) (Beta) AutoIt: - Fixed #3794: StringRegExp updated to not use a string copy internally. Hope it helps. Link to comment Share on other sites More sharing options...
jpm Posted March 23, 2022 Share Posted March 23, 2022 Thanks but I cannot reproduce it with your script ??? Link to comment Share on other sites More sharing options...
pixelsearch Posted March 23, 2022 Share Posted March 23, 2022 (edited) Then it could be a question of AutoIt version 32bits vs 64bits, or the OS version ? I'm using the oldest 32 bits OS version accepted by AutoIt. It won't be the 1st (or last time) that OS version shows different results, last issue in this link showed it clearly. Edit: assuming jpm got a 64bit OS (maybe that's why it works for him with 3.3.16.0), if anyone could test with a 32bit OS (win7 for example) + AutoIt v3.3.16.0 then it could help , especially when you read above the OS's & AutoIt versions used by OP & ad777 during their tests. @Musashi or @ad777 : could you please try this on your computers win 7 32bit ? * download AutoIt zip file 3.3.16.0 (the one without installer +++), it's name is "autoit-v3.3.16.zip" (17M) * unpack it in any new folder you like, then enter Scite folder, click SciTE.exe and run the script (from my last post) directly from Scite 3.3.16.0 (i.e. no double click on a .au3 file or it will open in your usual AutoIt version) This is how I tried it and It won't do any harm to your present AutoIt installation. It could help to make sure the issue appears with a win7 32bits OS + 3.3.16.0 Thanks Edited March 23, 2022 by pixelsearch 1 edit comment added Link to comment Share on other sites More sharing options...
ad777 Posted March 23, 2022 Share Posted March 23, 2022 (edited) 1 hour ago, pixelsearch said: @Musashi or @ad777 : could you please try this on your computers win 7 32bit ? * download AutoIt zip file 3.3.16.0 (the one without installer +++), it's name is "autoit-v3.3.16.zip" (17M) * unpack it in any new folder you like, then enter Scite folder, click SciTE.exe and run the script (from my last post) directly from Scite 3.3.16.0 (i.e. no double click on a .au3 file or it will open in your usual AutoIt version) This is how I tried it and It won't do any harm to your present AutoIt installation. It could help to make sure the issue appears with a win7 32bits OS + 3.3.16.0 Thanks Edited March 23, 2022 by ad777 iam ِAutoit programmer. best thing in life is to use your Brain to Achieve everything you want. Link to comment Share on other sites More sharing options...
argumentum Posted March 23, 2022 Share Posted March 23, 2022 (edited) AMD ( CPU ), XP 32bit vm, 3.3.14.5 = OK, 3.3.16.0 = FAILED ..installing a XP 64 bit. Will see if is a 64 vs 32 thing. Edited March 23, 2022 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...
pixelsearch Posted March 23, 2022 Share Posted March 23, 2022 @ad777 & @argumentum : Thank you guys for the test, your results will certainly be useful to jpm & jon. If I understand well : 1) It always works when AutoIt < 3.3.16.0, no matter the OS (32/64bits) 2) If AutoIt 3.3.16.0, then : * win XP 32 bits => issue * Win 7 32 bits => issue * Win 7 64 bits => ok * Other OS's (could be same : ok for 64 bits, not ok for 32 bits) Link to comment Share on other sites More sharing options...
mLipok Posted March 23, 2022 Share Posted March 23, 2022 (edited) is this related to:https://www.autoitscript.com/trac/autoit/ticket/3870 ? regexptitle and regexpclass should be somehow fixed in the comming Au3.3.16.1 (Hope soon). It is quite possible that it is fixed but waitng for realease: https://www.autoitscript.com/trac/autoit/ticket/3866 Edited March 23, 2022 by mLipok argumentum 1 Signature beginning:* Please remember: "AutoIt"..... * Wondering who uses AutoIt and what it can be used for ? * Forum Rules ** ADO.au3 UDF * POP3.au3 UDF * XML.au3 UDF * IE on Windows 11 * How to ask ChatGPT for AutoIt Code * for other useful stuff click the following button: Spoiler Any of my own code posted anywhere on the forum is available for use by others without any restriction of any kind. My contribution (my own projects): * Debenu Quick PDF Library - UDF * Debenu PDF Viewer SDK - UDF * Acrobat Reader - ActiveX Viewer * UDF for PDFCreator v1.x.x * XZip - UDF * AppCompatFlags UDF * CrowdinAPI UDF * _WinMergeCompare2Files() * _JavaExceptionAdd() * _IsBeta() * Writing DPI Awareness App - workaround * _AutoIt_RequiredVersion() * Chilkatsoft.au3 UDF * TeamViewer.au3 UDF * JavaManagement UDF * VIES over SOAP * WinSCP UDF * GHAPI UDF - modest begining - comunication with GitHub REST API * ErrorLog.au3 UDF - A logging Library * Include Dependency Tree (Tool for analyzing script relations) * Show_Macro_Values.au3 * My contribution to others projects or UDF based on others projects: * _sql.au3 UDF * POP3.au3 UDF * RTF Printer - UDF * XML.au3 UDF * ADO.au3 UDF * SMTP Mailer UDF * Dual Monitor resolution detection * * 2GUI on Dual Monitor System * _SciLexer.au3 UDF * SciTE - Lexer for console pane * Useful links: * Forum Rules * Forum etiquette * Forum Information and FAQs * How to post code on the forum * AutoIt Online Documentation * AutoIt Online Beta Documentation * SciTE4AutoIt3 getting started * Convert text blocks to AutoIt code * Games made in Autoit * Programming related sites * Polish AutoIt Tutorial * DllCall Code Generator * Wiki: * Expand your knowledge - AutoIt Wiki * Collection of User Defined Functions * How to use HelpFile * Good coding practices in AutoIt * OpenOffice/LibreOffice/XLS Related: WriterDemo.au3 * XLS/MDB from scratch with ADOX IE Related: * How to use IE.au3 UDF with AutoIt v3.3.14.x * Why isn't Autoit able to click a Javascript Dialog? * Clicking javascript button with no ID * IE document >> save as MHT file * IETab Switcher (by LarsJ ) * HTML Entities * _IEquerySelectorAll() (by uncommon) * IE in TaskScheduler * IE Embedded Control Versioning (use IE9+ and HTML5 in a GUI) * PDF Related: * How to get reference to PDF object embeded in IE * IE on Windows 11 * I encourage you to read: * Global Vars * Best Coding Practices * Please explain code used in Help file for several File functions * OOP-like approach in AutoIt * UDF-Spec Questions * EXAMPLE: How To Catch ConsoleWrite() output to a file or to CMD *I also encourage you to check awesome @trancexx code: * Create COM objects from modules without any demand on user to register anything. * Another COM object registering stuff * OnHungApp handler * Avoid "AutoIt Error" message box in unknown errors * HTML editor * winhttp.au3 related : * https://www.autoitscript.com/forum/topic/206771-winhttpau3-download-problem-youre-speaking-plain-http-to-an-ssl-enabled-server-port/ "Homo sum; humani nil a me alienum puto" - Publius Terentius Afer"Program are meant to be read by humans and only incidentally for computers and execute" - Donald Knuth, "The Art of Computer Programming" , be and \\//_. Anticipating Errors : "Any program that accepts data from a user must include code to validate that data before sending it to the data store. You cannot rely on the data store, ...., or even your programming language to notify you of problems. You must check every byte entered by your users, making sure that data is the correct type for its field and that required fields are not empty." Signature last update: 2023-04-24 Link to comment Share on other sites More sharing options...
argumentum Posted March 23, 2022 Share Posted March 23, 2022 (edited) XP 64 also failed. Let's wait for ..16.1 to see if that did it Note: 3.3.8.1 works fine as 64 and 32 autoit run in XP64bit SP2 Edited March 23, 2022 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...
pixelsearch Posted March 23, 2022 Share Posted March 23, 2022 Thank you guys for all these infos. Always great to help jpm as much as we can. Link to comment Share on other sites More sharing options...
Administrators Jon Posted March 23, 2022 Administrators Share Posted March 23, 2022 Try this: https://www.autoitscript.com/autoit3/files/beta/autoit/autoit-regexpclass-fix.zip This contains the regexpclass/title fixes that I'd done. pixelsearch 1 Deployment Blog: https://www.autoitconsulting.com/site/blog/ SCCM SDK Programming: https://www.autoitconsulting.com/site/sccm-sdk/ Link to comment Share on other sites More sharing options...
pixelsearch Posted March 24, 2022 Share Posted March 24, 2022 (edited) @Jon: yes it works fine now with beta 3.3.16.1, bravo You also fixed something else I asked you about. Thanks for that too, I'm gonna add a comment in the appropriate thread. Edited March 24, 2022 by pixelsearch Link to comment Share on other sites More sharing options...
argumentum Posted March 24, 2022 Share Posted March 24, 2022 (edited) all good in XP32SP3 and XP64SP2 ...and Win11 Edited March 24, 2022 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