Jump to content

Leaderboard

Popular Content

Showing content with the highest reputation on 04/12/2015 in all areas

  1. ConsoleWrite(FileGetVersion('winver.exe') & @LF) AutoIt already searches path.
    2 points
  2. Here's how I'd do it. #include <ButtonConstants.au3> #include <GUIConstantsEx.au3> #include <WindowsConstants.au3> Global $Form1 = GUICreate("Form1", 616, 439, 192, 124) GUICtrlCreateGroup("Group1", 246, 91, 254, 186) Global $DummyStart = GUICtrlCreateDummy() ; get start of control creation control id GUICtrlCreateRadio("Radio1", 312, 108, 113, 17) GUICtrlCreateRadio("Radio2", 312, 231, 113, 23) GUICtrlCreateRadio("Radio3", 312, 211, 113, 17) GUICtrlCreateRadio("Radio4", 312, 149, 113, 17) GUICtrlCreateRadio("Radio5", 312, 190, 113, 17) GUICtrlCreateRadio("Radio6", 312, 129, 113, 17) GUICtrlCreateRadio("Radio7", 312, 169, 113, 17) Global $DummyEnd = GUICtrlCreateDummy() ; get end of control creation id GUICtrlCreateGroup("", -99, -99, 1, 1) Global $Button1 = GUICtrlCreateButton(" Hide ", 273, 372, 75, 25) GUISetState(@SW_SHOW) While 1 Sleep(100) $msg = GUIGetMsg() Switch $msg Case $Button1 Button1Click() Case $GUI_Event_Close Exit EndSwitch WEnd Func Button1Click() Local Static $toggle = True $toggle = Not $toggle For $Loop = $DummyStart + 1 To $DummyEnd - 1 If $toggle Then GUICtrlSetState($Loop, $GUI_SHOW) GUICtrlSetData($Button1, " Hide ") Else GUICtrlSetState($Loop, $GUI_HIDE) GUICtrlSetData($Button1, " Show ") EndIf Next EndFunc ;==>Button1Click Easily adaptable to any script if the controls to be hidden, are created in sequence.
    2 points
  3. trancexx

    WinHTTP functions

    The other day mikeytown2 posted one post in HTTP UDF's thread that got me thinking if there is better (different) method to send requests through the HTTP protocol to HTTP servers. There is Winhttp.dll that ships with windows and that is its main purpose. I couldn't find any examples of using this dll in AutoIt, so I came up with this. Microsoft about Windows HTTP Services: Microsoft Windows HTTP Services (WinHTTP) provides developers with an HTTP client application programming interface (API) to send requests through the HTTP protocol to other HTTP servers... .. blah, blah, and so on... This is an example of getting page header: #include "WinHttp.au3" Opt("MustDeclareVars", 1) ; Open needed handles Local $hOpen = _WinHttpOpen() Local $hConnect = _WinHttpConnect($hOpen, "msdn.microsoft.com") ; Specify the reguest: Local $hRequest = _WinHttpOpenRequest($hConnect, Default, "en-us/library/aa384101(VS.85).aspx") ; Send request _WinHttpSendRequest($hRequest) ; Wait for the response _WinHttpReceiveResponse($hRequest) Local $sHeader = _WinHttpQueryHeaders($hRequest) ; ...get full header ; Clean _WinHttpCloseHandle($hRequest) _WinHttpCloseHandle($hConnect) _WinHttpCloseHandle($hOpen) ; Display retrieved header MsgBox(0, "Header", $sHeader)Everything you need to be able to use this UDF can be found at WinHttp site. Remember, basic understanding of the HTTP protocol is important to use this interface. ProgAndy, trancexx WinHttp.au3 is completely free and no one has right to charge you for it. That's very important. If you feel WinHttp.au3 was helpful to you and you wish to support my further work you can donate to my personal account via PayPal address: trancexx at yahoo dot com I will appreciate that very much. Thank you in advance! :kiss:
    1 point
  4. wakillon

    Chiptunes Players

    I love chiptune music, but BASS only support XM, IT, S3M, MOD, MTM, UMX and MO3 file format for MOD music. 1 | Nintendo NES and SNES Sound File Players May be you already have some files with extension nsf, nsfe, spc or rsn (unzip rsn files for get spc collection files inside) but you can't play them in a AutoIt script ? So I searched around a bit, and found 2 DLL ( nsf_player.dll and spc_player.dll ) for play Nintendo NES and SNES Sound Files. Interest of those DLL is that they can play from file path or binary data, avoiding temp files. Dll and audio files are embedded in scripts for permit you to test them right away. Some info/download links are in front of each script. 2 | ModPlug Player Another dll found : npmod32.dll who support mod, s3m, xm, med, it, s3z, mdz, itz, xmz and wav files. Interest : it can play some rares chiptune formats, you can also pause, set volume and set position. Inconvenient : do not load from binary datas. Dll and audio files are embedded in script and i have added a gui for permit you to try right away ! Warning : Do not work on Win8. 3 | ZXTune Player 2 (basszxtune.dll v2.4.5) UPDATE of 23 DEC 2016 Using BASSZXTUNE chiptune support for BASS ( Support as0, asc, ay, ftc, gtr, psc, psg, psm, pt1, pt2, pt3, sqt, st1, s, st3, stc, stp, ts, txt, vtx, ym, chi, dmm, dst, m, sqd, str, sid, cop, tf0, tfc, tfd, tfe, $b, $m, ahx, ayc, bin, cc3, d, dsq, esv, fdi, gam, gamplus, gbs, gym, hes, hrm, hrp, lzs, msp, mtc, nsf, nsfe, p, pcd, sap, scl, spc, szx, td0, tlz, tlzp, trd, trs, vgm ) Interest : it can play lot of rares chiptune formats, while benefiting from all bass functions. Inconvenient : dll size.(5860ko) Dll and audio files are embedded in script. 4 | TitchySID Player Files and dll are loaded in memory. Interest : dll size (8ko), you can Play/Stop/Pause/Resume and choose which subsong to play. Inconvenient : only SID audio files supported ( PSID & RSID) Dll and audio files are embedded in script. Tested under Win7 and Win8. Edit : added a Sid header viewer : SidHeaderViewer.au3 5 | MiniFmod Player Interest : dll size (20ko) Inconvenient : only xm audio files supported. 6 | Npnez Player Using npnez.dll (88ko) for play Gameboy Sound System audio files and some others ( kss, hes, nsf, ay, gbr, gbs, gb, nsd, sgc ) Interest : Can be loaded in memory, subsong can be set and volume can be adjusted ( perfect for create a fade when exiting ) Inconvenient : for an unknow reason, only 20% of my hes collection is playable... 7 | µFMOD Player Interest : dll size (10ko), can be loaded in memory, support Play/Stop/Pause/Resume actions and volume can be adjusted ( perfect for create a fade when exiting ) Inconvenient : only xm audio files supported. 8 | MagicV2m Player Interest : dll size (20ko), Play/Stop/IsPlay/SetAutoRepeat/Progress Inconvenient : only v2m audio files supported, V2mPlayStream is not reliable, so prefer V2mPlayFile instead. 9 | OSMEngine Player OSMEngine.dll (80 ko)(Oldskool Musics Engine) permit to play snd, sndh, fc, fc4, fc14 and some rare jam audio files from Amiga/Atari ST(E) Interest : audio can be loaded in memory, and Pause/Resume/SetVolume/GetInfos are available Inconvenient : none at the moment. 10 | Ayfly Player Ayfly.dll (268 ko) is a AY-891x emulator and player who support the following tracker formats : aqt, asc, ay, fxm, gtr, psc, psg, pt1, pt2, pt3, sqt, stc, stp, vtx, ym and zxs (ZX Spectrum Emulator Snapshot) files. Interest : SetVolume/GetInfos are available Inconvenient : a function named "ay_initsongindirect" for load module in memory exists, but due to the poor documentation provided i do not succeed to get it to work... 11 | GMGME Player GMGME.dll is a emulated music DLL that allows you to play ay, gbs, gym, hes, kss, nsf/nsfe, sap, spc and vgm files. Interest : Can play ATARI SAP files (only type B and C) , Set Volume and Set Tempo are available Inconvenient : Dll Size (and his imports) , and audio files can not be loaded in memory. 12 | SC68 Player sc68replay.dll (166 ko) is a Freebasic DLL compiled from "sc68replay" src that allows you to play SC68 (Atari ST and Amiga audio formats) files. Interest : Can play from file and memory Inconvenient : Unfortunatelly for an unknown reason not all sc68 files are supported. 13 | Extended Module Player LibXmp.dll (272 ko) can "read" xm, mod, it, s3m, med, 669 but also some rares formats abk, amd, amf, dbm, digi, dtm, emod, far, flx, fnk, gdm, hsc, imf, j2b, liq, m15, mdl, mfp, mgt, mtm, mtn, okt, psm, ptm, rad, rtm, sfx, smp, stim, stm, stx, ult, umx, wow, ym3812 Despite its name, it's not a "player" but a library that renders module files to RAW PCM data. So the interest in this script was to find a way to convert those raw datas into a "playable" sound. With Waveform Audio Interface i create a pseudo Wav header who permit to play datas as a Wav file. Interest : Can play from file and memory Inconvenient : Time to render datas (depends of file size) 14 | LibModPlug Player LibModPlug.dll (102 ko) can "read" xm, it, mod, s3m, med, 669 and also amf, ams, dbm, dmf, dsm, far, j2b, mdl, mt2, mtm, okt, psm, ptm, stm, ult, umx. As LibXmp.dll, it's a library that renders module files to RAW PCM data. For this one, i create a real binary wave header for be able to play it easily from memory with winmm.dll PlaySoundW function. Interests : Can play from file and memory, and have some nice sound effects : Surround, MegaBass and Reverb (used in script example) It can also replace modplug player(2) for Win 8+ users Inconvenient : Time to render datas (depends of file size) 15 | AdPlug Player AdPlug.dll ( 69ko ) is an AdLib sound player library who is able to play the following files type : A2M, ADL, AMD, BAM, CFF, CMF, D00, DFM, DMO, DRO, DTM, HSC, HSP, IMF, KSM, LAA, LDS, M, MAD, MID, MKJ, MSC, MTK, RAD, RAW, RIX, ROL, S3M, SA2, SAT, SCI, SNG, XAD, XMS, XSM For this one, time to render datas is to long, so i needed to find an other way for play modules. Using Bass.dll and particulary the "BASS_StreamPutData" function i succeeded to play module in loop while rendering it. Both DLL are loaded in memory, and 16 different module types are available in the script. No includes/files needed. Just run it. Warning : for a unique file extension (example .sng), it's sometimes possible to have several filetypes from different trackers ! AdPlug.dll Imports : msvcp71.dll, msvcr71.dll in C:\Windows\SysWOW64 ( VC Redist Installer ) Interests : Can read some obscure rare formats. Inconvenient : Can not read from memory 16 | LibMikmod Player LibMikmod.dll (85ko) will currently play the following common and not so common formats : 669, AMF, DSM, FAR, GDM, IMF, IT, MED, MOD, MTM, S3M, STM, STX, ULT, UNI, XM Interests : Can load from memory Inconvenient : only for full-screen applications, because if the application has not the focus sound is muted Downloads are available in the download section Dedicated to chiptune Lovers ! Music Links : asma.atari.org woolyss.com chipmusic.org demozoo.org modarchive.org modules.pl keygenmusic.net zxtunes.com mazemod.org amigaremix.com pouet.net plopbox.eu Modland
    1 point
  5. Kyan

    TP-LINK Manager v0.7.1

    Hello! Been working on this, SNMP UDF is a bit incomplete, but found a way to make it work as I wanted. Features Restarts wan connection Retrieve connected devices (Local IP/MAC address/device name) Displays: router external ip | up time | brand & model I made this for my home router, but probably works on others models and brands (except the restart function, that is a TP-LINK exclusive xD) TP-Link Manager v0.7.1.zip (v0.7 - 38 downloads) #Changelog
    1 point
  6. wakillon

    Chiptunes Players

    Thanks ! I knew it'll please you ! I didn't worked on C64, but i love electronic music. You can get an updated version (1.1) of the asm source code here And i have use Masm32 for compile it to a dll. Glad to help you !
    1 point
  7. wakillon

    Chiptunes Players

    No, it's a plugin. Vielleicht ich habe ein geschenk für sie, mein freund ! Seit 3 Wochen habe ich für Sid-Player für Sie gesucht. Und vor 2 Tagen fand ich ein Assembler-Quellcode. Aber ich weiß nicht, alles in Assembler! Dann ich gestartet und versucht, es unter masm32 kompilieren. Und nach einigen Stunden und vielen erfolglosen versuchen, Bingo! If you find the previous one awesome, what will you think about this one ! See first post !
    1 point
  8. wakillon

    Chiptunes Players

    Added ZXTune Player who can, among other things, read SID audio files !
    1 point
  9. Try this: Global $oErrorHandler = ObjEvent("AutoIt.Error", "ObjErrorHandler") MsgBox(0, "Test", WMI_GetDomainName(".")) Func WMI_GetDomainName($sHost, $sUsr = "", $sPass = "") If $sHost = "." Then $sHost = @ComputerName Local $ping = Ping($sHost, 250) If @error Then Return SetError(1, 0, -1) Local $objWMILocator = ObjCreate("WbemScripting.SWbemLocator") Local $objWMIService = $objWMILocator.ConnectServer($sHost, "\root\cimv2", $sUsr, $sPass, "", "", 128) If @error Then Return SetError(2, 0, -1) Local $colItems = $objWMIService.ExecQuery("SELECT * FROM Win32_ComputerSystem", "WQL", 0x30) If IsObj($colItems) Then For $objItem In $colItems Return $objItem.Domain Next Else Return SetError(3, 0, -1) EndIf Return 0 EndFunc Func ObjErrorHandler() ConsoleWrite( "A COM Error has occured!" & @CRLF & @CRLF & _ "err.description is: " & @TAB & $oErrorHandler.description & @CRLF & _ "err.windescription:" & @TAB & $oErrorHandler & @CRLF & _ "err.number is: " & @TAB & Hex($oErrorHandler.number, 8) & @CRLF & _ "err.lastdllerror is: " & @TAB & $oErrorHandler.lastdllerror & @CRLF & _ "err.scriptline is: " & @TAB & $oErrorHandler.scriptline & @CRLF & _ "err.source is: " & @TAB & $oErrorHandler.source & @CRLF & _ "err.helpfile is: " & @TAB & $oErrorHandler.helpfile & @CRLF & _ "err.helpcontext is: " & @TAB & $oErrorHandler.helpcontext & @CRLF _ ) EndFunc If needed provide the credentials for the remote host. Further please open next time a new topic for your issue.
    1 point
  10. #include <MsgBoxConstants.au3> #include <WinAPI.au3> MsgBox($MB_SYSTEMMODAL, "", _WinAPI_PathFindOnPath("winver.exe")) A better way of finding winver.exe without hardcoding all possible paths.
    1 point
  11. Example: MSDN for Excel 2010.
    1 point
  12. Gianni

    reading From the last

    .... your code has a bug, in some cases returns the same string... Local $original = "radar" Local $reversed = StringReverse($original) MsgBox(0, 0, "Originl:" & @TAB & $original & @CRLF & "Reversed:" & @TAB & $reversed)
    1 point
  13. see if this fits your needs. Func OsVersion() If FileExists(@WindowsDir & '\winver.exe') Then Return FileGetVersion(@WindowsDir & '\winver.exe') ElseIf FileExists(@WindowsDir & '\System\winver.exe') Then Return FileGetVersion(@WindowsDir & '\System\winver.exe') ElseIf FileExists(@WindowsDir & '\System32\winver.exe') Then Return FileGetVersion(@WindowsDir & '\System32\winver.exe') ElseIf FileExists(@WindowsDir & '\SysWOW64\winver.exe') Then Return FileGetVersion(@WindowsDir & '\SysWOW64\winver.exe') Else Return "0.0.0.0" EndIf EndFunc ;==>OsVersion
    1 point
  14. as always need to use the search field in the forum Windows 9 has never existed exactly for this reason, there is confusion (problems) between WinNT9 and WinNT95 (at least so said microsoft officially) Ciao.
    1 point
  15. water

    _Excel_RangeRead help

    I do not see _Excel_Open in your code. To get the active cell you would use $oExcel.ActiveCell. $oExcel is the application object as returned by _Excel_Open.
    1 point
  16. Times HAVE changed. I grew up in a time where you actually had to ride your bicycle to the library to look up something in a book, which you in turn had to look up using some sort of enormous rolodex. Where you had to actively and secretly search for your father's porn stash (which your and your friends' fathers invariably hid behind that stack of 33 1⁄3 rpm LP records in that dusty hallway shelf ) Where it was normal to type in 20 pages of BASIC code from a magazine into your TRS-80 to play an ascii-based hangman. Where you needed to fold open a big paper map to fumble your way over an unknown road. Etc.. Right now, you just clicketyclick everything into one of your magical machines and blammo, you get everything you ask for on your billions-of-colors multimonitor setup and store it on your SSD that easily reads or writes TWO BILLION bits of data per damn second. While watching free full-hd youtube on the other monitor. And still there are many people who think even that's too much work. Until that point I agree with guiness and jchd. Laziness and expecting something-for-nothing indeed runs rampant. BUT... Many things still take a lot reading and effort to puzzle out before you're able to reach your own goal. The power of the technology grows and evolves, but so do the possibilities to use it and the goals to reach with it, and so does the veritable ocean of information you have to wade through before you get the actual information 1. applicable to your question and 2. written in just that way that hits your spot. Some people are much more capable of that wading than others, and some more people get turned off by that and give up altogether. Weakness/laziness? Perhaps, often even, but it's also often just a question of getting lost in that ocean just because it looks or feels intimidating. Different things come easily to different people. In this case, you'll notice that Kor never asked for anyone to code anything for him, and he posted the code that he tried. He has obviously already tried to use information available elsewhere. Those are the only two things that everyone clamors for on this forum when someone misforms a question. He asked for information on a very specific piece of functionality, which to me looks suspiciously much like someone who IS actually willing to learn something. So, to facilitate that, both me and Jake did our best to come up with an explanation(s) we thought could actually help. I don't understand what's so wrong with that. Sorry for the long story again. I should really go to bed. Have a nice day all
    1 point
  17. Awesome Jake That was exactly the kind of answer that most people give to these questions because it's the best and most thorough one. The problem with it is that it requires not one but two types of math that few people ever touch, namely boolean algebra and number systems. Even many programmers only touch those subject (s)lightly. If you're just, kinda, an occasional developer, you may not want to delve into that and just kinda "know the BitAnd trick". That approach is seldomly used in explanations of this subject which is why I wrote some Ok, so here it is as concisely as I can put it: The BitAnd Trick, by SadBunny 1) Assign a distinct power of 2 to each flag. 2) Specify the flags that you want to turn ON by simply adding up the powers of two that correspond to them. This leads to a certain integer X. 3) To see if a certain flag Y is on, check whether BitAnd(X, Y) gives a non-zero value.
    1 point
  18. This is a good question, but a hard response! I think of it as a light switch. Binary is either a 0 or 1 (aka Base 2) where as our numbering system is Base 10 or 0-9 Example in base 10: We have the 1's place, 10's place, 100's place ect. (base 10 increments by ten each place you move) 1362 means <- we have 2 1's, 60 10's, 3 100's and 1 1000. Add it all up and you get 1362. Example in base 2: We have 1's place, 2's place, 4's place, 8's place, 16's place ect. (each place increments by 2) 101 0101 0010 means <- we have: 0 1's 1 2's 0 4's 0 8's 1 16's 0 32's 1 64's 0 128's 1 256's 0 512's 1 1024's So add up each of the places that had a 1 (2+16+64+256+1024 = 1362) In a nutshell that's binary vs decimal Binary is used for many things related to computers because it is, in it's simplest form a logical 2 choice state (on off, 0 1, true false etc.) Think of a light switch - you could use binary to control it because a 1 can mean "on" and a 0 can mean "off" Decimal numbers can not do this In terms of programming as others have said it is used to decipher which flags you have set and it is done very specific to the particular to the item you are referring to. Normally you are looking at something like: https://msdn.microsoft.com/en-us/library/windows/desktop/ms632612(v=vs.85).aspx There is a flags param with a type UINT (unsigned int) If you convert each of those Hex values to Binary you'll see that each one is unique 0000 0000 0000 0001 0000 0000 0000 0010 0000 0000 0000 0100 0000 0000 0000 1000 0000 0000 0001 0000 0000 0000 0010 0000 0000 0000 0100 0000 0000 0000 1000 0000 etc etc There is only ever a one bit enabled that designates each flag. So the Bitand does multiplication on the bits it is comparing and BitOR does a logical "or" meaning, if there is a 1 in either position the answer is 1, otherwise its a 0. Example bitAnd: Value we are looking at: 0000 1010 1110 0001 BitAnd Value: 1111 1111 0000 0001 *___________________ Multiply it together. 0000 1010 0000 0001 This is basically used to "mask" the original value only allowing certain flags to get through. So lets say a huge set of flags are coming through and you REALLY only care about 2 of them, you could mask all the rest and watch just the 2 bits you cared about, convert that to decimal and test for that number in your code. Example bitOR: value we are looking at: 0000 0000 0000 0000 BitOR Value: 0000 0000 1110 0011 ____________________ Or them all together 0000 0000 1110 0011 Looking at something like a control this would turn "on" certain aspects of it where there was a 1. Obviously this is hard to decipher, so the term "constants" come into play. They assign binary values to constants so us humans can more easily read what flags we are setting. Something like: GUICtrlCreateTreeView(0, 25, 175, 678, BitOR($TVS_HASBUTTONS, $TVS_HASLINES, $TVS_LINESATROOT, $TVS_SHOWSELALWAYS),$WS_EX_CLIENTEDGE) would look a little hard to read if it just said: GUICtrlCreateTreeView(0, 25, 175, 678, 10110110101,1) <- fake flags set, but you get the idea of Constants vs. just using a Bin or Hex value here. Either way it will work fyi as long as it is getting binary or hex (whatever the item is calling for in that parameter) typically its a hex number, that the system then converts to binary internally. Long winded haha but maybe it will help?
    1 point
  19. jchd

    REGEX help

    This useful site explains it all thusly: /(?mx) ^ ; \s+ (\w+) \s+ = \s+ (.+) $/ (?mx) Match the remainder of the pattern with the following options: m modifier: multi-line. Causes ^ and $ to match the begin/end of each line (not only begin/end of string) x modifier: extended. Spaces and text after a # in the pattern are ignored ^ assert position at start of a line ; matches the character ; literally \s+ match any white space character [\r\n\t\f ] Quantifier: + Between one and unlimited times, as many times as possible, giving back as needed [greedy] 1st Capturing group (\w+) \w+ match any word character [a-zA-Z0-9_] Quantifier: + Between one and unlimited times, as many times as possible, giving back as needed [greedy] \s+ match any white space character [\r\n\t\f ] Quantifier: + Between one and unlimited times, as many times as possible, giving back as needed [greedy] = matches the character = literally \s+ match any white space character [\r\n\t\f ] Quantifier: + Between one and unlimited times, as many times as possible, giving back as needed [greedy] 2nd Capturing group (.+) .+ matches any character (except newline) Quantifier: + Between one and unlimited times, as many times as possible, giving back as needed [greedy] $ assert position at end of a line
    1 point
×
×
  • Create New...