Leaderboard
Popular Content
Showing content with the highest reputation on 02/03/2019 in all areas
-
Automating Notepad - Classic This is a repetition of the Notepad example above. But this time with classic automation code: #include <WindowsConstants.au3> #include <WinAPI.au3> Example() Func Example() ; Open Notepad Run( "Notepad" ) Sleep( 1000 ) ; Notepad window handle Local $hNotepad = WinGetHandle( "[Class:Notepad]" ) ; Fill up "Edit1" with "HelloWorld" ControlSend( $hNotepad, "", "Edit1", "HelloWorld" ) ; Open "Save As..." dialog _WinAPI_PostMessage( $hNotepad, $WM_COMMAND, 4, 0 ) ; 4 = $UIA_AutomationIdPropertyId in UIASpy Sleep( 1000 ) ; Save As window handle Local $hSaveAs = WinGetHandle( "[Class:#32770]" ) ; Fill up "Edit1" (File name) with "HelloWorld.txt" ControlSend( $hSaveAs, "", "Edit1", "HelloWorld.txt" ) ; Click Save button _WinAPI_PostMessage( $hSaveAs, $WM_COMMAND, 1, 0 ) ; 1 = $UIA_AutomationIdPropertyId in UIASpy EndFunc3 points
-
Bug or Feature?
argumentum reacted to IanN1990 for a topic
Hi All, I discovered today having the color #F0F0F0 within a image causes it become transparent. #NoTrayIcon #include <GUIConstantsEx.au3> GUICreate("AutoIt Test", 500, 500) GUISetBkColor(0xE0FFFF) GUICtrlCreatePic(@ScriptDir & "\Test.bmp", 0, 0, 500, 500) GUISetState() While 1 Switch GUIGetMsg() Case $GUI_EVENT_CLOSE ExitLoop EndSwitch WEnd From other code that makes a GUI transparent _WinAPI_SetLayeredWindowAttributes() it needs to match a color, so this does make sense. This also explains why in the helpfile for GUICtrlCreatePic() it says; "The background is always set to transparent. GUICtrlSetBkColor() has no effect on pic control." Just wanted to double check this is more a feature then bug test.bmp1 point -
Bug or Feature?
argumentum reacted to IanN1990 for a topic
You had me doubting then! I am running v3.3.14.2 on Windows 7 Pro (and tested on windows 8). I also discovered for this effect to happen the image must not be resized. The main reason i am asking is because i am thinking of replacing my current transparency code for this instead. As then it doesn't require GDIPlus, is fewer lines and seems to display it better (no outline). Current Version #NoTrayIcon #include <GUIConstantsEx.au3> #include <WindowsConstants.au3> #include <winapi.au3> #include <GDIPlus.au3> $STM_SETIMAGE = 0x0172 _GDIPlus_Startup() $hGui = GUICreate("AutoIt Test", 241, 60, -1, -1, $WS_POPUP, $WS_EX_LAYERED) GUISetBkColor(0x000000) $hPic = GUICtrlCreatePic("", 0, 0, 241, 60) $hImage = _GDIPlus_ImageLoadFromFile(@ScriptDir & "\test.png") $hBitmap = _GDIPlus_BitmapCloneArea($hImage, 0, 0, 241, 60, $GDIP_PXF32ARGB) $hBmp = _GDIPlus_BitmapCreateHBITMAPFromBitmap($hBitmap) _GDIPlus_BitmapDispose($hBitmap) _GDIPlus_ImageDispose($hImage) GUICtrlSendMsg($hPic, $STM_SETIMAGE, 0, $hBmp) _WinAPI_DeleteObject($hBmp) _WinAPI_SetLayeredWindowAttributes($hGui, 0x000000, 255) GUISetState() While 1 Switch GUIGetMsg() Case $GUI_EVENT_CLOSE _GDIPlus_Shutdown() ExitLoop EndSwitch WEnd Proposed version #NoTrayIcon #include <GUIConstantsEx.au3> #include <WindowsConstants.au3> #include <winapi.au3> $hGui = GUICreate("AutoIt Test", 241, 60, -1, -1, $WS_POPUP, $WS_EX_LAYERED) GUISetBkColor(0x000000) GUICtrlCreatePic(@ScriptDir & "\test.bmp", 0, 0, 241, 60) GUISetState() _WinAPI_SetLayeredWindowAttributes($hGui, 0x000000, 255) While 1 Switch GUIGetMsg() Case $GUI_EVENT_CLOSE ExitLoop EndSwitch WEnd test.bmp1 point -
Deye, You can start with this code: #AutoIt3Wrapper_UseX64=y #include "ShellContextMenu.au3" HotKeySet( "{F1}", "CMenu" ) ; F1: Open context menu, Esc: Close context menu HotKeySet( "{F2}", "Close" ) ; F2: Close script While Sleep(10) WEnd Func CMenu() Local $hDesktop = _WinAPI_GetDesktopWindow() Local $tPoint = _WinAPI_GetMousePos(), $x = DllStructGetData( $tPoint, "x" ), $y = DllStructGetData( $tPoint, "y" ) Local $hGui = GUICreate( "", 32, 32, $x, $y, 0x80880000 ) ; 0x80880000 = $WS_POPUPWINDOW GUISetState( @SW_SHOW, $hGui ) ; You must create a GUI ShellContextMenu( $hGui, $hDesktop, $tPoint, @ScriptFullPath ) GUIDelete( $hGui ) EndFunc Func Close() Exit EndFunc1 point
-
Pick text from a txt. file
FrancescoDiMuro reacted to Melba23 for a topic
deleyara, But if you look at the icon under my avatar you will see that is my job here! And with that remark you have used up all of the flex I was prepared to show you. Please read the Forum rules before posting again - you will see that we do not support bypassing security measures such as CAPTCHAs - thread locked. M231 point -
iAmNewbie, Did you read the tutorial to which I linked? If you start a function from the main loop it is interruptable by OnEvent calls - if you start it from an OnEvent call it is not. If you read the Operators page in the Help file you will see that AutoIt is clever enough to use "=" as both - and that the "==" operator is a special case-sensitive comparison operator. M231 point
-
_ArrayFromString()
argumentum reacted to jchd for a topic
I'm not able to maintain code anymore so you should post a ticket in Trac about that. In the meantime, change your own copy of the UDF.1 point -
Select LV item by LV item ID
pixelsearch reacted to BugFix for a topic
Really?! What more information you need as: _GUICtrlListView_SimpleSort doesn't sort ItemParam Sometimes, it helps to read the feature request. There I wrote: "I've changed this function, so that it also sort ItemParam."1 point -
You got the point. I should declare the $SplashScreen_Form as GLOBAL instead. Now the issue is fixed. Thanks.1 point
-
The avi file must be uncompressed1 point
-
Using UI Automation Code in AutoIt
Earthshine reacted to LarsJ for a topic
junkew, In the current version of simplespy.au3 you can easily add a ComboBox that list the elements from Desktop to detected element. If the detected element is a pane control (or a custom control) the user can simply select the proper element in the ComboBox. This also allows the user to get information about application top window.1 point -
Using UI Automation Code in AutoIt
GicuPiticu reacted to LarsJ for a topic
How to topics, 1 - 7 How to topics is a guide to use UIASpy to identify windows and controls and to create sample code to obtain information and perform actions. Topics 1 - 7: Introductory topics Top of next post (bottom of this post) Topics 8 - 15: Sample code creation Topics 16 - 17: Other How to topics How to perform UI Automation tasks How to use UIASpy to detect elements How to use UIASpy to create sample code How to create sample code through Detail info page How to create sample code through Sample code menu How to create sample code by copying listview rows How to create objects with ObjCreateInterface How to create UI Automation main objects How to identify and find application top window How to identify and find UI elements (controls) How to get UI element property values How to create element action objects How to get pattern property values How to perform element actions How to create executable code How to perform a mouse click in middle of bounding rectangle How to perform a control click via PostMessage and $UIA_AutomationIdPropertyId 1. How to perform UI Automation tasks UI Automation tasks are almost always performed in a top-down and step-by-step procedure. The task is divided into smaller sub-tasks that cannot be further divided. Each sub-task is performed in 2-4 steps. Clicking a button in a window is divided into 2 sub-tasks: Identify the window Identify and click the button The window that's identified in the first sub-task is used to identify the button in the second sub-task. Identifying the window is done in 2 steps: Create condition to identify the window Find the window based on the condition Identifying and clicking the button is done in 4 steps: Create condition to identify the button Find the button based on the condition Create an action to click the button Perform the action and click the button Here, the procedure is illustrated schematically: UIASpy can provide information to identify windows and controls and can generate sample code to implement the 2-4 steps. 2. How to use UIASpy to detect elements Open UIASpy. Click Left pane | Delete top windows to delete all treeview top windows. To detect a window, place the mouse cursor over the window title bar and press F2. To detect a control, place the mouse cursor over the control and press F1. Switch back to UIASpy window. 3. How to use UIASpy to create Sample code Through Sample code creation, you can more or less create all code in a simple automation task: Create UI Automation initial code Create condition and find application window Create condition and find control in window Get information about windows and controls Create pattern objects to perform actions Get information related to pattern objects Perform actions with pattern object methods Add a Sleep() statement if necessary In short, there are 3 ways to create sample code with UIASpy: Use the UIASpy Sample code main menu Right click a selected row in the Detail info listview page and Click Create sample code to create code based on selected row(s) Right click a selected row in the Detail info listview page or in a Sample code listview page and Click Copy to sample code to copy variable names and values to sample code (preferred) or Click Copy selected items to copy variable names and values to clipboard Then paste the code into an editor. 4. How to create sample code through Detail info page The Detail info listview page is also the default listview page. This makes sample code creation easy and fast. You can find a brief description with pictures and code snippets in the UIASpy thread. But not all code can be created this way. In many cases, there is a need to use the Sample code main menu. 5. How to create sample code through Sample code menu Much more code can be created through the Sample code menu than through the Detail info page. In addition, the menu can be used to set Sample code options and for Sample code maintenance. You can find a brief description with a picture in the UIASpy thread. 6. How to create sample code by copying listview rows To copy information from the Detail info listview page or a Sample code listview page into the editor right-click a selected row and click Copy to sample code: Paste the code into the editor: ; --- Copy element info --- ; $UIA_NativeWindowHandlePropertyId 0x00090244 7. How to create objects with ObjCreateInterface All objects needed in most automation tasks can be created using UIASpy sample code features. This is by far the easiest way to create the objects. There is really no need to create the objects in other ways. Top of post1 point -
easy audio player progect
yutijang reacted to nacerbaaziz for a topic
hellow guys I am a blind young man I started a project to make an audio player with recorder I ended the player and i did not know how to recorder This player is Compatible with the blind and visually impaired and ordinary users Unfortunately I do not see so I could not merge images and icons So I hope you will be able to help me in this matter I will bring you the open source project and please help me to add images, icons and recorder, the project is requires easy access in order to be compatible with the screen readers, Please take this into account. the software is organized so the recorder is In a special menu that Contains stop and start and pause and save. The same is true for player Please help And greetings to all easy player.zip1 point