Leaderboard
Popular Content
Showing content with the highest reputation on 05/04/2021 in all areas
-
Focus problem
seadoggie01 and one other reacted to Jos for a topic
I would call that Windows security and indeed isn't related to the FileStorage formatting.2 points -
AutoIt GUI Creators (Designers)
nguyentoannta3 reacted to TheSaint for a topic
As many of you may not be aware, of much about AutoIt's humble beginnings, and aspects related to the first GUI version of AutoIt, I thought it might be nice to create a historical reference here for all the many GUI creators that have been created by various people over the years. NOTE - While one could argue, that this topic might be better placed in one of the Chat forums, I would argue, that it links to heaps of good code. While much may be redundant in that code, it is still interesting and forms a great perspective. Many are bound to find useful elements at the very least. Koda, is no doubt the most well-known GUI creator now, but there was a time, when CyberSlug's legendary GUIBuilder (first known as AutoBuilder) ruled the roost, and AutoIt coder's saw it as a Godsend. AutoIt coding was much simpler back then of course. Below, will be a timeline, of any AutoIt GUI creators listed in forum pages. It will be added to by myself as I find them or as others here find them and place a link in a subsequent post ... PLEASE HELP! Comments welcome too. (Also note, that this is also intended to include updates, branches etc by others) Apr 20 2004 - AutoBuilder by CyberSlug. Sep 27 2004 - An interesting topic, where CyberSlug talks about the future of AutoBuilder (etc) and renaming to GUIBuilder and you see the first mentions and links to updates by others (including myself & livewire). Nov 05 2004 - A topic where lookfar is working on a SciTE replacement, talks about starting a Form Designer. Aug 10 2005 - GuiBuilder first update by TheSaint. Sep 26 2005 - GUIBuilder updates by livewire (he also talks about transferring his efforts to Koda). Nov 02 2005 - KODA FormDesigner v1.3 by lookfar Nov 03 2005 - Seemingly interesting topic about forms by tonedeaf Dec 26 2005 - AutoIt Studio(beta) by BillLuvsU Jan 09 2006 - AutoBuilder update (or branch) by _^__darkbytez (livewire also posts). Feb 19 2006 - Koda v1.5 by lookfar Sep 07 2006 - Koda v1.7.3.0 by Lazycat Jan 07 2007 - Form/GUI Builder by FlintBrenick Jun 10 2007 - Gorganizer by _Kurt (more of an assister than actual GUI maker) Jun 27 2007 - Basic GUI Designer by Mast3rpyr0 May 03 2008 - Autoit Programmer's Desktop (APD) by Ealric Jul 11 2008 - Gui Designer by Alek Aug 11 2008 - Gorganizer update by _Kurt Jun 19 2009 - Easy GUI by Mat Aug 13 2009 - GUI Script Creator by Pandemic (not sure this qualifies, but it made me think of templates) Aug 16 2010 - Creation Gui by AZJIO Jan 22 2012 - ISN AutoIt Studio by ISI360 (includes ISN Form Studio 2, a GUI editor) Mar 19 2012 - Arduino GUI Programmer by nikosliapis (creates a specific type of GUI) Aug 01 2012 - GuiBuilder Resurrected update/branch to GUIBuilder by baroquebob Dec 01 2012 - Form Builder beta (v1.0.6) by BuckMaster Jan 12 2015 - GUIBuilderNxt update by jaberwacky of GUIBuilder v0.8 (as a new prototype, modified to work with latest AutoIt) (not a update to the Resurrected version) Aug 12 2016 - The GuiBuilder Return by DFerrato as an update to GUIBuilder, Jan 17 2017 - GUIBuilder Project by TheSaint (a work in progress based on CyberSlug's original ... and later versions, updated by Roy, TheSaint & others). May 29 2019 - The GuiBuilder Return by DFerrato as an update to GUIBuilder, His new and improved version. May 9 2022 - GuiBuilderPlus by kurtykurtyboy as an update to GUIBuilder. A new an improved version with more to come. There are a significant number of creators/designers that have been started and never completed. +++++ STILL UNDER CONSTRUCTION +++++ P.S. Well that's it from me tonight. I know of at least one other major creator, but cannot recall it's name or the name of the coder, though I think it starts with 'L'. Bound to be a few I've missed, and some I cannot seem to find their first appearance here (Koda, Form Builder, etc), but there may be an obvious reason for that. Will probably rely on feedback from others now that I've got the ball rolling. NOTE - If anyone wants to discuss any of these programs above or give some background history, then by all means do so. I will cross-reference (link to) any important comments.1 point -
Au3Check - Misses Error
seadoggie01 reacted to Jos for a topic
Did you also try the Beta version of au3Check? (Not sure which one is in the installer) This issue is already fixed in the version I use in Beta AU3Check (3.3.15.42).1 point -
WebDriver UDF - Help & Support (III)
ThomasBennett reacted to Danp2 for a topic
@ThomasBennett You might be able to speed things up a bit by changing your call to _WD_WaitElement so that it returns the found element so that you don't need to call _WD_FindElement afterwards. It appears that you aren't using the latest UDF version, so you may want to update to benefit from the latest fixes. FYI, @mLipok has proposed a change here that may benefit you once it gets approved / merged.1 point -
I think I have found the problem. Try this : #include <Constants.au3> #include <WinAPIConv.au3> ;#RequireAdmin #Region ;**** Directives created by AutoIt3Wrapper_GUI **** ;#AutoIt3Wrapper_UseX64=y #EndRegion Test() Func Test() Local $sCommand = "powershell.exe Get-ChildItem | Format-List " Local $iPid = Run($sCommand, @WindowsDir, @SW_SHOW, $STDOUT_CHILD) ProcessWaitClose($iPid) Local $sOutput = StdoutRead($iPid) ConsoleWrite(_WinAPI_OemToCharEx($sOutput)) EndFunc Func _WinAPI_OemToCharEx($sStr) Local $aRet = DllCall('user32.dll', 'bool', 'OemToCharA', 'str', $sStr, 'str', '') If @error Or Not $aRet[0] Then Return SetError(@error + 10, @extended, '') Return $aRet[2] EndFunc ;==>_WinAPI_OemToChar1 point
-
IDK, you seem to have the latest versions. One thing is sure, AutoIt should not crash like that. How big is your $sOutput (StringLen) ? Unless, we can find a replicable snippet of the code, it is going to be very hard to propose a solution.1 point
-
I tested both on Win7 and Win10. Did not get this error. It means that AutoIt crashed. Do you have full Scite and the latest version ? What AutoIt version do you have ? Have you tried to MsgBox the output instead of ConsoleWrite ? I know you have solved your issue but there is something fishy with your config...1 point
-
[Solved] How to write special characters to SciTE Editor? - (Moved)
DannyJ reacted to argumentum for a topic
know your pipes !? "powershell.exe Get-ChildItem | Format-List" 'powershell.exe "Get-ChildItem | Format-List"' "powershell.exe ""Get-ChildItem | Format-List"""1 point -
String Seach with Multiple Scenarios
Musashi reacted to JockoDundee for a topic
@PnD, one thing that I was going to point out earlier when you commented about my code: was the, IMHO, this dependence may actually be an advantage, depending on factors that only you know. However, looking at the data-set you provided: DescriptionREMOTEOrder No :1028263Date Range: 04/19/2021!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!Appointment it appears to be some sort of order/invoice/service memo, with possibly multiple free-text fields, e.g. “Description”. Which allows for the possibility of a part#, a P.O. Number, phone number without punct., a previous order # cut and pasted from another record complete with the words “Order No:”. Which could mean relying on just digits, or even simply the single token “Order No:” might lead to misinterpretation. Moreover, this entered text could be hard to predict, if free-entry is allowed. On the other hand, if it can be confirmed that DateRange does indeed follow OrderNo, this would not change, barring a modification of the program or template that creates it. IMO, if this is not a one-off report, but something that runs periodically, you may want to use even more filters and sanitizers.1 point -
Referencing #AutoIt3Wrapper_Res_Fileversion within the script
Nine reacted to argumentum for a topic
ok, gloves off Global Const $VERSION = GetScriptFileVersion() ConsoleWrite('+++ $VERSION = ' & $VERSION & @TAB & ' - Type:' & @extended & ' - @ERROR: ' & @error & @CRLF) Func GetScriptFileVersion($sFullPath = @ScriptFullPath, $UsePRODUCTVERSION = 0) ; https://www.autoitscript.com/forum/index.php?showtopic=205775&view=findpost&p=1481216 Local $StrVersionType = $UsePRODUCTVERSION ? "PRODUCTVERSION" : "FILEVERSION" If Not FileGetSize($sFullPath) Then Return SetError(1, 0, "") If StringRight($sFullPath, 4) = ".exe" Then Return ValidFileVersionString(FileGetVersion($sFullPath, $StrVersionType)) If StringRight($sFullPath, 4) = ".au3" Then Local $sPragma = "", $sWrapper = "", $aTemp, $n, $aArray = StringSplit(FileRead($sFullPath, 8192), @CRLF) For $n = 1 To UBound($aArray) - 1 ; reading 8k header should be enough, I hope $aArray[$n] = StringStripWS($aArray[$n], 8) If StringInStr($aArray[$n], "#AutoIt3Wrapper_Res_" & $StrVersionType & "=") = 1 Then ; last "Fileversion" found is used $aTemp = StringSplit($aArray[$n], "=;") If UBound($aTemp) < 3 Then ContinueLoop ; if commented out ";#AutoIt3Wrapper..." or ";#pragma ...", skip $sWrapper = ValidFileVersionString($aTemp[2], Int(Not $UsePRODUCTVERSION)) EndIf If $sPragma = "" And StringInStr($aArray[$n], "#pragmacompile(" & $StrVersionType & ",") = 1 Then ; first "Fileversion" found is used $aTemp = StringSplit($aArray[$n], ",)") If UBound($aTemp) < 3 Then ContinueLoop $sPragma = ValidFileVersionString($aTemp[2], Int(Not $UsePRODUCTVERSION)) EndIf Next If $sPragma <> "" Then Return SetError(0, 1, $sPragma) ; pragma supersedes wrapper (as in "rock paper scissors") If $sWrapper <> "" Then Return SetError(0, 2, $sWrapper) Return SetError(2, 0, "") EndIf Return SetError(3, 0, "") EndFunc ;==>GetScriptFileVersion Func ValidFileVersionString($sStr, $iRedim = 1) Local $n, $sReturn = "", $aArray = StringSplit(StringReplace($sStr, ",", "."), ".", 2) If $iRedim Then ReDim $aArray[4] ; Not the wrapper, nor Aut2exe, will accept comma separated. For $n = 0 To UBound($aArray) -1 ; but could be used to get expected results. Ref.: https://www.autoitscript.com/forum/index.php?showtopic=205520 If $n Then $sReturn &= "." $sReturn &= Int($aArray[$n]) Next Return $sReturn EndFunc ;==>ValidFileVersionString ...what if, what if... . Modified to get FileVersion as default, and optionally ProductVersion.1 point -
Virtual listviews for huge number of rows
FrancescoDiMuro reacted to pixelsearch for a topic
Hi @Nine Based on your improvement, I added some code in your script to create temporary subindexes which will be useful to quickly sort partial results (asc then desc). Each subindex is created only when the user clicks a column and they all will be deleted when another partial result is requested. Additionnaly, a label field indicates how many matches have been found. Version is labeled "2g" Please report in case you find a bug or another improvement can be done. Thanks ! #include <EditConstants.au3> #include <GuiListView.au3> #include <GUIConstantsEx.au3> #include <StaticConstants.au3> #include <WindowsConstants.au3> #include "RandomArray.au3" ; LarsJ Opt("MustDeclareVars", 1) Global $g_iRows = 10000, $g_iCols = 6, $g_hListView, $g_iSortDir, $g_hEdit, $g_idEditSearch, $g_iSearch = $g_iRows Global $g_aArray, $g_aSubArray, $g_tDefaultIndex, $g_tIndex = DllStructCreate("uint arr[" & $g_iRows & "]") Global $g_aIndex[$g_iCols], $g_aIndexTemp[$g_iCols] ; VarGetType's : $g_aIndex => "Array", $g_aIndex[0] => "String" Example() Func Example() ; Generate main array & one index _Generate_All($g_aArray) $g_aSubArray = $g_aArray $g_tDefaultIndex = $g_tIndex ; Create GUI Local $hGui = GUICreate("Virtual ListView + Sort + Incremental search (2g)", 630 + 20, 788 + 30 + 20) ; Create Edit control GUICtrlCreateLabel("Search", 10, 10, 50, 20, BitOR($SS_CENTERIMAGE, $SS_CENTER)) Local $idEdit = GUICtrlCreateEdit("", 70, 10, 170, 20, BitXOR($GUI_SS_DEFAULT_EDIT, $WS_HSCROLL, $WS_VSCROLL)) $g_hEdit = GUICtrlGetHandle($idEdit) $g_idEditSearch = GUICtrlCreateDummy() ; Create Label control (number of matching results) Local $idResult = GUICtrlCreateLabel("", 260, 10, 350, 20, BitOR($SS_CENTERIMAGE, $SS_SUNKEN, $SS_NOPREFIX)) ; last one for "&" ; Create ListView Local $idListView = GUICtrlCreateListView("", 10, 40, 630, 788, $LVS_OWNERDATA, $WS_EX_CLIENTEDGE) _GUICtrlListView_SetExtendedListViewStyle($idListView, $LVS_EX_DOUBLEBUFFER + $LVS_EX_FULLROWSELECT) $g_hListView = GUICtrlGetHandle($idListView) Local $hHeader = _GUICtrlListView_GetHeader($idListView) Local $aCols = ["Strings", "Integers", "Floats", "Dates", "Times", "R/C"] Local $aWidths = [230, 60, 120, 70, 60, 60] For $i = 0 To $g_iCols - 1 _GUICtrlListView_AddColumn($idListView, $aCols[$i], $aWidths[$i]) Next ; Sorting information $g_iSortDir = 0x0400 ; $HDF_SORTUP Local $iColumn = -1, $iColumnPrev = -1 GUIRegisterMsg($WM_COMMAND, "WM_COMMAND") GUIRegisterMsg($WM_NOTIFY, "WM_NOTIFY") GUICtrlSendMsg($idListView, $LVM_SETITEMCOUNT, $g_iRows, 0) GUISetState(@SW_SHOW) While 1 Switch GUIGetMsg() Case $GUI_EVENT_CLOSE ExitLoop Case $g_idEditSearch _GUICtrlHeader_SetItemFormat($hHeader, $iColumn, $HDF_STRING) Local $sSearch = GUICtrlRead($idEdit) $g_tIndex = $g_tDefaultIndex If $sSearch = "" Then ; Empty search string, display all rows $g_aSubArray = $g_aArray $g_iSearch = $g_iRows Else ; Find rows matching the search string $g_iSearch = 0 For $i = 0 To $g_iRows - 1 ; If StringInStr( $g_aArray[$i][0], $sSearch ) Then ; Normal search If StringRegExp($g_aArray[$i][0], $sSearch) Then ; Reg. exp. search For $j = 0 To $g_iCols - 1 $g_aSubArray[$g_iSearch][$j] = $g_aArray[$i][$j] Next $g_iSearch += 1 EndIf Next ; Delete eventual temporary subindexes For $i = 0 To $g_iCols - 1 If VarGetType($g_aIndexTemp[$i]) = "DLLStruct" Then $g_aIndexTemp[$i] = "" ; "String" Next EndIf ; ConsoleWrite(StringFormat("%4d", $g_iSearch) & " rows matching """ & $sSearch & """" & @CRLF) GUICtrlSetData($idResult, ' ' & $g_iSearch & ' rows matching "' & $sSearch & '"') GUICtrlSendMsg($idListView, $LVM_SETITEMCOUNT, $g_iSearch, 0) Case $idListView ; Sort $iColumn = GUICtrlGetState($idListView) If $iColumn <> $iColumnPrev Then _GUICtrlHeader_SetItemFormat($hHeader, $iColumnPrev, $HDF_STRING) EndIf ; Set $g_tIndex + eventual update of $g_aIndexTemp[$iColumn] OR $g_aIndex[$iColumn] If GUICtrlRead($idEdit) Then _UpdateIndex($g_aIndexTemp, $iColumn) Else _UpdateIndex($g_aIndex, $iColumn) EndIf $g_iSortDir = (($iColumn = $iColumnPrev) ? ($g_iSortDir = $HDF_SORTUP ? $HDF_SORTDOWN : $HDF_SORTUP) : ($HDF_SORTUP)) _GUICtrlHeader_SetItemFormat($hHeader, $iColumn, $HDF_STRING + $g_iSortDir) GUICtrlSendMsg($idListView, $LVM_SETSELECTEDCOLUMN, $iColumn, 0) GUICtrlSendMsg($idListView, $LVM_SETITEMCOUNT, $g_iSearch, 0) $iColumnPrev = $iColumn EndSwitch WEnd ; Cleanup GUIDelete($hGui) EndFunc ;==>Example ;======================================================================== Func WM_NOTIFY($hWnd, $iMsg, $wParam, $lParam) Local $tNMHDR = DllStructCreate($tagNMHDR, $lParam) Switch HWnd(DllStructGetData($tNMHDR, "hWndFrom")) Case $g_hListView Switch DllStructGetData($tNMHDR, "Code") Case $LVN_GETDISPINFOW Local $tNMLVDISPINFO = DllStructCreate($tagNMLVDISPINFO, $lParam) Local Static $tText = DllStructCreate("wchar[50]"), $pText = DllStructGetPtr($tText) If $g_iSortDir = 0x0400 Then ; 0x0400 = $HDF_SORTUP DllStructSetData($tText, 1, $g_aSubArray[$g_tIndex.arr($tNMLVDISPINFO.Item + 1)][$tNMLVDISPINFO.SubItem]) Else DllStructSetData($tText, 1, $g_aSubArray[$g_tIndex.arr($g_iSearch - $tNMLVDISPINFO.Item)][$tNMLVDISPINFO.SubItem]) EndIf DllStructSetData($tNMLVDISPINFO, "Text", $pText) EndSwitch EndSwitch Return $GUI_RUNDEFMSG EndFunc ;==>WM_NOTIFY ;======================================================================== Func WM_COMMAND($hWnd, $iMsg, $wParam, $lParam) Local $hWndFrom = $lParam Local $iCode = BitShift($wParam, 16) ; High word Switch $hWndFrom Case $g_hEdit Switch $iCode Case $EN_CHANGE GUICtrlSendToDummy($g_idEditSearch) EndSwitch EndSwitch Return $GUI_RUNDEFMSG EndFunc ;==>WM_COMMAND ;======================================================================== Func _Generate_All(ByRef $g_aArray) ConsoleWrite("$g_iRows = " & $g_iRows & " $g_iCols = " & $g_iCols & @CRLF) Local $hTimer = TimerInit() $g_aArray = FAS_Random2DArrayAu3($g_iRows, "sifdtr", "abcdefghijklmnopqrstuvwxyz") For $i = 0 To $g_iRows - 1 $g_tIndex.arr($i + 1) = $i Next ConsoleWrite("Generating main array & one index = " & TimerDiff($hTimer) & @CRLF & @CRLF) EndFunc ;==>_Generate_All ;======================================================================== Func _SortArrayStruct(Const ByRef $aArray, $iCol, $iRows) Local $tIndex = DllStructCreate("uint arr[" & $iRows & "]") Local $pIndex = DllStructGetPtr($tIndex) Local Static $hDll = DllOpen("kernel32.dll") Local Static $hDllComp = DllOpen("shlwapi.dll") Local $lo, $hi, $mi, $r ; Sorting by one column For $i = 1 To $iRows - 1 $lo = 0 $hi = $i - 1 Do $mi = Int(($lo + $hi) / 2) $r = DllCall($hDllComp, 'int', 'StrCmpLogicalW', 'wstr', $aArray[$i][$iCol], 'wstr', $aArray[DllStructGetData($tIndex, 1, $mi + 1)][$iCol])[0] Switch $r Case -1 $hi = $mi - 1 Case 1 $lo = $mi + 1 Case 0 ExitLoop EndSwitch Until $lo > $hi DllCall($hDll, "none", "RtlMoveMemory", "struct*", $pIndex + ($mi + 1) * 4, "struct*", $pIndex + $mi * 4, "ulong_ptr", ($i - $mi) * 4) DllStructSetData($tIndex, 1, $i, $mi + 1 + ($lo = $mi + 1)) Next Return $tIndex EndFunc ;==>_SortArrayStruct ;======================================================================== Func _UpdateIndex(ByRef $aIndex, $iColumn) If VarGetType($aIndex[$iColumn]) = "DLLStruct" Then $g_tIndex = $aIndex[$iColumn] Else $g_tIndex = _SortArrayStruct($g_aSubArray, $iColumn, $g_iSearch) $aIndex[$iColumn] = $g_tIndex ; "DLLStruct" (or "Int32" when no match found +++) EndIf EndFunc ;==>_UpdateIndex Edit: Jpm's & Melba23's new _ArrayDisplay will indicate {Array} or {Map} when required in the display. To avoid a blank display, should {DLLStruct} be indicated too when needed ? Not sure, as all these additionals tests on {Array} , {Map} , {DLLStruct} before displaying each element in _ArrayDisplay may slow down a bit the whole process in case of huge arrays. Anyway... the question is asked.1 point -
Referencing #AutoIt3Wrapper_Res_Fileversion within the script
argumentum reacted to Nine for a topic
Perfecterer #Region ;**** Directives created by AutoIt3Wrapper_GUI **** #AutoIt3Wrapper_Res_FileVersion=2.3.4.5 ; test #AutoIt3Wrapper_Outfile_type=a3x #EndRegion ;**** Directives created by AutoIt3Wrapper_GUI **** #pragma compile(Out, Temp1.a3x) #pragma compile(Fileversion, 2.3.4.5) #include <Constants.au3> Const $VERSION = @Compiled ? FileGetVersion(@ScriptName) : StringRegExp(FileRead(@ScriptName),"(?i)#AutoIt3Wrapper_Res_Fileversion=(.*?)\h*[;|\v]", 1)[0] MsgBox ($MB_SYSTEMMODAL, "", $VERSION)1 point -
Does a registered WM_GETMINMAXINFO function need a "Return"?
argumentum reacted to Professor_Bernd for a topic
The idea to change a member of the struct only if a value greater than 0 was passed is indeed an interesting idea! 👍1 point -
Referencing #AutoIt3Wrapper_Res_Fileversion within the script
argumentum reacted to seadoggie01 for a topic
What is this magic number madness you call perfecter? Edit: Btw, yours both fail if the user capitalizes Version in #AutoIt3Wrapper_Res_FileVersion. But I like this!1 point -
#Region ;**** Directives created by AutoIt3Wrapper_GUI **** #AutoIt3Wrapper_Res_Fileversion=2.2.2.2 #EndRegion ;**** Directives created by AutoIt3Wrapper_GUI **** #include <Constants.au3> Const $VERSION = @Compiled ? FileGetVersion(@ScriptName) : StringRegExp(FileRead(@ScriptName),"#AutoIt3Wrapper_Res_Fileversion=(.*)", 1)[0] MsgBox ($MB_SYSTEMMODAL, "", $VERSION) This ?1 point
-
One more thing worth knowing is that if the sequence of digits you are looking for is of at least "6" and you know for a fact that this sequence is always longer than any other sequence elsewhere in the data. then it could also be done this way: Local $s = 'Description' _ & @LF & 'REMOTE: 12' _ & @LF & 'Order No : 1028263' _ & @LF & 'Date Range: 04/19/2021' Local $a = StringRegExp($s, "\d{6,}", 3) MsgBox(0, "", ($a ? "None Found" : $a[0]))1 point
-
Virtual listviews for huge number of rows
pixelsearch reacted to Nine for a topic
Hi @pixelsearch Hope you don't mind, but your script interpellated me. I was wondering if we could use struct for Sort index instead of array saving the time to transfer. Also if we could keep the struct for further reference instead of recreating it every time. Here what I ended up with (let me know what you think) : #include <Constants.au3> #include <EditConstants.au3> #include <GuiListView.au3> #include <GUIConstantsEx.au3> #include <StaticConstants.au3> #include <WindowsConstants.au3> #include "RandomArray.au3" ; LarsJ Opt("MustDeclareVars", 1) Global $g_iRows = 10000, $g_iCols = 6, $g_aArray, $g_aSubArray, $g_aIndex[$g_iRows], $g_tIndex = DllStructCreate("uint arr[" & $g_iRows & "]") Global $g_hListView, $g_hEdit, $g_idEditSearch, $g_iSortDir, $g_iSearch = $g_iRows, $g_aIndex[$g_iCols], $g_tDefaultIndex Example() Func Example() ; Generate Array & one index _Generate_All($g_aArray) $g_aSubArray = $g_aArray $g_tDefaultIndex = $g_tIndex ; Create GUI Local $hGui = GUICreate("Virtual ListView + Sort + Incremental search (2d)", 630 + 20, 788 + 30 + 20) ; Create Edit control GUICtrlCreateLabel("Search", 10, 10, 50, 20, BitOR($SS_CENTERIMAGE, $SS_CENTER)) Local $idEdit = GUICtrlCreateEdit("", 70, 10, 170, 20, BitXOR($GUI_SS_DEFAULT_EDIT, $WS_HSCROLL, $WS_VSCROLL)) $g_hEdit = GUICtrlGetHandle($idEdit) $g_idEditSearch = GUICtrlCreateDummy() ; Create ListView Local $idListView = GUICtrlCreateListView("", 10, 40, 630, 788, $LVS_OWNERDATA, $WS_EX_CLIENTEDGE) _GUICtrlListView_SetExtendedListViewStyle($idListView, $LVS_EX_DOUBLEBUFFER + $LVS_EX_FULLROWSELECT) $g_hListView = GUICtrlGetHandle($idListView) Local $hHeader = _GUICtrlListView_GetHeader($idListView) Local $aCols = ["Strings", "Integers", "Floats", "Dates", "Times", "R/C"] Local $aWidths = [230, 60, 120, 70, 60, 60] For $i = 0 To $g_iCols - 1 _GUICtrlListView_AddColumn($idListView, $aCols[$i], $aWidths[$i]) Next ; Sorting information $g_iSortDir = 0x0400 ; $HDF_SORTUP Local $iColumn = -1, $iColumnPrev = -1 GUIRegisterMsg($WM_COMMAND, "WM_COMMAND") GUIRegisterMsg($WM_NOTIFY, "WM_NOTIFY") GUICtrlSendMsg($idListView, $LVM_SETITEMCOUNT, $g_iRows, 0) GUISetState(@SW_SHOW) While 1 Switch GUIGetMsg() Case $GUI_EVENT_CLOSE ExitLoop Case $g_idEditSearch _GUICtrlHeader_SetItemFormat($hHeader, $iColumn, $HDF_STRING) Local $sSearch = GUICtrlRead($idEdit) $g_tIndex = $g_tDefaultIndex If $sSearch = "" Then ; Empty search string, display all rows $g_aSubArray = $g_aArray $g_iSearch = $g_iRows Else ; Find rows matching the search string $g_iSearch = 0 For $i = 0 To $g_iRows - 1 ; If StringInStr( $g_aArray[$i][0], $sSearch ) Then ; Normal search If StringRegExp($g_aArray[$i][0], $sSearch) Then ; Reg. exp. search For $j = 0 To $g_iCols - 1 $g_aSubArray[$g_iSearch][$j] = $g_aArray[$i][$j] Next $g_iSearch += 1 EndIf Next EndIf ConsoleWrite(StringFormat("%4d", $g_iSearch) & " rows matching """ & $sSearch & """" & @CRLF) GUICtrlSendMsg($idListView, $LVM_SETITEMCOUNT, $g_iSearch, 0) Case $idListView ; Sort $iColumn = GUICtrlGetState($idListView) If $iColumn <> $iColumnPrev Then _GUICtrlHeader_SetItemFormat($hHeader, $iColumnPrev, $HDF_STRING) EndIf If GUICtrlRead($idEdit) Then $g_tIndex = _SortArrayStruct($g_aSubArray, $iColumn, $g_iSearch) ElseIf VarGetType($g_aIndex[$iColumn]) = "DLLStruct" Then $g_tIndex = $g_aIndex[$iColumn] Else $g_tIndex = _SortArrayStruct($g_aSubArray, $iColumn, $g_iSearch) $g_aIndex[$iColumn] = $g_tIndex EndIf $g_iSortDir = (($iColumn = $iColumnPrev) ? ($g_iSortDir = $HDF_SORTUP ? $HDF_SORTDOWN : $HDF_SORTUP) : ($HDF_SORTUP)) _GUICtrlHeader_SetItemFormat($hHeader, $iColumn, $HDF_STRING + $g_iSortDir) GUICtrlSendMsg($idListView, $LVM_SETSELECTEDCOLUMN, $iColumn, 0) GUICtrlSendMsg($idListView, $LVM_SETITEMCOUNT, $g_iSearch, 0) $iColumnPrev = $iColumn EndSwitch WEnd ; Cleanup GUIDelete($hGui) EndFunc ;==>Example ;======================================================================== Func WM_NOTIFY($hWnd, $iMsg, $wParam, $lParam) Local $tNMHDR = DllStructCreate($tagNMHDR, $lParam) Switch HWnd(DllStructGetData($tNMHDR, "hWndFrom")) Case $g_hListView Switch DllStructGetData($tNMHDR, "Code") Case $LVN_GETDISPINFOW Local $tNMLVDISPINFO = DllStructCreate($tagNMLVDISPINFO, $lParam) Local Static $tText = DllStructCreate("wchar[50]"), $pText = DllStructGetPtr($tText) If $g_iSortDir = 0x0400 Then ; 0x0400 = $HDF_SORTUP DllStructSetData($tText, 1, $g_aSubArray[$g_tIndex.arr($tNMLVDISPINFO.Item + 1)][$tNMLVDISPINFO.SubItem]) Else DllStructSetData($tText, 1, $g_aSubArray[$g_tIndex.arr($g_iSearch - $tNMLVDISPINFO.Item)][$tNMLVDISPINFO.SubItem]) EndIf DllStructSetData($tNMLVDISPINFO, "Text", $pText) EndSwitch EndSwitch Return $GUI_RUNDEFMSG EndFunc ;==>WM_NOTIFY ;======================================================================== Func WM_COMMAND($hWnd, $iMsg, $wParam, $lParam) Local $hWndFrom = $lParam Local $iCode = BitShift($wParam, 16) ; High word Switch $hWndFrom Case $g_hEdit Switch $iCode Case $EN_CHANGE GUICtrlSendToDummy($g_idEditSearch) EndSwitch EndSwitch Return $GUI_RUNDEFMSG EndFunc ;==>WM_COMMAND ;======================================================================== Func _Generate_All(ByRef $g_aArray) ConsoleWrite("$g_iRows = " & $g_iRows & " $g_iCols = " & $g_iCols & @CRLF) Local $hTimer = TimerInit() $g_aArray = FAS_Random2DArrayAu3($g_iRows, "sifdtr", "abcdefghijklmnopqrstuvwxyz") For $i = 0 To $g_iRows - 1 $g_tIndex.arr($i + 1) = $i Next ConsoleWrite("Generating array & one index = " & TimerDiff($hTimer) & @CRLF & @CRLF) EndFunc ;==>_Generate_All ;======================================================================== Func _SortArrayStruct(Const ByRef $aArray, $iCol, $iRows) Local $tIndex = DllStructCreate("uint arr[" & $iRows & "]") Local $pIndex = DllStructGetPtr($tIndex) Local Static $hDll = DllOpen("kernel32.dll") Local Static $hDllComp = DllOpen("shlwapi.dll") Local $lo, $hi, $mi, $r ; Sorting by one column For $i = 1 To $iRows - 1 $lo = 0 $hi = $i - 1 Do $mi = Int(($lo + $hi) / 2) $r = DllCall($hDllComp, 'int', 'StrCmpLogicalW', 'wstr', $aArray[$i][$iCol], 'wstr', $aArray[DllStructGetData($tIndex, 1, $mi + 1)][$iCol])[0] Switch $r Case -1 $hi = $mi - 1 Case 1 $lo = $mi + 1 Case 0 ExitLoop EndSwitch Until $lo > $hi DllCall($hDll, "none", "RtlMoveMemory", "struct*", $pIndex + ($mi + 1) * 4, "struct*", $pIndex + $mi * 4, "ulong_ptr", ($i - $mi) * 4) DllStructSetData($tIndex, 1, $i, $mi + 1 + ($lo = $mi + 1)) Next Return $tIndex EndFunc ;==>_SortArrayStruct1 point -
@caramen WinWaitActive will wait forever unless you put a timeout. So using in a loop is useless the way you are doing it. @Tee The best way to debug an inconsistent program is to put error handling (check for return values and @error) after each and every single statement. That way you can follow the path used by your script and understand what is going on when it failed. I also highly recommend using control handle instead of its CLASSNN. It allows you to verify with au3info.exe tool if you have the right handle.1 point
-
To feet to your question directly. I would suggest you to use WinWaitActive. And then ControlClick immediately after. Here is a shot of this : $myReturn = WinWaitActive ( "title" [, "text" [, timeout = 0]] ) If $myReturn = 0 Then MsgBox ( 0 , "Windows not found" , "The requested windows was not found in the provided timeout" ) Else Sleep (20) ControlClick ( "title", "text", controlID [, button = "left" [, clicks = 1 [, x [, y]]]] ) EndIf Another good way if you are 100% sure of the reliability of your script would be to use a while like that : Do $myReturn = WinWaitActive ( "title" , ""[, timeout = 0] ) Until $myReturn <> 0 Edit : thx @Nine1 point
-
[Solved] How to write special characters to SciTE Editor? - (Moved)
DannyJ reacted to argumentum for a topic
#include <AutoItConstants.au3> #include <WinAPIConv.au3> Test() Func Test() Local $sPath = @TempDir & "\GetChildItemTest" DirCreate($sPath) Local $sFileName = "Test " & Chr(250) & ".txt" ; some characters you'd like to test out ConsoleWrite(@CRLF & '>' & $sFileName & '<' & @CRLF) FileWriteLine($sPath & "\" & $sFileName, "Test") Local $sCommand = "powershell.exe Get-ChildItem -Path " & $sPath Local $iPid = Run($sCommand, @DesktopDir, @SW_SHOW, $STDOUT_CHILD) ProcessWaitClose($iPid) Local $sOutput = StdoutRead($iPid) ConsoleWrite(_WinAPI_OemToChar($sOutput)) ; @nine's solution ;~ DirRemove($sPath, 1) EndFunc1 point -
[Solved] How to write special characters to SciTE Editor? - (Moved)
DannyJ reacted to argumentum for a topic
#include <AutoItConstants.au3> Test() Func Test() Local $sPath = @TempDir & "\GetChildItemTest" DirCreate($sPath) Local $sFileName = "Test " & Chr(250) & ".txt" ; some characters you'd like to test out ConsoleWrite(@CRLF & '>' & $sFileName & '<' & @CRLF) FileWriteLine($sPath & "\" & $sFileName, "Test") Local $sCommand = "powershell.exe Get-ChildItem -Path " & $sPath Local $iPid = Run($sCommand, @DesktopDir, @SW_SHOW, $STDOUT_CHILD) ProcessWaitClose($iPid) Local $sOutput = StdoutRead($iPid) ConsoleWrite($sOutput) ;~ DirRemove($sPath, 1) EndFunc ...better snippet1 point -
Please post a script containing the offending characters so we can test with that as your example script obviously doesn't give the same result for us.1 point
-
Using AutoIT for visual pattern recognition
argumentum reacted to CognitiveReasoning for a topic
Thanks M23, your handle reminds me of Messier 23. I envision the user tapping or using a mouse to click on the object they identify as family--a family version of "Where is Waldo" for a portion of the application. But to achieve this from a decoupled testing perspective, I need to parse the resulting image (which may have portions of the family member deliberately obscured) and have my scripting code attempt to identify it, itself. If I knew where the image was, to begin with, which I would know from a coding perspective, I do not believe I could be sure that the family member's rendered image was discernible. I do appreciate the conversation; thanks much for your time. -Ed1 point -
Version 5.1
8,849 downloads
Features: Create modern looking borderless and resizable GUIs with control buttons (Close,Maximize/Restore,Minimize, Fullscreen, Menu) True borderless, resizeable GUI with full support for aerosnap etc. Many color schemes/themes included. See MetroThemes.au3 for more details. 2 type of Windows 8/10 style buttons. Modern checkboxes, radios, toggles and progressbar. All buttons, checkboxes etc. have hover effects! Windows 10 style modern MsgBox. Windows 10/Android style menu that slides in from left.1 point -
Borderless GUI without WS_POPUP, with Drag, Resize and working AeroSnap
Professor_Bernd reacted to BBs19 for a topic
So i needed a way of creating borderless resizable, dragable GUIs while maintaining the AeroSnap(or whatever it is called now) functionality of Windows. The problem was that creating $WS_POPUP GUIs killed the AeroSnap functionality of Windows, it also caused @SW_Maximize to go fullscreen instead of just maximizing. I found some examples of borderless GUIs for C++, the solution was really easy: WM_NCCALCSIZE I have collected some other examples of resizing and dragging borderless GUIs, tweaked them a and wrote a simple to use UDF with easy usage with just one line: _GUI_EnableDragAndResize($Form1) Example with UDF: #include <Windowsconstants.au3> #include <WinAPIGdi.au3> Global $GLOBAL_MAIN_GUI, $Win_Min_ResizeX = 145, $Win_Min_ResizeY = 45 #region Example $Form1 = GUICreate("Example GUI", 300, 150, -1, -1, BitOR($WS_SIZEBOX, $WS_MINIMIZEBOX, $WS_MAXIMIZEBOX)) GUISetBkColor(0x282828, $Form1) _GUI_EnableDragAndResize($Form1,300, 150) $Button1 = GUICtrlCreateButton("Exit", 90, 60, 120, 30) GUICtrlSetResizing(-1, 768 + 8 + 128) GUISetState(@SW_SHOW) While 1 $Msg = GUIGetMsg() Switch $Msg Case -3, $Button1 Exit EndSwitch #cs uncomment this if you have a very large listview or any other control that is very close to the gui borders, this makes sure the resize cursor gets reset properly. If WinActive($Form1) Then Local $mgetinfo = MouseGetCursor(), $aMouseInfo = GUIGetCursorInfo($Form1) If ($mgetinfo = 12) Or ($mgetinfo = 11) Or ($mgetinfo = 10) Or ($mgetinfo = 13) Then If Not ($aMouseInfo[4] = 0) Then GUISetCursor(2, 1) EndIf EndIf #ce WEnd #endregion Example ; #FUNCTION# ==================================================================================================================== ; Name ..........: _GUI_EnableDragAndResize ; Compatibility .: Windows 7 and above. Not tested on XP. ; Description ...: Removes the Borders of a GUI, allows drag and resize while keeping the AeroSnap features of Windows still working with the GUI ; Warning .......: Can only be called for one GUI, if you call if for a second GUI, you have to call _GUI_DragAndResizeUpdate($Form1) it for the first GUI after closing the second GUI. ; Syntax ........: _GUI_EnableDragAndResize($mGUI, $GUI_WIDTH, $GUI_HEIGHT [, $Min_ResizeX = $Win_Min_ResizeX[, $Min_ResizeY = $Win_Min_ResizeY[, ; $AddShadowEffect = True]]]) ; Parameters ....: $mGUI - Handle to your GUI. ; $GUI_WIDTH - The width of the GUI. (Required to fix the wrong size after removing borders) ; $GUI_HEIGHT - The height of the GUI. (Required to fix the wrong size after removing borders) ; $Min_ResizeX - [optional] Min size of the GUI. Default is 145 ; $Min_ResizeY - [optional] Max size of the GUI. Default is 45 ; $$AddShadowEffect - [optional] Adds shadow effect that looks like a thin border. Works only with Aero-Effects enabled. Default is False ; Author ........: BB_19 ; Credits .......: https://www.autoitscript.com/wiki/Moving_and_Resizing_PopUp_GUIs ; Example .......: _GUI_EnableDragAndResize($Form1,300,200) ; =============================================================================================================================== Func _GUI_EnableDragAndResize($mGUI, $GUI_WIDTH, $GUI_HEIGHT, $Min_ResizeX = $Win_Min_ResizeX, $Min_ResizeY = $Win_Min_ResizeY, $AddShadowEffect = False) Global $GLOBAL_MAIN_GUI = $mGUI, $Win_Min_ResizeX = $Min_ResizeX, $Win_Min_ResizeY = $Min_ResizeY GUIRegisterMsg(0x0024, "INTERNAL_WM_GETMINMAXINFO") ; For GUI size limits GUIRegisterMsg(0x0084, "INTERNAL_WM_NCHITTEST") ; For resizing and to allow doubleclick to maximize and drag on the upper GUI. GUIRegisterMsg(0x0083, "INTERNAL_WM_NCCALCSIZE") ; To Prevent window border from drawing GUIRegisterMsg(0x0201, "INTERNAL_WM_LBUTTONDOWN") ; For drag/GUI moving. Disable this if you want to only a specific the area for dragging.(By using labels with $GUI_WS_EX_PARENTDRAG) GUIRegisterMsg(0x0005, "INTERNAL_WM_SIZING") ; Fixing the maxmized position (otherwise we have a -7px margin on all sides due to the missing border) GUIRegisterMsg(0x0086, "INTERNAL_WM_NCACTIVATE") ; Prevent Windowframe from redrawing when window goes inactive If $AddShadowEffect = True Then Local $tMargs = DllStructCreate("int cxLeftWidth;int cxRightWidth;int cyTopHeight;int cyBottomHeight") DllStructSetData($tMargs, 1, 1) DllStructSetData($tMargs, 2, 1) DllStructSetData($tMargs, 3, 1) DllStructSetData($tMargs, 4, 1) DllCall("dwmapi.dll", "int", "DwmExtendFrameIntoClientArea", "hwnd", $mGUI, "ptr", DllStructGetPtr($tMargs)) EndIf WinMove($mGUI, "", Default, Default, $GUI_WIDTH, $GUI_HEIGHT);Update Size and EndFunc ;==>_GUI_EnableDragAndResize ;Update drag and resize for your first GUI after using _GUI_EnableDragAndResize on a second GUI. Func _GUI_DragAndResizeUpdate($mGUI, $Min_ResizeX = $Win_Min_ResizeX, $Min_ResizeY = $Win_Min_ResizeY) Global $GLOBAL_MAIN_GUI = $mGUI, $Win_Min_ResizeX = $Min_ResizeX, $Win_Min_ResizeY = $Min_ResizeY GUIRegisterMsg(0x0024, "INTERNAL_WM_GETMINMAXINFO") GUIRegisterMsg(0x0084, "INTERNAL_WM_NCHITTEST") GUIRegisterMsg(0x0083, "INTERNAL_WM_NCCALCSIZE") GUIRegisterMsg(0x0201, "INTERNAL_WM_LBUTTONDOWN") GUIRegisterMsg(0x0005, "INTERNAL_WM_SIZING") GUIRegisterMsg(0x0086, "INTERNAL_WM_NCACTIVATE") EndFunc ;==>_GUI_EnableDragAndResizeUpdate ;Prevent Borders from redrawing when window goes inactive Func INTERNAL_WM_NCACTIVATE($hWnd, $iMsg, $wParam, $lParam) If ($hWnd = $GLOBAL_MAIN_GUI) Then Return -1 EndFunc ;==>INTERNAL_WM_NCACTIVATE ;Fix maximized position Func INTERNAL_WM_SIZING($hWnd, $iMsg, $wParam, $lParam) If ($hWnd = $GLOBAL_MAIN_GUI) Then If (WinGetState($GLOBAL_MAIN_GUI) = 47) Then Local $WorkingSize = _GetDesktopWorkArea($GLOBAL_MAIN_GUI) Local $aWinPos = WinGetPos($GLOBAL_MAIN_GUI) _WinAPI_SetWindowPos($GLOBAL_MAIN_GUI, $HWND_TOP, $aWinPos[0] - 1, $aWinPos[1] - 1, $WorkingSize[2], $WorkingSize[3], $SWP_NOREDRAW) EndIf EndIf EndFunc ;==>INTERNAL_WM_SIZING ; Set min and max GUI sizes Func INTERNAL_WM_GETMINMAXINFO($hWnd, $iMsg, $wParam, $lParam) $tMinMaxInfo = DllStructCreate("int;int;int;int;int;int;int;int;int;dword", $lParam) Local $WorkingSize = _GetDesktopWorkArea($GLOBAL_MAIN_GUI) ;Prevent Windows from misplacing the GUI when maximized, due to missing borders. DllStructSetData($tMinMaxInfo, 3, $WorkingSize[2]) DllStructSetData($tMinMaxInfo, 4, $WorkingSize[3]) DllStructSetData($tMinMaxInfo, 5, $WorkingSize[0] + 1) DllStructSetData($tMinMaxInfo, 6, $WorkingSize[1] + 1) ;Min Size limits DllStructSetData($tMinMaxInfo, 7, $Win_Min_ResizeX) DllStructSetData($tMinMaxInfo, 8, $Win_Min_ResizeY) Return 0 EndFunc ;==>INTERNAL_WM_GETMINMAXINFO ;Stop drawing GUI Borders Func INTERNAL_WM_NCCALCSIZE($hWnd, $Msg, $wParam, $lParam) If $hWnd = $GLOBAL_MAIN_GUI Then Return 0 EndIf Return 'GUI_RUNDEFMSG' EndFunc ;==>INTERNAL_WM_NCCALCSIZE ;Set mouse cursor for resizing etc. / Allow the upper GUI (40 pixel from top) to act as a control bar (doubleclick to maximize, move gui around..) Func INTERNAL_WM_NCHITTEST($hWnd, $uMsg, $wParam, $lParam) If ($hWnd = $GLOBAL_MAIN_GUI) Then Local $iSide = 0, $iTopBot = 0, $CurSorInfo Local $mPos = MouseGetPos() Local $aWinPos = WinGetPos($GLOBAL_MAIN_GUI) Local $aCurInfo = GUIGetCursorInfo($GLOBAL_MAIN_GUI) ;Check if Mouse is over Border, Margin = 5 If Not @error Then If $aCurInfo[0] < 5 Then $iSide = 1 If $aCurInfo[0] > $aWinPos[2] - 5 Then $iSide = 2 If $aCurInfo[1] < 5 Then $iTopBot = 3 If $aCurInfo[1] > $aWinPos[3] - 5 Then $iTopBot = 6 $CurSorInfo = $iSide + $iTopBot Else $CurSorInfo = 0 EndIf ;Set position for drag and doubleclick to maximize $xMIN = $aWinPos[0] + 4 $xMAX = $aWinPos[0] + $aWinPos[2] - 4 $yMIN = $aWinPos[1] + 4 $yMAX = $aWinPos[1] + 40 If ($mPos[0] >= $xMIN) And ($mPos[0] <= $xMAX) And ($mPos[1] >= $yMIN) And ($mPos[1] <= $yMAX) Then GUISetCursor(2, 1) Return 2; Return $HTCAPTION if mouse is within the position for drag + doubleclick to maximize EndIf If Not (WinGetState($GLOBAL_MAIN_GUI) = 47) Then ;Set resize cursor and return the correct $HT for gui resizing If ($aCurInfo[4] = 0) Then Local $Return_HT = 2, $Set_Cursor = 2 Switch $CurSorInfo Case 1 $Set_Cursor = 13 $Return_HT = 10 Case 2 $Set_Cursor = 13 $Return_HT = 11 Case 3 $Set_Cursor = 11 $Return_HT = 12 Case 4 $Set_Cursor = 12 $Return_HT = 13 Case 5 $Set_Cursor = 10 $Return_HT = 14 Case 6 $Set_Cursor = 11 $Return_HT = 15 Case 7 $Set_Cursor = 10 $Return_HT = 16 Case 8 $Set_Cursor = 12 $Return_HT = 17 EndSwitch GUISetCursor($Set_Cursor, 1) If Not ($Return_HT = 2) Then Return $Return_HT EndIf EndIf EndIf Return 'GUI_RUNDEFMSG' EndFunc ;==>INTERNAL_WM_NCHITTEST ; Allow drag with mouse left button down Func INTERNAL_WM_LBUTTONDOWN($hWnd, $iMsg, $wParam, $lParam) If ($hWnd = $GLOBAL_MAIN_GUI) Then If Not (WinGetState($GLOBAL_MAIN_GUI) = 47) Then Local $aCurInfo = GUIGetCursorInfo($GLOBAL_MAIN_GUI) If ($aCurInfo[4] = 0) Then ; Mouse not over a control DllCall("user32.dll", "int", "ReleaseCapture") DllCall("user32.dll", "long", "SendMessage", "hwnd", $GLOBAL_MAIN_GUI, "int", 0x00A1, "int", 2, "int", 0) EndIf EndIf EndIf EndFunc ;==>INTERNAL_WM_LBUTTONDOWN ; #FUNCTION# ==================================================================================================================== ; Name ..........: _GetDesktopWorkArea ; Description ...: Calculate the desktop workarea for a specific window to maximize it. Supports multi display and taskbar detection. ; Syntax ........: _GetDesktopWorkArea($hWnd) ; Parameters ....: $hWnd - Handle to the window. ; Return values .: Array in following format: ; : [0] = X-Pos for maximizing ; : [1] = Y-Pos for maximizing ; : [2] = Max. Width ; : [3] = Max. Height ; Author ........: BB_19 ; Note ..........: The x/y position is not the real position of the window if you have multi display. It is just for setting the maximize info for WM_GETMINMAXINFO ; =============================================================================================================================== Func _GetDesktopWorkArea($hWnd) Local $MonitorSizePos[4], $MonitorNumber = 1 $MonitorSizePos[0] = 0 $MonitorSizePos[1] = 0 $MonitorSizePos[2] = @DesktopWidth $MonitorSizePos[3] = @DesktopHeight ;Get Monitors Local $aPos, $MonitorList = _WinAPI_EnumDisplayMonitors() If @error Then Return $MonitorSizePos If IsArray($MonitorList) Then ReDim $MonitorList[$MonitorList[0][0] + 1][5] For $i = 1 To $MonitorList[0][0] $aPos = _WinAPI_GetPosFromRect($MonitorList[$i][1]) For $j = 0 To 3 $MonitorList[$i][$j + 1] = $aPos[$j] Next Next EndIf ;Check on which monitor our window is Local $GUI_Monitor = _WinAPI_MonitorFromWindow($hWnd) ;Check on which monitor the taskbar is Local $Taskbar_Monitor = _WinAPI_MonitorFromWindow(WinGetHandle("[CLASS:Shell_TrayWnd]")) ;Write the width and height info of the correct monitor into an array For $iM = 1 To $MonitorList[0][0] Step +1 If $MonitorList[$iM][0] = $GUI_Monitor Then $MonitorSizePos[0] = 0 $MonitorSizePos[1] = 0 $MonitorSizePos[2] = $MonitorList[$iM][3] $MonitorSizePos[3] = $MonitorList[$iM][4] $MonitorNumber = $iM EndIf Next ;Check if Taskbar autohide is enabled, if so then we will remove 1px from the correct side so that the taskbar will reapear when moving mouse to the side Local $TaskBarAutoHide = DllCall("shell32.dll", "int", "SHAppBarMessage", "int", 0x00000004, "ptr*", 0) If Not @error Then $TaskBarAutoHide = $TaskBarAutoHide[0] Else $TaskBarAutoHide = 0 EndIf ;Check if Taskbar is on this Monitor, if so, then recalculate the position, max. width and height of the WorkArea If $Taskbar_Monitor = $GUI_Monitor Then $TaskBarPos = WinGetPos("[CLASS:Shell_TrayWnd]") If @error Then Return $MonitorSizePos ;Win 7 classic theme compatibility If ($TaskBarPos[0] = $MonitorList[$MonitorNumber][1] - 2) Or ($TaskBarPos[1] = $MonitorList[$MonitorNumber][2] - 2) Then $TaskBarPos[0] = $TaskBarPos[0] + 2 $TaskBarPos[1] = $TaskBarPos[1] + 2 $TaskBarPos[2] = $TaskBarPos[2] - 4 $TaskBarPos[3] = $TaskBarPos[3] - 4 EndIf If ($TaskBarPos[0] = $MonitorList[$MonitorNumber][1] - 2) Or ($TaskBarPos[1] = $MonitorList[$MonitorNumber][2] - 2) Then $TaskBarPos[0] = $TaskBarPos[0] + 2 $TaskBarPos[1] = $TaskBarPos[1] + 2 $TaskBarPos[2] = $TaskBarPos[2] - 4 $TaskBarPos[3] = $TaskBarPos[3] - 4 EndIf ;Recalc width/height and pos If $TaskBarPos[2] = $MonitorSizePos[2] Then If $TaskBarAutoHide = 1 Then If ($TaskBarPos[1] > 0) Then $MonitorSizePos[3] -= 1 Else $MonitorSizePos[1] += 1 $MonitorSizePos[3] -= 1 EndIf Return $MonitorSizePos EndIf $MonitorSizePos[3] = $MonitorSizePos[3] - $TaskBarPos[3] If ($TaskBarPos[0] = $MonitorList[$MonitorNumber][1]) And ($TaskBarPos[1] = $MonitorList[$MonitorNumber][2]) Then $MonitorSizePos[1] = $TaskBarPos[3] Else If $TaskBarAutoHide = 1 Then If ($TaskBarPos[0] > 0) Then $MonitorSizePos[2] -= 1 Else $MonitorSizePos[0] += 1 $MonitorSizePos[2] -= 1 EndIf Return $MonitorSizePos EndIf $MonitorSizePos[2] = $MonitorSizePos[2] - $TaskBarPos[2] If ($TaskBarPos[0] = $MonitorList[$MonitorNumber][1]) And ($TaskBarPos[1] = $MonitorList[$MonitorNumber][2]) Then $MonitorSizePos[0] = $TaskBarPos[2] EndIf EndIf Return $MonitorSizePos EndFunc ;==>_GetDesktopWorkArea Download UDF with seperate example: BorderLessWinUDF.zip EDIT: Newest versions of this UDF with bugfixes can be downloaded from the MetroGUI project:1 point -
Forum Rules You can read about forum rules here. Announcements and site news Additional information about forum you can read here. Forum etiquette Here you can read about a proper forum etiquette.1 point
-
GUIBuilder Project
Professor_Bernd reacted to TheSaint for a topic
For quite some time now, I have had it in mind to redo and upgrade Cyberslug's GuiBuilder (also called AutoBuilder). Well, that time is finally here. Why you ask? {1} I have always preferred its no nonsense simplicity that allows you to get down and dirty with coding quickly, not hampered by other elements taking up screen space, etc. {2} It is the main reason I am still coding with AutoIt v3.3.0.0 ... the last supported version by GuiBuilder. Haven't others made attempts at updating GuiBuilder? And why not help them? {3} Yes they have. The latest probably being GuiBuilderNxt by jaberwacky, who I did assist to a minor degree. {4] While I have great respect for the work he did, and that done by others, they were not really working on the type of update I wanted. I just wanted an update, with very few extra bells & whistles. {5] I also want a version that I can maintain, that is written in a structure I understand more easily than it currently is. In short, I want it written in the style I code in. To do that, it is necessary that I set aside time, to dissect the last version of GuiBuilder (which was the one I updated to support AutoIt v3.3.0.0), so that I can more fully understand what is going on. In the past, my updates, have just been simplistic tweaks to existing code, without understanding anymore than I had to. This time, it will be entirely different. {6} I don't work well with the way other people code, and it will be enough of a struggle deciphering things as it is. But seriously, why not just use one of the existing GUI creators? {7} I am well aware of all those, but none have the simplicity and directness I want. Apart from basic GUI elements, I manually code everything or copy & paste from prolific examples I have built up over the years. I like to keep things simple, and that extends to less clutter on the desktop working environment ... less to look at. Is this project a collaborative one? {8} NO, not at this stage. It may become that, to some degree, if I get stumped by something. After I have finished the project though, it will be open to others to extend, so at that point it could become collaborative under a slightly different name ... remembering all the points I mentioned previously for my version - maintenance etc. Finally. {9} GuiBuilder or AutoBuilder as it was called at one point, was the very first GUI creator for AutoIt, which you can read about here. I would like to do justice to it and Cyberslug, the original creator, for it was a very important part of AutoIt when it first came out, and was for a very long time, part of the AutoIt install, even for a while after Koda was first included. When it was eventually superseded, I well remember Jon asking if anyone was willing to update it, so that it could be kept as part of the AutoIt install, but as an example only. Some time later, I tweaked it, so that it would work with AutoIt v3.3.0.0, but I didn't revamp the code, which was pretty much all over the shop, so ultimately it wasn't suitable as an example. So here's hoping. Especially as life has a habit of intruding and sending things awry. Wish me luck! P.S. It is my intention to report here from time to time, on how things are going .... maybe even provide some code, discuss difficulties, plans, methods, etc. Source.au3 (last version, Prototype 0.9, supports AutoIt v3.3.0.0 and Win XP) (no resources provided yet, just for reference) Screenshot of v0.91 point -
Focus problem
seadoggie01 reacted to caramen for a topic
This is an abuse of language which means that it is the rules of Microsoft which manages the rights of windows why complicate matters.0 points