Quantcast
Channel: AutoIt v3 - Developer Chat
Viewing all 750 articles
Browse latest View live

Bad Snippets ! _ProcessCloseFromPath()

$
0
0

https://www.autoitscript.com/wiki/Snippets_(_Windows_OS_)

Test

AutoIt         
Example() Func Example()     ; Close a process using the filepath rather than the filename, which is what ProcessClose requires.     Run("C:\Windows\System32\notepad.exe") ;     Run("C:\Windows\SysWOW64\notepad.exe") ;     ; Wait 10 seconds for the Notepad window to appear.     WinWait("[CLASS:Notepad]", "", 10)     ; Wait for 2 seconds.     Sleep(2000)     Local $sNotepad = "C:\Windows\SysWOW64\notepad.exe"     MsgBox(48, "", "Path of Notepad: " & $sNotepad)     ; Close the Notepad process using the filepath.     _ProcessCloseFromPath($sNotepad) EndFunc   ;==>Example Func _ProcessCloseFromPath($sFilePath)     Return FileExists($sFilePath) ? ProcessClose(StringTrimLeft($sFilePath, StringInStr($sFilePath, "\", Default, -1))) : SetError(1, 0, 0) EndFunc   ;==>_ProcessCloseFromPath

I maybe permitted to modify a function better?
 

StringTrimLeft($sFilePath, StringInStr($sFilePath, "\", Default, -1))

Telnet Script - Freelancer required. Easy one, quick cash

$
0
0
<snip>

Apply here,
 
Simple telnet script, handful of prompts.
 
Under 1 hour work

Changing languages (Visual C)

$
0
0

Hi, 

I decided to switch over to another mainstream language recently, Visual C++. 

AutoIt is my first language, besides HTML, and I have been using it for 4 years. But even after completing 3/4 of tutorials in cplusplus.com I'm still lost when I try to recreate same of my own programs in C, even the most basic aspects.

So, the question is, How hard was it for you to learn C++, comparatively to AutoIt?

And, where can I possibly find a good help file for C++? (like the .chm of AutoIt)

I realize that C is vastly different from AutoIt, but are there any sites that help to smooth the transition?

 

 

p.s. This is a longterm project, so I don't need sites like "C++ in one month", I need something just to keep me moving in the direction.

Btw my compiler for C is Visual Studio 2013, and I also have CodeBlocks. 

Help File! Wrong

USING GUI'S

$
0
0

hello I have very important questions about this program regarding the GUI option.

 

i dont see a way to inject HTML, URL's or ability to make a client from a web page or game,

if this option exists I would like to know how and if the GUI  has its own cursor 

 

Thank You

Understanding The AutoIt Run Command Structure

$
0
0

Hi Gang,

 

I am the newest of AutoIt scripting newbies.  I just downloaded AutoIt yesterday and am building a prototype of an application.

 

I have my GUI working pretty well with placeholder statements in each Case statement.

 

What I am seeking advice on is how to translate the following Windows command line instruction into AutoIt Run syntax:

 

start AcroRd32.exe /A "page=7" "C:\Users\Mike-K6MKF\Desktop\K6TU Predictions\_K6MKF MAR 2015\UTC_17.pdf"

 

In Windows this starts AcroRd32.exe with the "page=7" parameter and reads the specified .pdf file.  Works great, opens page #7.

 

Now I want to do this in an AutoIt script.   I've read the Run function description and had a lot of trials and errors - mostly errors.

 

This part works, and starts up Acrobat, but I can't figure out how to pass Acrobat the /A "page=7" open parameter or point it to my .pdf file.

 

Dim $AcrobatPath = "C:\Program Files (x86)\Adobe\Reader 11.0\Reader\AcroRd32.exe /n"
 
Case $iMsg = $idM80
     Run ($AcrobatPath)

 

Any suggestions and assistance will be greatly appreciated.

 

Thanks!

recommended screenshot+annotation tool?

$
0
0

if you are producing a manual for your program (or any program, for that matter) - what are you using for screenshots and annotation? something easy to use, with pleasant graphic result?

Using _INetSmtpMailCom.au3 with Gmail

$
0
0

I can't get _INetSmtpMailCom.au3 to work with Gmail, SMTP, TLS/SSL on port 587. After a long delay I get message "The transport failed to connect to the server."

 

I have been using telnet and openssl to try to troubleshoot. For some reason, the only port that works in telnet and openssl is 587 (on Windows 7 Pro and 8 Pro, both 64-bit). Port 25 and 465 never connect (black screen in telnet and crash with openssl). I don't think this is a firewall issue but not sure it matters as long as 587 connects.

 

The Gmail account has 2-step authentication off and "Access for less secure apps" is allowed in accounts.google.com. I know I need a App password if I want to use 2-step authentication (eventually I'd like to use the App password method but it is off for now).

 

I have gotten openssl to log into the account but it requires the username and password be converted to base64. Does the  _INetSmtpMailCom.au3  need the base64 encoded username and password as well?

 

The openssl line that gets into account is:

 

openssl s_client -starttls smtp -connect smtp.gmail.com:587 -crlf

 

Not sure it is relevant, but with openssl I can't get past MAIL FROM: (error 555). I have tried base64 as well as plain text with and without the angle brackets (e.g., test@gmail.com and <test@gmail.com>)

 

I will post code if needed but I think this has something to do with the formatting of the parameters.

 

 

 

 

 

 


mysterious $i & $h

$
0
0

Hello again  :bye:,

 

A lot of times I have seen i or h prefixed to variables in UDFs (Ex. $iColour, $hWnd etc.) although their function seems like a normal variable... Is there any reason or specific purpose for prefixing them :huh:?

 

I personally think that this is a style of programming in AutoIt  b/c I have noticed that ISN AutoIt Studio pops up a very tiny colour selection palette whenever there is a $iColour parameter in a function.

 

What do you think i & h are for?

 

(I posted in dev chat b/c its more suited for this section compared to general support section :D)

 

TD :)

Converting a snippet of AutoIT to C++

$
0
0
Hi, 
 
Hopefully someone here will be able to help but I need a hand in converting this AutoIT piece of code or at least help me understand what's happening.
 
 
I am trying to convert that snippet of code there for one of my C++ projects and as you can see in the above link I have tried to comment it with what I understand is happening but I am a little lost.
For example where is the the iend and istart coming from? Are they just integer variables of the start of the array ( 0? ) and the end of the array? (could be 54 for example) ?
 
Any help is appreciated!
 
Thanks.

Apply SetItemBmp to internal autoit trayitem

$
0
0

Hello guys,

As title, i think is possible because i have found, casually, an example for apply a menu color usign a similiar way of the UDF _GUICtrlMenu* does

I have make some try but i don't know how to complete, some advice?

AutoIt         
#include <WinAPI.au3> #include <Constants.au3> #include <GuiMenu.au3> #NoTrayIcon Opt("TrayMenuMode", 3) ;~ Global Const $MIM_APPLYTOSUBMENUS = 0x80000000 ;~ Global Const $MIM_BACKGROUND = 0x00000002 ;~ Global Const $MIIM_BITMAP = 0x00000080 $hGUI = GUICreate("") TrayCreateItem("Item1") TrayCreateItem("Item2") TrayCreateItem("") $ExitItem = TrayCreateItem("Exit") TraySetState() ;~ SetMenuColor(0, 0xEEBB99) ; BGR color value, '0' means the tray context menu handle itself SetItemBmp($ExitItem, _WinAPI_CreateSolidBitmap($hGUI, 0xFF0000, 11, 11)) _GUICtrlMenu_SetItemBmp(0, $ExitItem, _WinAPI_CreateSolidBitmap($hGUI, 0xFF0000, 11, 11)) While 1     Local $Msg = TrayGetMsg()     Switch $Msg         Case $ExitItem             Exit     EndSwitch WEnd ; Apply the color to the menu Func SetMenuColor($nMenuID, $nColor)     Local $hMenu = TrayItemGetHandle($nMenuID) ; Get the internal menu handle     Local $hBrush = DllCall("gdi32.dll", "hwnd", "CreateSolidBrush", "int", $nColor)     $hBrush = $hBrush[0]     Local $stMenuInfo = DllStructCreate("dword;dword;dword;uint;ptr;dword;ptr")     DllStructSetData($stMenuInfo, 1, DllStructGetSize($stMenuInfo))     DllStructSetData($stMenuInfo, 2, BitOR($MIM_APPLYTOSUBMENUS, $MIM_BACKGROUND))     DllStructSetData($stMenuInfo, 5, $hBrush)     DllCall("user32.dll", "int", "SetMenuInfo", "hwnd", $hMenu, "ptr", DllStructGetPtr($stMenuInfo)) EndFunc   ;==>SetMenuColor Func SetItemBmp($nItemID, $hBmp)     Local $hMenu = TrayItemGetHandle($nItemID) ; Get the internal menu handle     Local Const $tagMENUITEMINFO = "uint Size;uint Mask;uint Type;uint State;uint ID;handle SubMenu;handle BmpChecked;handle BmpUnchecked;" & _         "ulong_ptr ItemData;ptr TypeData;uint CCH;handle BmpItem"     Local $tInfo = DllStructCreate($tagMENUITEMINFO)     DllStructSetData($tInfo, "Size", DllStructGetSize($tInfo))     DllStructSetData($tInfo, "Mask", $MIIM_BITMAP)     DllStructSetData($tInfo, "BmpItem", $hBmp)     DllCall("User32.dll", "bool", "SetMenuItemInfoW", "handle", $hMenu, "uint", $nItemID, "bool", True, "struct*", $tInfo) EndFunc   ;==>SetMenuColor

P.S. I don't want to use, if possible, the _GUICtrlMenu_CreatePopup because i don't like that way to manage item with WM_COMMAND, is more easy to use the internal one

Thanks

File Name and Path Page - 404

Conditional Loop Script based on Window Title

$
0
0

Hi guy's I need help I can't get my script to loop the way I want

I have an app that has popup windows that I want to close  with my script based on the window titles and tab through

the selection to close the windows down but I don't know how to repeat and make it loop the right way

 

here is my script I would like to make the ('Activation') loop until the ('User account') window pops up the go back to the top of the script again and wait for the ('Activation') windows to popup keep doing that until I end the script.

 

Can anyone help?

 

#RequireAdmin

While 1
WinWait ('Activation')

If WinActive ('Activation') Then
  Send('{TAB}{TAB}{TAB}{SPACE}')
Sleep(60)

EndIf

;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;

If WinWait ('User account') Then
  Send('{TAB}{TAB}{SPACE}{SPACE}')
  Sleep(60)
  Send('{TAB}{TAB}{TAB}{TAB}{SPACE}')
 

ElseIf WinWait ('Activation') Then
Send('{TAB}{TAB}{TAB}{SPACE}')

EndIf
WEnd

Apple's new Swift programming language

AutoIt on Raspberry Pi 2 ?

$
0
0

So,

The raspberry pi 2 is more or less available now and Microsoft has announced Windows 10 for the RasPi 2 (see here).

So, is there a possibility that AutoIt may be available for the Raspberry Pi 2?

Would you like to see AutoIt working on a RasPi? What's your thought on that?

 

Just asking out of curiosity.

 

I for myself will probably end up learning Python more to automatize stuff if AutoIt won't be available. (So far I made a script to automatically synchronize two folders, one being on a NAS). But this announcement made me think :)


A Report topic only - Ignore mass spam

$
0
0

IGNORE MASS SPAM - Do not report any of them.

 

This is just a topic started to report that the mass spam that occurred yesterday, appears to be happening again today, but here instead of general Chat.

 

I am deliberately avoiding viewing those topics, and it has been reported by beerman.

 

P.S. This means, that no-one else should report those topics. Apparently that just creates extra work for the Mods when clearing up these attacks.

How did I made the longest explain plan with this SQL query?

$
0
0

Hello, I would like to write a simple query, where I count new registrations monthly.

 

The monster I created can't be made as an explain plan in normal time borders. I suspect my logic is somewhere flawed, syntax I think is good (at least i didn't get syntax error).

 

my query:

SELECT   EXTRACT(MONTH FROM  DATABASE.REGHISTORY.X__INSDATE),   --TRUNC(X__INSDATE, 'MONTH') as HONAP   COUNT(X__INSDATE) FROM   DATABASE.REGHISTORY GROUP BY EXTRACT(MONTH FROM  DATABASE.REGHISTORY.X__INSDATE);

 I supposed I should try to count something else, but it didnt finsih neither when I tried to count IDs.

 

I would like my table in a format simply like: month/Summed registrations that month

 

EDIT: I also wanted to order by maybe in ascending order, but for now I try to make it so it gives back what I want first

 

EDIT2:  Oracle SQL developer 4.0.0.12 (sorry, I should have started with this..)

 

Thank you!

 

PS.: I hope this is the right thread to ask something like this, general help I thought is for autoit mostly.

_ArrayUnique

$
0
0

By some chance i have seen and checked the functions _ArrayUnique wich use _ArrayInsert inside Array.au3.

 

I did one function some time ago for my needs to do the same but just in 1D, much more faster; its 6 lines long. Tell me if it could be interesting for someone/something and i could share it. :)

Initial Workstation settings script?

$
0
0

So I setup up multiple workstations for clients and would love to have something to automate the routine I do with every new workstation.

 

Here is what I would be looking for:

Set specific Internet Explorer Settings (Specifically IE 9)

Enable Remote Registry

Enable RDC

Disable Offline files (Sync Center)

Advanced sharing settings (turn on network discovery, turn on file and print sharing, User user accounts and passwords to connect to other computers)

Windows Firewall (check Remote Desktop Private and Public)

Change sleep option in Power options

 

Before doing those I would have manually turned off UAC and uninstalled IE 11 to get IE 9

 

If anyone can help me out with this that would be wonderful (if this is even possible)

AutoIt v3.3.13.20 Beta

$
0
0

File Name: AutoIt v3.3.13.20 Beta

File Submitter: Jon

File Submitted: 22 Mar 2015

File Category: Beta


3.3.13.20 (21st March, 2015) (Beta)
AutoIt:
- Changed: Map uses 64-bit integers.

- Fixed #2920: Doc precision about no control position/resizing on initially window for GUiCreate()/WinMove().
- Fixed #2924: Progress bar style documentation.

UDFs:
- Changed: Removed internal redraw code from _GUIListView_DeleteAllItems() and _GUIListView_DeleteSelectedItems().
- Changed: _ArrayUnique() can now deal with Int64 values via new parameter,
- Changed: _SQLite 3.8.6.0 -> 3.8.8.1.
- Changed: Re-wrote _StringInsert() using native functions.
- Changed: _HexToString() to _StringToHex() now handles strings and binary as UTF-8 by default.
- Changed: _FileWriteToLine() overwrite optional parameter is now boolean and not an integer of zero or one. The old values are still supported for now.
- Changed: _Word_DocOpen() changed from @error = 4 to @error = 0 and @extended = 1 if document could not be opened Read-Write. THIS IS A SCRIPT BREAKING CHANGE
- Changed: Re-wrote _MathCheckDiv().

- Added #2877: _GUICtrlRichEdit_GetFont() example improvement.
- Added #2857: _GUICtrlEdit_GetCueBanner() and _GUICtrlEdit_SetCueBanner().
- Added #2860: Convert UDF's ptr to struct* type to allow direct passing of a structure.
- Added #2891: _WinAPI_GetWindowDC() and _WinAPI_RedrawWindow() examples.
- Added: More _GDIPlus_Font* functions.
- Added: _WinAPI_GetFontResourceInfo() return more Font information.
- Added: _WinAPI_GetFontMemoryResourceInfo().
- Added #2922: _VersionCompare() with different number of fields.
- Added #2968: Optional parameter $iMSeconds to _SetTime().
- Added: $SB_ANSI, $SB_UTF16LE, $SB_UTF16BE and $SB_UTF8 constants to StringConstants.au3, for use with BinaryToString() and StringToBinary().
- Added: Constants to Assign() and IsDeclared().
- Added #2982: _FTP_Connect() example improvement.
- Added #2976: #pragma default value.
- Added #2998: Added missing key (03 - control-break processing) to the _IsPressed() documentation.

- Fixed #2868: _WinAPI_SfcIsKeyProtected() ->_WinAPI_SfcIsFileProtected() doc example.
- Fixed #2874: _GUICtrlRichEdit_SetCharColor() not at insertpoint.
- Fixed #2875: Broken link in _SendMessage() doc.
- Fixed #2876: examples running under Windows X64 in 32 bit mode.
- Fixed #2880: Example for _WinAPI_OpenProcess().
- Fixed #2881: HotKeySet() doc as "{ASC nnnn}" cannot be used
- Fixed #2885: Subscript error with _ArrayMax() and _ArrayMin().
- Fixed #2909: Backslash was not appended in _PathMake() if $sDir was blank.
- Fixed #2908: _ScreenCapture_Capture() failing due to out of bounds error.
- Fixed #2911: _ArrayDisplay() GUI controls have wrong coords.
- Fixed #2917: _WinAPI_AddMRUString() example crash when run in X64 mode (Msdn Bug CreateMRUListW !!!).
- Fixed #2918: _GDIPlus_GetEncoderParameterList() not working.
- Fixed: Range setting in _ArrayDisplay().
- Fixed #2923: Broken link in Related section.
- Fixed #2934: Typo in _GUICtrlRichEdit_SetZoom() doc.
- Fixed #2933: Constants reference in _GUICtrlRichEdit_StreamToVar() doc.
- Fixed: _Array_FindAll() return array incorrectly dimesioned for row search.
- Fixed #2964: Incorrect structure for $tagWNDCLASS.
- Fixed: _WinAPI_IsWritable() wrong detection when the device is not ready.
- Fixed: The seconds parameter in _SetTime() being set as milliseconds.
- Fixed #2967: Incorrect format of AM/PM when the time was 00:00.
- Fixed #2993: _WinApi_GetString() doc.

AutoItX:
- Fixed #2882: PixelChecksum bugs.

Au3Check:
- Added: Support of UTF8 with BOM files.

AutoIt3Help:
- Changed: Version number to 1.0.0.7.

- Fixed: Crash in SciTE when multiple lines are selected.

Others:
- Added: Icons\MyAutoit3_*.ico to be used when compiling user scripts (small footprint).


Click here to download this file

Viewing all 750 articles
Browse latest View live