Jump to content

Leaderboard

Popular Content

Showing content with the highest reputation on 01/21/2016 in all areas

  1. Hi all, For last few weeks, i am in search of some good articles about windows messages and notifications. I am reading Charles Petzold's Windows Programming 5th edition in google books. Since the prize of that book costs nearly my two day's wages, i am depending google books. Then i wandered a lot of websites for gathering articles. Atlast i found a tool on MSDN site. Name is Control Spy. At first i thought that it is like the WindowInfo tool in AutoIt. But no, it is an incredible tool for a develepor. We can learn more about the behaviour of window controls and their messages and notifications. This is the link https://www.microsoft.com/en-us/download/details.aspx?id=4635 After installation, go to the directory and there is a word document. Read and learn more about how a windows control behaves.
    2 points
  2. local $str1 = '1,2,3,4,5,6,24' local $str2 = '6,2,11,13,1,24' local $str3 = '2,3,22,23,24,6' $str = $str1 & "," & $str2 & "," & $str3 Msgbox(0,"", StringRegExpReplace(StringRegExpReplace($str, '\b(\d+)\b,?(?!.*\b\1\b.*\b\1\b)', ""), ',$', "") ) Edit BTW @kylomas, you could do it this way local $str1 = '1,2,3,4,5,6,24' local $str2 = '6,2,11,13,1,24' local $str3 = '2,3,22,23,24,6' local $astr1 = stringsplit($str1,','), $save_num $str = $str1 & "," & $str2 & "," & $str3 for $i = 0 to $astr1[0] StringRegExpReplace($str, '\b' & $astr1[$i] & '\b', "" ) If @extended = 3 Then $save_num &= $astr1[$i] & ',' next ConsoleWrite(stringtrimright($save_num,1) & @CRLF)
    1 point
  3. @Deye yes, _FileListToArrayRec does (or should; i tested quite some time ago) return paths longer than MAX_PATH. i know this because i once wrote a utility to discover too long paths, and at one instance of it i did use _FileListToArrayRec. eventually i used recursion to scan the file system, without using the unicode prefix at all. this is because in general, reading metadata for long file names is feasible. the issue becomes apparent when you need to perform some action on those files.
    1 point
  4. @kcvinu I will start a PM & discuss the rest there, lets not pollute this thread further
    1 point
  5. @kcvinu Maybe we should compile a list of useful programs for AutoIt Programmers/Scripters? What do you think?
    1 point
  6. @kcvinu Yeah, sometimes tools like this are very helpful
    1 point
  7. Thanks for the link! P.S You posted this in the Help & Support forum, I already reported your thread to be moved to the appropriate forum
    1 point
  8. asiawatcher, This might get you started... ; strings used to simulate files...you would read your files into separate variables local $str1 = '1,2,3,4,5,6,24' local $str2 = '6,2,11,13,1,24' local $str3 = '2,3,22,23,24,6' local $astr1 = stringsplit($str1,','), $save_num ; create matching boundries to prevent "3" matching on "13", etc... $str2 = '|' & stringreplace($str2,',','|') & '|' $str3 = '|' & stringreplace($str3,',','|') & '|' for $i = 0 to $astr1[0] if stringinstr($str2, '|' & $astr1[$i] & '|') and stringinstr($str3, '|' & $astr1[$i] & '|') then $save_num &= $astr1[$i] & ',' next ConsoleWrite(stringtrimright($save_num,1) & @CRLF) kylomas
    1 point
  9. revalidated and still works with 1.8.0.66 and autoit 3.3.15.0 Mouse position is retrieved 1519-331 JAVA window found <> Java Window Title= Handle=0x0000000000040A88 res: 1 Result getAccessibleContextFromHWND is <> ubound: 4 We have a VMid 133784 ac 469679048 Call version info: PASSED VMID found : 133784 VMVersion: <1.8.0_66> bridgeJavaClassVersion: <1.8.0_66> bridgeJavaDLLVersion: <1.8.0_66> bridgeWinDLLVersion: <1.8.0_66> *** getAccessibleContextAT result is <469679016> *** getAccessibleContextAT result is <469679016> About... <html>View information about this version of the JRE</html> push button push button enabled,focusable,visible,showing,opaque enabled,focusable,visible,showing,opaque 0 0 1491 316 73 0 End of getAcceccibleContextAt info
    1 point
  10. Xandy

    Backup Script

    WARNING: I never tried this on a root directory, I should probably write a fix for that case. EX: There is no C:\..\ I don't know how many of these there are on this forum and I know Tidy is real nice for making backups. I have a few dislikes relying on the Tidy backup: 1 I'm not crazy about the backup folder it creates in project folder. 2. If no Tidy edits are performed script is not backed up on Tidy. I can't rely on that when I request a backup. 3. If I want to backup a select group of files without backing up the entire project folder, it is somewhat tedious to select each file and Tidy. Now this is just a very simple script that I felt I could use to simplify backing up my project. I'm not asking you to code it for me, but I welcome feedback. If you think you can make it better or know of something better please share. I know of Github it's overkill for me, I'm not comfortable, and I won't use it as much as I need to. So here it is: You place it in the source folder, open it in Scite. Change: Global $gBackup_dir_path = "..\Backup\" to wherever you want you backup folder Path to be. in the main() add some backup("file_name") calls remember to remove file extension. and it should make a new backup file for each backup("file_name") every time you run the script. Test it out make sure it's working and you're good to go. #cs ---------------------------------------------------------------------------- AutoIt Version: 3.3.14.2 Author: myName Script Function: To copy files to a backup folder. #ce ---------------------------------------------------------------------------- #include <File.au3> Global $gBackup_dir_path = "..\Backup\" ; Todo ; Add notes, options notes in file name main() func main() ; File list remember to remove extentions from file_name ; or add file extention as second parameter backup("Map_Editor") backup("DW_Server") EndFunc Func backup($spFile_name, $spFile_ext = ".au3") Local $error = 0 Local $iFile_num = 0 ; Make source file path Local $sFile_path_source = $spFile_name & $spFile_ext Local $sFile_path_dest = "" ; Sample the contents of the backup directory before creating a file there Local $aFile = _FileListToArray($gBackup_dir_path, $spFile_name&"*"&$spFile_ext, $FLTA_FILES) $error = @error If $error = 0 Then $iFile_num = $aFile[0] EndIf out("Found: " & $iFile_num & " files named: " & $spFile_name) Do ; Incroment file_num to find available file_name $iFile_num += 1 ; Path to Write File Copy $sFile_path_dest = $gBackup_dir_path & $spFile_name & "_" & $iFile_num & $spFile_ext ; Refuse to Overwrite File If FileExists($sFile_path_dest) = 0 Then ExitLoop EndIf ; Am I right? Sleep(30) Until 0 ; Create the file FileCopy($sFile_path_source, $sFile_path_dest, $FC_CREATEPATH) $error = @error If $error Then out("FileCopy() error: " & $error) out("sFile_path_source: " & $sFile_path_source & " sFile_path_dest: " & $sFile_path_dest) EndFunc ;==>backup Func out($output = "", $user = 0);debug tool ConsoleWrite(@CRLF & $output);to console new line, value of $output EndFunc ;==>out Backup_Script.au3 The script isn't authorized to overwrite files, and tries to create the next number of file_name available. The 'p' in my variable names stands for parameter.
    1 point
×
×
  • Create New...