Jump to content

Leaderboard

Popular Content

Showing content with the highest reputation on 07/16/2014 in all areas

  1. I have already published a lot of AutoIt UDF about algorithm, but all of them only support 32 bits or so called X86 system. Recently I got a computer with Windows 7 64 bits, so I finally added X64 support to most of my old projects. Besides, I also added some new. For example, some compression algorithm and SHA3 Candidates. Following are the algorithms list: Checksum CRC16 CRC32 ADLER32 Compression FastLZ LZF LZMA LZMAT MiniLZO QuickLZ Encode Base64 ARC4 XXTEA DES AES Hash Checksums (CRC16/CRC32/ADLER32) MD2 MD4 MD5 SHA1 SHA2 (SHA224/256/384/512) SHA3 Candidates BLAKE BMW (Blue Midnight Wish) CUBEHASH ECHO SHABAL SKEIN Some points to mention: All of the subroutines have one or more examples to demonstrate the usage. Since the function and usage of subroutine are easy to understand. A complete subroutines and parameters list are unavailability now. Sorry for my lazy. All of the subroutines here invoked by Lazycat's method (through CallWindowProc API). My MemoryDLL UDF is not necessary this time. Although MemoryFuncCall (part of MemoryDLL) is still good, but inevitably, it is slower than CallWindowProc. Some subroutines have the same name with my old machine code version UDF. But for some reason, I rearrange the position of the parameters. Please not mix up. If you notice, yes, checksums are duplicated. But they receive different parameters. One is the old style, and another use the same interface as other hashes. Choose what you like, but don't use them in the same time. Some algorithm already supported by the standard UDF "Encryption.au3". But I still provide them, because some system lack of the full support of Windows Crypt Library. If you are looking for only one hash algorithm, for example, used in encryption, I suggested "SHABAL_TINY.au3". Although it is a bit slower then SHABAL, but it is smaller, and it supports different size of output (from 32 to 512 bits).AutoIt Machine Code Algorithm Collection.zip
    1 point
  2. JohnOne

    Absolute Beginners

    Here is a little tutorial I decided to make. (yes another tutorial) It is intended for people with absolutely no knowledge of programming/scripting at all. It also assumes you do not know how to use autoit3 help file. What it does assume, is that you have installed autoit3 and scite4autoit which can be found here Autoit > Scite4autoit The most important thing to know, is how to navigate and use the helpfile Please do not underestimate how valuable this resource is. By default the help file is located in your myprograms or myprogramsx86 of you OS drive in the folder AutoIt3 It looks like this with the ? on it, click it Once the helpfile loads you will see essentially two panels, the one on the left is about navigation The one on the right is about information, and for now, just focus on the index tab and click it to see something like this in the left panel Notice it says "Type in the keyword to find", this is where we can find what we are looking for. For example, if I want to find a string function, or browse all the string functions, I simply type "string" into the field below the prompt, and it navigates automatically to the items in the index, like so. If you highlight one of the items in the list and hit enter, or double click on an item, it will bring up information about that item in the right side panel, like so. Above I clicked on the String function and it shows me everything i need to know about that function. Firstly, it tells me in essence what it does. "Returns the string representation of an expression." Secondly, it shows me how to enter the function into scite editor "String ( expression )" In the scope of this post, the expession here is the paramater we pass to the function for processing. A paramater is any variable or literal we put inside the braces of a function. It also tells me the return value - "Returns a string." - a string it what is between those two quotes (text if you will) So what is a return value? Its what the function pumps out after you pass it the correct paramaters, you can test it in the example at the bottom of the right panel. But not before you take a look at another important part of the information, The remarks. "Maximum string length is 2147483647 characters (but keep in mind that no line in an AutoIt script can exceed 4095 characters.)" Here its telling us that if we put a string of over 4095 characters on one line in our script, it will fail. Never skip the remarks, it will cost you valuable time and cause you headaches. Every time you are going to use a function, you should have that function open in the helpfile and refer to it every step of the way. All the information in that panel is important, read it all, and then, notice the little button at the bottom of the example entitled "Open this Script", press that, and the script will automagically open in your scite4autoit editor, and is ready to run, by hitting the F5 key Q. What is a variable? A. $this_is_a_variable = "this is a literal string"; A variable will always have the $ at the beginning and never have a space in it (those are rules) Look at the example $var = String(10) ;$var is the string "10" ;$var is the variable here, and 10 is a literal paramater passed to the String function. Lets take the String function out of the equasion and consider this statement (in the scope of this post a statement is information you type into scite which is telling autoit3 something it needs to know) $var = 10 Here the variable $var is now equal to the literal value 10, it is named a variable because it can change its value. $var = $var + 1 $var is now equal to 11, 10 however, will always be 10. Lets have a look at another function, you remember how to find what we need in the helpfile? then find FileRead. Heres what it tells us. Read in a number of characters from a previously opened text file. This means it will read into the variable it is assigned, (think $var) the amount of individual characters we want from a file that autoit3 has already opened. FileRead ( "filehandle/filename" [, count] ) This is like a prototype of the function we will enter into our editor, notice the bracets "[" and "]" they are telling us that this paramater is optional! more below. Parameters filehandle/filename - The handle of a file, as returned by a previous call to FileOpen. Alternatively you may use a string filename as the first parameter. Forget filehandle for now, filename here is the path to the file we want to read from, for example "c:usersscriptsmyfile.txt" count - [optional] The number of characters to read. Default read the entire file. Its quite common for beginners to misunderstand these [ and ], you dont type them literally into your script, they are just to let you know that you can completely leave out that paramater if you do not need it. In this case, if you want to read the whole file into your variable ($var) you would leave out everything between and including those bracets. If you do need it you would remove the bracets and enter your paramater. Return Value Success: Returns the binary/string read. @extended is set to the number of bytes/characters returned. This tells us the function will return a string if we gave it a filename as a paramater, since we are reading the file, the string will be the contents of the file. Special: Sets @error to -1 if end-of-file is reached. @error information tells us information about why the call to a function may have failed. It is important to check the @error state after each function you use. Failure: Sets @error to 1 if file not opened in read mode or other error. Looking at the example usually shows you how to check for errors. Remarks If a filename is given rather than a file handle - the file will be opened and closed during the function call - for parsing large text files this will be much slower than using filehandles. Note: Do not mix filehandles and filenames, i.e., don't FileOpen a file and then use a filename in this function. Use either filehandles or filenames in your routines, not both! Both ANSI and UTF16/UTF8 text formats can be read - AutoIt will automatically determine the type. A file can be read as binary(byte) data by using FileOpen with the binary flag - in this case count is in bytes rather than characters. There are plenty of good tutorials on this forum created by various members, which is why it is important to know how to search the forums. But hang on, this tutorial is about how to use the helpfile, so cast your mind way back to when we learnt how to find what we need It was typing it into the index tab prompt field, so type "tutorial" into that, and you will find basic tuts in their also.
    1 point
  3. Hiya! I'm currently working on a project which involves the mouse and its properties. For this I was in need for a mouse UDF which could capture certain events. I have found some of the many here on the forums, but quite some are using DLL's. I'm not saying this is bad, it's good! But, my application crashed for unknown reasons when compiled to x64. The way this UDF works, is that it checks every tick for certain conditions to be met. For example: if you have registered a double click event, it will check every frame for double click condition and then call the given function if necessary. So I decided to write my own little _Mouse_UDF powered in autoit itself and share it with the rest of the community. Feel free to leave any feedback, negative or positive. Current events $EVENT_MOUSE_IDLE - triggers when the mouse is idle $EVENT_MOUSE_MOVE - triggers when the mouse moves $EVENT_PRIMARY_CLICK - triggers when the primary button is clicked $EVENT_PRIMARY_DBLCLICK - triggers when the primary button is double clicked $EVENT_PRIMARY_RELEASED - triggers when the primary button is released $EVENT_PRIMARY_DOWN - triggers when the primary button is pressed $EVENT_PRIMARY_UP - triggers when the primaty button is not pressed $EVENT_SECONDARY_CLICK - same as primary conditions, but for this button $EVENT_SECONDARY_DBLCLICK - same as primary conditions, but for this button $EVENT_SECONDARY_RELEASED - same as primary conditions, but for this button $EVENT_SECONDARY_DOWN - same as primary conditions, but for this button $EVENT_SECONDARY_UP - same as primary conditions, but for this button $EVENT_MIDDLE_CLICK - same as primary conditions, but for this button $EVENT_MIDDLE_DBLCLICK - same as primary conditions, but for this button $EVENT_MIDDLE_RELEASED - same as primary conditions, but for this button $EVENT_MIDDLE_DOWN - same as primary conditions, but for this button $EVENT_MIDDLE_UP - same as primary conditions, but for this button $EVENT_X1_CLICK - same as primary conditions, but for this button $EVENT_X1_DBLCLICK - same as primary conditions, but for this button $EVENT_X1_RELEASED - same as primary conditions, but for this button $EVENT_X1_DOWN - same as primary conditions, but for this button $EVENT_X1_UP - same as primary conditions, but for this button $EVENT_X2_CLICK - same as primary conditions, but for this button $EVENT_X2_DBLCLICK - same as primary conditions, but for this button $EVENT_X2_RELEASED - same as primary conditions, but for this button $EVENT_X2_DOWN - same as primary conditions, but for this button $EVENT_X2_UP - same as primary conditions, but for this button Current properties $MOUSE_X - current mouse x $MOUSE_Y current mouse y $MOUSE_PREV_X - previous mouse x $MOUSE_PREV_Y - previous mouse y $MOUSE_VEL_X - current mouse x velocity $MOUSE_VEL_Y - current mouse y velocity Current functions _Mouse_RegisterEvent($iEventType, $sCallBack, $avArgs = -1) - registers a function to an event, use an array for arguments _Mouse_UnRegisterEvent($iEventType) - unregister a function from an event _Mouse_Update() - the main update loop, updates the mouse udf logic _Mouse_GetColor($iColorType, $hWnd = Default) - gets the current mouse xy pixel color, in 3 different color type available; decimal, hex and rgb Mouse UDF.zip
    1 point
  4. Here there is all that you need to know '?do=embed' frameborder='0' data-embedContent>>
    1 point
  5. Oh yes!! That gives a CPU usage of 1/5 comparing to previous script (the same cpu usage as AHK). It is also much faster as before. Thank you Manadar
    1 point
  6. agould09, It does, but I am very unhappy with the idea of developing code to read things that are not supposed to be read. I am sure you can understand that although I am sure you have no such intentions, others could use such code for less honest purposes. How does the software you are testing save the current/new password? Does it save a hash somewhere? If so then you could perhaps check the stored value to ensure that it had changed. But one thing is certain, we will not help with reading invisible passwords - they are made that way for a reason. M23 Edit: careca, Good call.
    1 point
  7. Being sufficiently ancient to recall CP/M, monochrome CRTs, and woolly mammoths, I thought I'd share something from the bad old days: FAT filesystems (FAT12, FAT16, FAT32). Still widely used in USB flashRAM, SD cards, RAMdisks, and microcontroller-based embedded systems, (F)ile (A)llocation (T)able filesystems are simple and robust, providing a great environment for learning how filesystems work. Moreover, many operating systems other than Windows can handle them, enabling data exchange between different platforms. That's the good part. I've often wondered why nobody had yet written a FAT UDF library for AutoIt. Now I know why. When a normally bone-dry tech page introduces FAT with the words "Welcome to Hell" you know you're in for a rough ride. It took me almost a year of grief and many, many wrecked (virtual) volumes to get to this first beta release. That's the bad part. Why was it so painful to develop, you rhetorically ask? The I/O itself is fairly straightforward, but backward compatibility, poor design choices and some blatant mistakes have produced a convoluted mess of rules with exceptions, exceptions to the exceptions, and exceptions to the exceptions to the exceptions (and in case you're wondering, no, I'm not talking about my own scripts here). It's like the Gregorian calendar, which has 365 days per year, unless the year is divisible by 4 (366), unless the year is also divisible by 100 (365), unless the year is also divisible by 400 (366). Add to that non-standard address-widths (paired 12-bit in FAT12, 28-bit in FAT32), file fragmentation, lost clusters, cross-, open-, and self-linked chaining errors, and the train wreck that is VFAT Long File Names support , and you've got yourself a challenge. The result is a main library called the FAT Suite (FATsuite.au3), to which I've added a large demo GUI called FAT Manager (FATman.au3, not to be confused with the famous superhero), plus my trusty MBR handler (BuildPartitionTable.au3), and a few sample image files with different types of FAT. If running older versions of AutoIt, you'll additionally need Yashied's outstanding WinAPIEx.au3. I've also gratefully incorporated two excellent UDFs by Ascend4nt and trancexx respectively (with acknowledgement, of course). Many thanks to you all! When you start FATman and load a volume, you'll see a pretty lame directory/file tree above a small log-window (ripped from my CodeScanner). Bog-standard menus allow you to copy, rename, remove files and dirs, etcetera. No big deal, right? You're not impressed. But please consider this: When FATman loads a volume (either from an image file or a physical drive) it is unmounted. As far as Windows is concerned, the volume is inaccessible to you. But your actions are not handled by the OS, but by the FATsuite UDFs. If you don't appreciate the significance of unmounted full access, then this library probably isn't for you. For my fellow codehounds, however, check out the main features below. And yes, it can be slow for large filled volumes with a small cluster size (especially the demo GUI tree refresh). But it also offers you full access to your files and other data, that is, more than Windows usually offers you. Main Features: FAT volume creation and (re)formatting (18 KB - 2 TB; slow for large volumes) visualising FAT architecture, with interactive tool (manipulate total size, cluster size, number of FAT copies) two-way file transfer between FAT volume and memory (UDF only, no GUI support) two-way file transfer between FAT volume and other, mounted (FAT/NTFS) volumes internal volume-, directory-, and file I/O (create/copy/move/truncate/remove/rename/filefind/edit filespecs) *physical* directory sorting by any criterion (unlike MicroSoft's "sorted" view of physically unsorted data) wiping files and physical removal of "deleted" files/subdirs in dir table and zeroing DataRegion clusters retrieving lost/deleted/damaged data clusters (with or without FAT reference) detecting/patching FAT chaining errors (cross-linked, open-ended, and circular chains) raw FAT I/O, including flipping CleanShutdown and Hard R/W-error bits manipulating bad clusters (single creation/single removal/bulk removal) with file chain rerouting determining cluster ownership for any defined FAT entry extracting all filesystem parameters, and editing some rawcopy image-to-volume and volume-to-image (imagefile or physical device) optional comparison/synchronisation of multiple FAT copies (the table, not the entire volume) File Find utility (UDF only, no GUI support) heavily annotated code for learning about FAT filesystem mechanics But beware, you can do enormous damage to your FAT volumes. For example, there's no soft-delete with recycle bin retrieval, and confirmation checks are few. Once you remove/wipe/truncate a file, it's gone forever, period. So please, please, please, read the FATsuite Remarks section before calling its UDFs; also read the annotations in the UDFs; study FATman's many examples; always work with imagefiles of which you keep multiple backup copies. Remember, it's a beta release ( glitches possible!); you may accidentally parse a wrong parameter at some point; and Murphy's Law always applies. FATsuite.v1.1.7z (AutoIt 3.3.12 compliant version 1.1; likely won't run in legacy AutoIt environments) FATimageExamples.7z Sample FAT image files (reduced in size) I hope this contribution helps to clarify how FAT filesystems work, and that you have fun playing with it, or find some other use(s) for it. RT PS Okay, I admit the mammoth was already slightly dead when I saw it, and had been for quite a while.
    1 point
  8. water

    help with FF.au3

    No. I activated it once and it is running just fine now.
    1 point
  9. No use for me, but good work.
    1 point
  10. Ah, actually, what surprised me the most. It's not the HotString UDF that is taking up any CPU at all, but rather Send that is taking up quite a bit (which is how I assume you tested it). A quick test I made based on remin's example is this which takes up no (0%) cpu on my machine. #include <HotString.au3> HotStringSet("\\btw", "example") HotStringSet("\\hi", "example") HotStringSet("exit", "_exit") While 1 Sleep(100) WEnd Func example($a) ConsoleWrite($a & @CRLF) EndFunc ;==>example Func _exit() Exit EndFunc
    1 point
  11. water

    help with FF.au3

    Which version of MozRepl do you run?
    1 point
  12. Danp2

    help with FF.au3

    Look at the settings under the Tools > MozRepl menu.
    1 point
  13. remin, It looks as if the AHK implementation is in its core code, while HotStrings is a UDF, so it is hardly surprising that there is a speed and CPU load difference. M23
    1 point
  14. Yes it seems to work fine now
    1 point
  15. This would still be possible but maybe the if/endif code is easier: #include <HotString.au3> Dim $arguments[2][2] $arguments[0][0] = "\\btw" $arguments[0][1] = "by the way" $arguments[1][0] = "\\hi" $arguments[1][1] = "hello" HotStringSet("\\hi", example) HotStringSet("\\btw", example) While 1 Sleep(100) WEnd Func example($hotstring) local $lengte = StringLen($hotstring) Send("{BACKSPACE " & $lengte & "}") For $i = 0 To UBound($arguments) - 1 if $arguments[$i][0] = $hotstring then send($arguments[$i][1]) endif Next EndFunc
    1 point
  16. Nice job! I'm glad you like it. The reason for doing it this way is to keep the functionality of this new feature similar to AutoIt's @HotKeyPressed macro. So when a programmer realizes HotKeySet won't be enough, he can replace HotKeySet with HotStringSet and use the first parameter of the function instead of @HotKeyPressed. HotKeySet("a", "hotKeyCallback") HotKeySet("b", "hotKeyCallback") While 1 Sleep(500) WEnd Func hotKeyCallback() Switch @HotKeyPressed Case "a" ; Do 1 Case "b" ; Do 2 EndSwitch EndFuncBecomes #include "HotStrings.au3" HotStringSet("abc", "hotKeyCallback") HotStringSet("def", "hotKeyCallback") While 1 Sleep(500) WEnd Func hotKeyCallback($HotKeyPressed) Switch $HotKeyPressed Case "abc" ; Do 1 Case "def" ; Do 2 EndSwitch EndFuncWith only minor changes.
    1 point
  17. Thanks Manadar This works great. Now I can put all hotstrings in one function: #include <HotString.au3> HotStringSet("\\hi", example) HotStringSet("\\btw", example) While 1 Sleep(100) WEnd Func example($hotstring) local $lengte = StringLen($hotstring) Send("{BACKSPACE " & $lengte & "}") If $hotstring = "\\hi" then Send("hello") EndIf If $hotstring = "\\btw" then Send("by the way") EndIf EndFunc Have you thought to add also the expanded text in HotStringSet? Like this: #include <HotString.au3> Dim $arguments[2] $arguments[0] = "hello" $arguments[1] = "by the way" HotStringSet("\\hi", example($arguments[0])) HotStringSet("\\btw", example($arguments[1])) While 1 Sleep(100) WEnd Func example($hotstring,$arguments) local $lengte = StringLen($hotstring) Send("{BACKSPACE " & $lengte & "}") Send($arguments) EndFunc This makes the if/endif hotstring control unnecessary.
    1 point
  18. careca

    New comer need help,,,,

    Like this maybe? AdlibRegister(func2, 600000) ;600000ms=600s=10min while 1 Call('func1') sleep(50) wend func func1() sleep(50) EndFunc;func1 func func2() beep() EndFunc;func2
    1 point
  19. That's what I just wanted to post
    1 point
  20. HaNdLoRdz, Use an Adlib function to refresh the page. And please give your threads sensible titles - everyone here is looking for help. M23 Edit: I almost forgot - © water for the above!
    1 point
  21. ruelas05, Even if it were possible, it is not something we would be prepared to support - thread locked. M23
    1 point
  22. Accidentally used _GDIPlus_ImageScale instead of _GDIPlus_ImageResize in previous release which causes a hard crash when resizing the image in "Resize Image" tab, added option to flood fill a color with transparent color (slow) and save the modified image. Br, UEZ
    1 point
  23. ControlSend is what is being read, not the screen of the login. If ControlSend sends it correctly, then the message box will show up. Your error checking is wrong.
    1 point
  24. Malkey

    Coding Question

    Here are some examples of Bit functions to help you answer your questions. Local $iNum = 43 ConsoleWrite("For " & $iNum & ":-" & @LF) For $i = 0 To 32 ;ConsoleWrite($i & " 0x" & hex(String(2 ^ $i),9) & @LF) If BitAND(2 ^ $i, $iNum) Then ConsoleWrite(" bit " & $i + 1 & ' is On ("1"). Equivalent decimal number is ' & BitAND(2 ^ $i, $iNum) & @LF) Next ConsoleWrite("BitOR(1, 2, 8, 32) = " & BitOR(1, 2, 8, 32) & @LF) ConsoleWrite("----------------------------" & @LF) ConsoleWrite($iNum & " " & DecToBin($iNum) & @LF) ConsoleWrite(BitXOR($iNum, 2 ^ (2 - 1)) & " " & DecToBin(BitXOR($iNum, 2 ^ (2 - 1))) & " Toggle 2nd bit BitXOR" & @LF) ConsoleWrite(BitOR($iNum, 2 ^ (3 - 1)) & " " & DecToBin(BitOR($iNum, 2 ^ (3 - 1))) & " Turn on 3rd bit BitOR" & @LF) ConsoleWrite(BitAND($iNum, BitNOT(2 ^ (4 - 1))) & " " & DecToBin(BitAND($iNum, BitNOT(2 ^ (4 - 1)))) & " Turn 4th bit off - BitAND($iNum, BitNOT(2 ^ (4 - 1)))" & @LF) Func DecToBin($dec) Local $temp While $dec >= 1 $temp = Int(Mod($dec, 2)) & $temp $dec /= 2 WEnd Return $temp EndFunc ;==>DecToBin #cs Results:- For 43:- bit 1 is On ("1"). Equivalent decimal number is 1 bit 2 is On ("1"). Equivalent decimal number is 2 bit 4 is On ("1"). Equivalent decimal number is 8 bit 6 is On ("1"). Equivalent decimal number is 32 BitOR(1, 2, 8, 32) = 43 ---------------------------- 43 101011 41 101001 Toggle 2nd bit BitXOR 47 101111 Turn on 3rd bit BitOR 35 100011 Turn 4th bit off - BitAND($iNum, BitNOT(2 ^ (4 - 1))) #ce
    1 point
  25. czardas

    Coding Question

    More or less the same as above, with some added comments. ; ; Attention: Only assign powers of 2 up to 2^30 because, with 32-bit integers, 2^31 is out of range. Local $iData0 = 2^0 ; = 1 Local $iData1 = 2^1 ; = 2 Local $iData2 = 2^2 ; = 4 Local $iData3 = 2^3 ; = 8 Local $iData4 = 2^4 ; = 16 ; Set bits 1, 4 and 5 Local $iFlag = BitOR($iData0, $iData3, $iData4) MsgBox(0, "Flag value = 25" , $iFlag = 25) ; Check the result ; Test which bits are set in the flag If BitAND($iFlag, $iData0) Then MsgBox(0, "", "1st bit is set") If BitAND($iFlag, $iData1) Then MsgBox(0, "", "2nd bit is set") If BitAND($iFlag, $iData2) Then MsgBox(0, "", "3rd bit is set") If BitAND($iFlag, $iData3) Then MsgBox(0, "", "4th bit is set") If BitAND($iFlag, $iData4) Then MsgBox(0, "", "5th bit is set") ; Now let's remove $iData4 from the flag $iFlag = BitXOR($iFlag, $iData4) MsgBox(0, "New flag value = 9" , $iFlag = BitOR($iData0, $iData3)) ; Check the result ; Fixed a mistake in comments.
    1 point
  26. BrewManNH

    Coding Question

    You'd use the BitAND function and test to see if a bit is set or not. Similar to the way that the _GUIToolTip_BitsToTTF UDF converts the bits set to text. Func _GUIToolTip_BitsToTTF($iFlags) Local $iN = "" If BitAND($iFlags, $TTF_IDISHWND) <> 0 Then $iN &= "TTF_IDISHWND," If BitAND($iFlags, $TTF_CENTERTIP) <> 0 Then $iN &= "TTF_CENTERTIP," If BitAND($iFlags, $TTF_RTLREADING) <> 0 Then $iN &= "TTF_RTLREADING," If BitAND($iFlags, $TTF_SUBCLASS) <> 0 Then $iN &= "TTF_SUBCLASS," If BitAND($iFlags, $TTF_TRACK) <> 0 Then $iN &= "TTF_TRACK," If BitAND($iFlags, $TTF_ABSOLUTE) <> 0 Then $iN &= "TTF_ABSOLUTE," If BitAND($iFlags, $TTF_TRANSPARENT) <> 0 Then $iN &= "TTF_TRANSPARENT," If BitAND($iFlags, $TTF_PARSELINKS) <> 0 Then $iN &= "TTF_PARSELINKS," Return StringTrimRight($iN, 1) EndFunc ;==>_GUIToolTip_BitsToTTF This tests to see if the $iFlags variable is set to any combination of different settings. The function checks for each possible setting and sets a text string identifying that that bit is set.
    1 point
  27. Melba23

    _ArrayExtract Issue

    Shane0000, All fixed. M23
    1 point
  28. AZJIO

    AutoIt Snippets

    _JumpRegistry('HKEY_CURRENT_USERSoftwareMicrosoftNotepad') Func _JumpRegistry($sKey) Local $hWnd, $hControl, $aKey, $i If Not ProcessExists("regedit.exe") Then Run(@WindowsDir & 'regedit.exe') If Not WinWaitActive('[CLASS:RegEdit_RegEdit]', '', 3) Then Return SetError(1, 1, 1) EndIf If Not WinActive('[CLASS:RegEdit_RegEdit]') Then WinActivate('[CLASS:RegEdit_RegEdit]') $hWnd = WinGetHandle("[CLASS:RegEdit_RegEdit]") $hControl = ControlGetHandle($hWnd, "", "[CLASS:SysTreeView32; INSTANCE:1]") $aKey = StringSplit($sKey, '') $sKey = '#0' For $i = 1 To $aKey[0] ControlTreeView($hWnd, "", $hControl, "Expand", $sKey) $sKey &= '|' & $aKey[$i] Next ControlTreeView($hWnd, "", $hControl, "Expand", $sKey) ControlTreeView($hWnd, "", $hControl, "Select", $sKey) EndFunc
    1 point
  29. Could be used to convert to binary (for example). Also allows padding of the result. ConsoleWrite(_ToBase(15, 2, 8) & @CRLF) ConsoleWrite(_ToBase(257, 3) & @CRLF) ConsoleWrite(_ToBase(255, 4) & @CRLF) ConsoleWrite(_ToBase(932, 8) & @CRLF) ConsoleWrite(_ToBase(65535, 16, 8) & @CRLF) Exit Func _ToBase($iNumber, $iBase, $iPad = 1) Local $sRet = "", $iDigit Do $iDigit = Mod($iNumber, $iBase) If $iDigit < 10 Then $sRet = String($iDigit) & $sRet Else $sRet = Chr(55 + $iDigit) & $sRet EndIf $iNumber = Int($iNumber / $iBase) Until ($iNumber = 0) And (StringLen($sRet) >= $iPad) Return $sRet EndFunc WBD
    1 point
  30. You're making it more troubles attraction than it is: #include <GuiConstants.au3> Dim $hGUI = GUICreate('Test', 240, 140) Dim $GUIMenu = GUICtrlCreateContextMenu() Dim $About_Menu = GUICtrlCreateMenuItem('About', $GUIMenu) Dim $Exit_Menu = GUICtrlCreateMenuItem('Exit', $GUIMenu) Dim $Buttons[4] = [3], $Menus[4][3] = [[3,2,0]] For $i = 1 To $Buttons[0] $Buttons[$i] = GUICtrlCreateButton('#' & $i, 20+($i-1)*70, 40, 50, 50) Local $Button_Menu = GUICtrlCreateContextMenu($Buttons[$i]) For $j = 0 To $Menus[0][1] $Menus[$i][$j] = GUICtrlCreateMenuItem('B' & $i & '->#' & $j+1, $Button_Menu) Next Next GUISetState() While 1 Local $Msg = GUIGetMsg() Switch $Msg Case $About_Menu MsgBox(0x40, 'Title', '(\/)' & @LF & '(oO)' & @LF & '(")(")') Case $Exit_Menu, $GUI_EVENT_CLOSE ExitLoop Case Else _WhoCalls($Msg, $Buttons, $Menus) EndSwitch Sleep(20) WEnd GUIDelete() Func _WhoCalls($iIDFrom, ByRef $Btns, ByRef $Mns) For $i = 1 To $Btns[0] If $iIDFrom = $Btns[$i] Then MsgBox(0x40, 'Button Message!', 'From button: #' & $i) ExitLoop EndIf For $j = 0 To $Mns[0][1] If $iIDFrom = $Mns[$i][$j] Then MsgBox(0x40, 'Menu Message!', 'From button: #' & $i & @LF & 'From menu: #' & $j+1) ExitLoop(2) EndIf Next Next EndFunc ';]
    1 point
×
×
  • Create New...