Jump to content

Leaderboard

Popular Content

Showing content with the highest reputation on 10/22/2020 in all areas

  1. Set focus to the edit box before setting the selection : ControlFocus ($gGUI, "", $edit) _GUICtrlEdit_SetSel($edit, 5, 6)
    1 point
  2. I have based my script on the html file you provided and it is working fine with me. So I must assume the page has changed from what you posted and the test you have attempted. Can we have access to the web site you are using ? Otherwise make sure you got the right page or provide the newest html page.
    1 point
  3. That would be the benefit of actually reading the help file
    1 point
  4. As to why we don't go through and close every thread that is old, the short answer is because the Moderation staff has lives they would like to lead in addition to their duties here.
    1 point
  5. Your matrix is rotating around the bottom right corner, set the matrix to rotate around the centre (half the image width, half the image height, line 42). You will also need to offset the drawn graphic by that much to compensate (line 66). Test label on line 63. You've also got a memory leak, but that's for you to track #include <GDIPlus.au3> #include <GuiConstantsEx.au3> #include <WinAPI.au3> #include <WindowsConstants.au3> Global $hAttribute_Alpha Global $tColorMatrix Global $g_back Global $g_Needle Global $g_hImage_Background Global $g_hImage_Needle Global $g_hGfx_Background Global $g_hGfx_needle Global $hMatrix GUISetState() $g_hGUI = GUICreate("Test", 356, 356, -1, -1, $WS_POPUP, BitOR($WS_EX_LAYERED,$WS_EX_TOOLWINDOW)) _GDIPlus_Startup() $Needle = _GDIPlus_ImageLoadFromFile(@ScriptDir & "\needle.png") $Background = _GDIPlus_ImageLoadFromFile(@ScriptDir & "\back.png") Func _CreateGraphic() $hAttribute_Alpha = _GDIPlus_ImageAttributesCreate() $tColorMatrix = _GDIPlus_ColorMatrixCreateTranslate(0, 0, 0, 0) ;0 = opaque, -1 = transparent _GDIPlus_ImageAttributesSetColorMatrix($hAttribute_Alpha, 0, True, DllStructGetPtr($tColorMatrix)) $g_back = _GDIPlus_ImageGetDimension($Background) $g_Needle = _GDIPlus_ImageGetDimension($Needle) $g_hImage_Background = _GDIPlus_BitmapCreateFromScan0($g_back[0], $g_back[1]) ; Creeaza imaginea dupa dimensiunile pozei incarcate mai sus $g_hImage_Needle = _GDIPlus_BitmapCreateFromScan0($g_Needle[0], $g_Needle[1]) ; Adaugat $g_hGfx_Background = _GDIPlus_ImageGetGraphicsContext($g_hImage_Background) $g_hGfx_needle = _GDIPlus_ImageGetGraphicsContext($g_hImage_Needle) ; Adaugat _GDIPlus_GraphicsDrawImageRectRect($g_hGfx_Background, $Background, 0, 0, $g_back[0], $g_back[1], 0, 0, $g_back[0], $g_back[1], $hAttribute_Alpha) $hMatrix = _GDIPlus_MatrixCreate() _GDIPlus_MatrixTranslate($hMatrix, $g_Needle[0]/2, $g_Needle[1]/2) EndFunc ; Loop until user exits $Rotation = 0 ;Do While Not GUIGetMsg() = $GUI_EVENT_CLOSE If $Rotation=365 Then $Rotation=0 EndIf __Rotate($Rotation) $Rotation += 5; ConsoleWrite($Rotation & @CRLF) Sleep(1000) WEnd Func __Rotate($i) _CreateGraphic() _GDIPlus_GraphicsClear($g_hGfx_needle, 0xFF000000) _GDIPlus_GraphicsDrawImageRectRect($g_hGfx_Background, $Background, 0, 0, $g_back[0], $g_back[1], 0, 0, $g_back[0], $g_back[1], $hAttribute_Alpha) $g_hGfx_Background = _GDIPlus_ImageGetGraphicsContext($g_hImage_Background) _GDIPlus_GraphicsDrawString($g_hGfx_Background, "Test", $g_back[0]/2, 30) _GDIPlus_MatrixRotate($hMatrix, $i) _GDIPlus_GraphicsSetTransform($g_hGfx_Background, $hMatrix) _GDIPlus_GraphicsDrawImageRect($g_hGfx_Background, $Needle, -$g_Needle[0]/2, -$g_Needle[1]/2, $g_Needle[0], $g_Needle[1]) SetBitmap($g_hGUI, $g_hImage_Background, 255) GUISetState() EndFunc IF GUIGetMsg=$GUI_EVENT_CLOSE Then _GDIPlus_MatrixDispose($hMatrix) _GDIPlus_ImageAttributesDispose($hAttribute_Alpha) _GDIPlus_ImageDispose($Needle) _GDIPlus_ImageDispose($g_hImage_Background) _GDIPlus_ImageDispose($Background) _GDIPlus_GraphicsDispose($g_hGfx_Background) _GDIPlus_Shutdown() EndIf Func SetBitmap($hGUI, $hImage, $iOpacity) Local $hScrDC, $hMemDC, $hBitmap, $hOld, $pSize, $tSize, $pSource, $tSource, $pBlend, $tBlend $hScrDC = _WinAPI_GetDC(0) $hMemDC = _WinAPI_CreateCompatibleDC($hScrDC) $hBitmap = _GDIPlus_BitmapCreateHBITMAPFromBitmap($hImage) $hOld = _WinAPI_SelectObject($hMemDC, $hBitmap) $tSize = DllStructCreate($tagSIZE) $pSize = DllStructGetPtr($tSize) DllStructSetData($tSize, "X", _GDIPlus_ImageGetWidth($hImage)) DllStructSetData($tSize, "Y", _GDIPlus_ImageGetHeight($hImage)) $tSource = DllStructCreate($tagPOINT) $pSource = DllStructGetPtr($tSource) $tBlend = DllStructCreate($tagBLENDFUNCTION) $pBlend = DllStructGetPtr($tBlend) DllStructSetData($tBlend, "Alpha", $iOpacity) DllStructSetData($tBlend, "Format", 1) _WinAPI_UpdateLayeredWindow($hGUI, $hScrDC, 0, $pSize, $hMemDC, $pSource, 0, $pBlend, $ULW_ALPHA) _WinAPI_ReleaseDC(0, $hScrDC) _WinAPI_SelectObject($hMemDC, $hOld) _WinAPI_DeleteObject($hBitmap) _WinAPI_DeleteDC($hMemDC) EndFunc ;==>SetBitmap
    1 point
  6. Gianni

    Can't read STDOUT for quser

    #RequireAdmin #include <Constants.au3> #include <WinAPIFiles.au3> _WinAPI_Wow64EnableWow64FsRedirection(FALSE) Local $Message = "" Local $DOS = Run('C:\Windows\System32\query.exe user', "", @SW_HIDE, $STDERR_MERGED) Do $Message &= StdoutRead($DOS) Until @error MsgBox(0, '', $Message)
    1 point
  7. There are two ToolbarWindow32 sub-classes in the Shell_TrayWnd class. We need the "User Promoted Notification Area" one. So use the following code $hSysTray_Handle = ControlGetHandle("[Class:Shell_TrayWnd]", "", "User Promoted Notification Area") Compile X64 version and use it in Windows 10 (works in Window 7 as well).
    1 point
  8. wakillon

    TextDiff

    Version 1.0.2.4

    1,427 downloads

    A simple script for get differences between 2 "Text" files. The different parts are highlighted and a double click on a line of listviews located to the bottom of the Gui permit to access to the line in the Text
    1 point
×
×
  • Create New...