Jump to content

Leaderboard

Popular Content

Showing content with the highest reputation on 04/11/2014 in all areas

  1. Here a workaround: ;coded by UEZ build 2014-04-11 #include <GDIPlus.au3> #include <GUIConstantsEx.au3> #include <WindowsConstants.au3> _GDIPlus_Startup() Global Const $iW = 128, $iH = 128, $fCenter = $iW / 2, $iPenSize = 2, $iBGColor = 0xABCDEF Global Const $hGUI = GUICreate("", $iW, $iH, -1, -1, $WS_POPUP, BitOR($WS_EX_TOPMOST, $WS_EX_LAYERED, $WS_EX_APPWINDOW)) GUISetBkColor($iBGColor, $hGUI) GUISetState(@SW_HIDE, $hGUI) _WinAPI_SetLayeredWindowAttributes($hGUI, $iBGColor) Global $tGDIp = DllStructCreate("ptr Graphics;ptr Bitmap;ptr Context;ptr Pen") $tGDIp.Graphics = _GDIPlus_GraphicsCreateFromHWND($hGUI) $tGDIp.Bitmap = _GDIPlus_BitmapCreateFromGraphics($iW, $iH, $tGDIp.Graphics) $tGDIp.Context = _GDIPlus_ImageGetGraphicsContext($tGDIp.Bitmap) _GDIPlus_GraphicsSetSmoothingMode($tGDIp.Context, 2) $tGDIp.Pen = _GDIPlus_PenCreate(0xFF000000, $iPenSize) Global Const $hDll = DllOpen("ntdll.dll"), $iMicroSeconds = 1500 Global $tStruct = DllStructCreate("int64 time;") HotKeySet("{F9}", "ShowLocation") HotKeySet("+{Esc}", "_Exit") ;shift + ESC terminates the script GUISetState(@SW_SHOW, $hGUI) Do Until Not Sleep(1000000) Func _Exit() _GDIPlus_GraphicsDispose($tGDIp.Context) _GDIPlus_GraphicsDispose($tGDIp.Graphics) _GDIPlus_BitmapDispose($tGDIp.Bitmap) _GDIPlus_PenDispose($tGDIp.Pen) GUIDelete() _GDIPlus_Shutdown() DllClose($hDll) Exit EndFunc ;==>_Exit Func ShowLocation() Local $i Local Static $bRunning = False If Not $bRunning Then $bRunning = True WinMove($hGUI, "", MouseGetPos(0) - $fCenter, MouseGetPos(1) - $fCenter) For $i = 0 To ($iW - $iPenSize) / 2 _GDIPlus_GraphicsClear($tGDIp.Context, 0xE0000000 + $iBGColor) _GDIPlus_GraphicsDrawEllipse($tGDIp.Context, $i, $i, ($iW - $iPenSize) - 2 * $i, ($iW - $iPenSize) - 2 * $i, $tGDIp.Pen) _GDIPlus_GraphicsDrawImageRect($tGDIp.Graphics, $tGDIp.Bitmap, 0, 0, $iW, $iH) $tStruct.time = -1 * ($iMicroSeconds * 10) DllCall($hDll, "dword", "ZwDelayExecution", "int", 0, "struct*", $tStruct) Next _GDIPlus_GraphicsClear($tGDIp.Graphics, 0xFF000000 + $iBGColor) $bRunning = False EndIf EndFunc ;==>ShowLocation Press F9 to show cursor position, Shift+Esc to terminate script. Br, UEZ
    1 point
  2. The examples in _Word_DocRangeSet.au3 should give you an idea. Use function _Word_DocAttach to connect to an already open Word document.
    1 point
  3. Hi, Welcome to the autoit forum One simple way is to check if the file already exists on your computer : ; Assign a Local variable the registration path of the file to download Local $sFile = @ScriptDir & "\myfile.txt" ; If the file does not exists locally ; You can also check if the sizes are equal using FileGetSize and InetGetSize. If FileExists($sFile) = 0 Then ; Download it InetGet("http://example.com/myfile.txt", $sFile) EndIf Edit : Don't forget to read the helpfile And please use a significant thread title next time, we already know you "Need help" Br, FireFox.
    1 point
  4. JohnOne

    Creating a DLLStruct.

    Probably a byte array of size BinaryLen("0xF0B2A0DA2049BCDAE010A02ACDE010940AB102142B")
    1 point
  5. Now, that took a while ... and as always the attached proof-of-concept* lacks any sensible error checking * Edit: And if anyone wonders what it does, it writes a unicode ID3v2 tag. The call to "ID3V2SetFormatAndEncodingW" is missing in the original UDF. #include <AudioGenie3_v2.au3> ; provide "_in.mp3" in scriptdir for testing ; Copy original file to test file FileCopy(@ScriptDir & "\_in.mp3", @ScriptDir & "\_out.mp3", 1) Local $sFile = @ScriptDir & "\_out.mp3" _AudioGenie3_Start() ; Unicode test string Local $sString_org = "Кириллица-Test" #region Set ID3V2 Unicode String Local $rc = DllCall($_AudioGenie3DLLHandle, "int", "AUDIOAnalyzeFileW", "wstr", $sFile) ; open file DllCall($_AudioGenie3DLLHandle, "uint", "ID3V2SetFormatAndEncodingW", "uint", 0, "uint",1) ; <<< !!!! this needs to be set explicitly ; ID3V2SetFormatAndEncodingW - Parameters ; #1 = format ; 0=bestehendes Format 1=id3v2.2 2=id3v2.3 3=id3v2.4 ; #2 = encoding ; 0= ISO-8859-1 1=UTF-16 mit BOM 2=UTF-16 ohne BOM 3=UTF-8 DllCall($_AudioGenie3DLLHandle, "none", "ID3V2SetTextFrameW", "uint", String(Dec(_StringToHex("TALB"))), "wstr", $sString_org) ; write string $rc = DllCall($_AudioGenie3DLLHandle, "int", "ID3V2SaveChangesW") ; save and close file #endregion ; Read Test output Local $s_Output For $x = 1 To 15 $s_Output &= _AudioGenie3_ReadID3Tag($sFile, $x) & @CRLF Next MsgBox(0,"AudioGenie Test", $s_Output) _AudioGenie3_Stop() _AudioGenie_v2.zip
    1 point
  6. Sorry to keep this alive, but just to clarify. 1. declaring: $var =0 or dim $var is the same. 2.$var=0 or dim $var will normally automatically assign itself to global $var 3. if no global $var exists, then using dim $var/$var=0 inside a function will automatically be the same as local $var I've seen a few example scripts where the varibles are declared using dim at the top of the script. I assume that using global at the beginning of the script then has the same effect. this seems like a difficult concept, I think I'm getting it though. Thanks for the pointers and great examples.
    1 point
×
×
  • Create New...