Jump to content

Leaderboard

Popular Content

Showing content with the highest reputation on 09/18/2022 in all areas

  1. Big update: FIXED: #include's are now more dynamic (don't include constants unless they are needed) FIXED: Removed extra GuiCreateTabItem("") for each tab FIXED: Extra GuiCreateTabItem("") for each tab FIXED: Radio and Checkbox control size when drawing ADDED: Button styles BS_LEFT, BS_RIGHT ADDED: Import/parse an existing AU3 file as GUI CHANGED: Cleaner generated code by spacing Tabs and Groups
    2 points
  2. ? #include <WinAPI.au3> #include <WindowsConstants.au3> ; get notepad Local $hWnd = WinGetHandle("[CLASS:notepad]") ; get active window $w = WinList() For $i = 1 To $w[0][0] If $w[$i][0] <> "" And BitAND(WinGetState($w[$i][1]), 2) Then $active = $w[$i][1] Exitloop EndIf Next ; activate notepad WinActivate($hWnd) Sleep(1000) ; send notepad to bottom and reactive the previous one _WinAPI_SetWindowPos($hWnd, $HWND_BOTTOM, 0, 0, 0, 0, BitOR($SWP_FRAMECHANGED, $SWP_NOMOVE, $SWP_NOSIZE)) WinActivate($active)
    2 points
  3. Hi everybody I got a correct result when using _WinAPI_SetWindowPos() which allows to force the Z-order of a window (handle as 1st parameter) to be placed immediately after another window (handle as 2nd parameter) So checking both handles before bringing NotePad to front allows to place it back exactly where it was when you're done. No need to activate any other window (no flicker) during the process : #include <AutoItConstants.au3> #include <WinAPISysWin.au3> $notepad = WinGetHandle("[CLASS:Notepad]") $initiallyActive = WinGetHandle("[ACTIVE]", "") $initialWindows = WinList() For $i = 1 To $initialWindows[0][0] If $initialWindows[$i][1] = $notepad Then $BeforeNotePad = $initialWindows[$i - 1][1] ExitLoop EndIf Next ; make Notepad the active window WinActivate($notepad) WinWaitActive($notepad) Sleep(5000) ; Notice that Notepad is active, change its size & position during 5 seconds _WinAPI_SetWindowPos($notepad, $BeforeNotePad, 0, 0, 0, 0, BitOr($SWP_NOMOVE, $SWP_NOSIZE)) WinActivate($initiallyActive) In this example, I had about 8 windows opened and NotePad was in the middle of them. Good luck Edit: half an hour after... it's only now that I notice @mikell also used _WinAPI_SetWindowPos() in his script above. Wish I noticed it earlier, it would have saved some time
    1 point
  4. The last rc seemed stable - will be releasing that and then moving onto new betas with other fixes. 3.3.16.0 had a fairly nasty RegExp bug and I really want to get that fixed.
    1 point
  5. KaFu

    Media Player Embedding

    Maybe something like this (untested). Func _MP_PlaylistRemoveItem($iIndex) ; https://docs.microsoft.com/de-de/windows/win32/wmp/wmplibiwmpplaylist-iwmpplaylist-removeitem--vb-and-c Local $oWMP = $aPlayerReg[$PREG_PLROBJ] Local $oPlaylist = $oWMP.CurrentPlaylist $oWMP.CurrentPlayList.RemoveItem($oPlaylist.Item($iIndex)) EndFunc ;==>_MP_PlaylistRemoveItem
    1 point
  6. Melba23

    Random Sleep time

    gripper, - 1. Use Random as the argument to Sleep: Sleep(Random(1000, 10000, 1))This will sleep for a random time between 1 and 10 seconds. - 2. Use an array to store the times and then use Random to choose which element to use: Global $aTimes[5] = [1, 3, 5, 7, 9] Sleep(1000 * $aTimes[Random(0, 4, 1)])You get sleeps of 1, 3, 5, 7 or 9 seconds. All clear? M23
    1 point
×
×
  • Create New...