Jump to content

Leaderboard

Popular Content

Showing content with the highest reputation on 12/25/2024 in all areas

  1. Sorry to hear that. But you won't go anywhere with that attitude. And I highly doubt that anyone here will continue to help without you showing much more effort. If you cannot program code by yourself, well hire someone that will do it for you...
    1 point
  2. Another way to toggle the button (similar with secondary GUIs) : Global $pOldBtnProc ... Local $hGUI4 = GUICreate("", 52, 51, 300, 300, $WS_POPUP, $WS_EX_MDICHILD, $hGUI) Local $idBtn = GUICtrlCreateButton("Test", 0, 0, 52, 51, $BS_BITMAP) GUICtrlSetImage($idBtn, "Cancel 52-51.bmp") Local $hBtnProc = DllCallbackRegister(WinBtnProc, "long", "hwnd;uint;wparam;lparam") $pOldBtnProc = _WinAPI_SetWindowLong(GUICtrlGetHandle($idBtn), $GWL_WNDPROC, DllCallbackGetPtr($hBtnProc)) ... Func WinBtnProc($hWnd, $iMsg, $wParam, $lParam) Local Static $bHover = False Switch $iMsg Case $WM_MOUSEMOVE If Not $bHover Then GUICtrlSetImage(_WinAPI_GetDlgCtrlID($hWnd), "OK 52-51.bmp") $bHover = True EndIf Case $WM_MOUSELEAVE GUICtrlSetImage(_WinAPI_GetDlgCtrlID($hWnd), "Cancel 52-51.bmp") $bHover = False EndSwitch Return DllCallAddress("long", $pOldBtnProc, "hwnd", $hWnd, "uint", $iMsg, "wparam", $wParam, "lparam", $lParam)[0] EndFunc ;==>WinBtnProc
    1 point
  3. [New VERSION] - 11 Dec 24 Added: New function _GUIListViewEx_EditProcessActive which returns the handle of the ListView concerned if an element is being edited. Usage scenario: prevent HotKeys from working when editing is underway. Fixed: A couple of bugs with columns: added columns were automatically sortable; dragging columns meant editing pop-up could appear in wrong place. Thanks to ValentinM for the reports. New UDF in the zip below. -------------------------------------------------------------------------------------- Note: This is a new recoded and expanded version of my earlier UDF of the same name. If you move to this new version there might well be several script-breaking changes, particularly when setting which columns are to be editable. Please read the "Beginner's Guide" and look at the included example scripts to see where things have changed. -------------------------------------------------------------------------------------- This UDF allows you to do much more with ListView controls (either native or UDF created): Edit the content with plain text, combos or date-time pickers - and edit the headers too Move rows within the ListView Drag rows both within the ListView and to other ListViews in the same GUI (or not as required) Insert and delete columns and rows Sort columns by simply clicking the header Colour individual ListView items and headers Only select a single cell rather then the entire row Save and load entire ListViews For the advanced user: If you use certain Windows message handlers (In particular WM_NOTIFY) in your script, please read the function headers for the equivalent handlers within the UDF. Here is the UDF, with 6 examples and the guide, in zip format: GUIListViewEx.zip Credit to: martin (basic drag code), Array.au3 authors (array functions), KaFu and ProgAndy (font function), LarsJ (colouring code) Happy to take compliments or criticism - preferably the former! M23
    1 point
  4. I'd do it using GUIGetCursorInfo() . Here is a reworked function Example() from Nine's script. Both images (Ok 52-51.bmp & Cancel 52-51.bmp) downloadable at the end of... my preceding post Func Example() _GDIPlus_Startup() $hGUI = GUICreateEx("main.png", 100, 100) $hGUI2 = GUICreateEx("item.png", 150, 400, $hGUI) $hGUI3 = GUICreateEx("item.png", 400, 400, $hGUI) Local $hGUI4 = GUICreate("", 52, 51, 100, 100, $WS_POPUP, $WS_EX_MDICHILD, $hGUI) Local $idButton = GUICtrlCreateButton("", 0, 0, 52, 51, $BS_BITMAP) GUICtrlSetImage($idButton, @ScriptDir & "\Ok 52-51.bmp") GUISetState() GUIRegisterMsg($WM_NCHITTEST, WM_NCHITTEST) GUIRegisterMsg($WM_MOUSELEAVE, WM_MOUSELEAVE) Local $aInfo, $iCounter, $hTimer = TimerInit() While True Switch GUIGetMsg() Case $GUI_EVENT_CLOSE ExitLoop Case $idButton ConsoleWrite("Button OK pressed" & @crlf) EndSwitch $aInfo = GUIGetCursorInfo($hGUI4) If Not @error And $aInfo[4] = $idButton Then If TimerDiff($hTimer) > 1000 Then ; 1s $iCounter += 1 GUICtrlSetImage( $idButton, @ScriptDir & (Mod($iCounter, 2) ? "\Cancel 52-51.bmp" : "\Ok 52-51.bmp") ) $hTimer = TimerInit() EndIf EndIf WEnd _GDIPlus_Shutdown() EndFunc ;==>Example The added part (changing the picture) could (should ?) probably be done in a function and not in Main loop, especially you'll add your own code to all this. Well... now it seems you got everything you need. Good luck
    1 point
  5. Recently I was working on simplifiaction in usage with UIA And thus I have almostly completed new UDF to simplify UIA usage. Example: Func _Example() Local $hWND_UIAFound = 0 _log(@ScriptLineNumber & ' ' & WinExists($_sExampleGuiTitle, "") _UIASimple_WinExist($_sExampleGuiTitle, "", "Some text to find", $hWND_UIAFound) _UIASimple_ButtonClick($hWND_UIAFound, "", "Some text to find", "Orange") _UIASimple_ButtonClick($hWND_UIAFound, "", "", "&Fake button") _UIASimple_ButtonClick($_sExampleGuiTitle, "OK", "Some text to find", "Banana") EndFunc ;==>_Example it uses my UIASimple.au3 which I will publish when it will be finished. And part of UIASimple.au3 UDF: .... .... .... Global $_UIASimple_TEXT_MATCH_MODE = $PropertyConditionFlags_IgnoreCase ; https://learn.microsoft.com/en-us/windows/win32/api/uiautomationclient/ne-uiautomationclient-propertyconditionflags .... .... .... #Region - _UIASimple_*** Helpers Func _UIASimple_ButtonClick($sWinTitle, $sWinText, $sUIAText, $sButton) If Not WinExists($sWinTitle, $sWinText) Then Return SetError(1, 0, False) Local $hWND_UIAFound = 0 ; Reset Local $oWindow = _UIASimple_FindWindow($sWinTitle, $sWinText, $sUIAText, $hWND_UIAFound) If @error Then Return SetError(2, @extended, False) Local $oButton = _UIASimple_FindSubObject_byName($oWindow, $sButton) If @error Then Return SetError(3, @extended, False) _UIASimple_ObjectInvoke($oButton) If @error Then Return SetError(4, @extended, False) Return True EndFunc ;==>_UIASimple_ButtonClick .... .... .... My general rule was to map the Standard AutoIt functions to give possibility to do things in a similar way but with UIA, so that it would be easy to switch to UIA (when it is needed). But currently I have one hm.... dilemma. As so far I used: UIA_Constants.au3 I also saw CUIAutomation2.au3 both files have defined the same values in a different convention. For example: $dtag_IUIAutomationInvokePattern $dtagIUIAutomationInvokePattern Some other const are defined with the same names so I can't use both together. So my dilema is: Which file should I use and why ? CUIAutomation2.au3 or UIA_Constants.au3 ?
    1 point
  6. LoranRendel

    Torrent (bencode) UDF

    Hello, This is my UDF working with *.torrent files. It converts torrent file to readable and editable text structure and back to torrent. Binary data will be encoded in base64. Written on pure AutoIt, except base64 located Due to limitation of this version of base64 code, code will not work on x64 compilation. Updated to new x64 compatible code. This code can also be used to edit utorrent/BitTorrent config files (like settings.dat), as it encoded using bencode. Examples are included. torrentUDF.zip
    1 point
×
×
  • Create New...