Jump to content

Leaderboard

Popular Content

Showing content with the highest reputation on 08/25/2020 in all areas

  1. Zedna

    (Solved)

    #include <ButtonConstants.au3> #include <EditConstants.au3> #include <GUIConstantsEx.au3> #include <ListViewConstants.au3> #include <WindowsConstants.au3> #include <GuiListView.au3> $Gui_M = GUICreate("HISTORY", 573, 438, 342, 109) $ListView_HTR = GUICtrlCreateListView("Date|Money", 24, 8, 513, 353) GUICtrlSendMsg(-1, $LVM_SETCOLUMNWIDTH, 0, 250) GUICtrlSendMsg(-1, $LVM_SETCOLUMNWIDTH, 1, 250) $Input_money = GUICtrlCreateInput("", 72, 392, 201, 25, $ES_NUMBER) $Button_set = GUICtrlCreateButton("SET", 360, 384, 137, 33) GUISetState(@SW_SHOW) _Load_History() While 1 $nMsg = GUIGetMsg() Switch $nMsg Case $GUI_EVENT_CLOSE Exit Case $Button_set _Load_Date() EndSwitch WEnd Func _Load_Date() Local $Date_History = @ScriptDir & "\DateHistorySell.ini" Local $currentamount = IniRead($Date_History, "History", @MDAY&@MON&@YEAR, "") If GUICtrlRead($Input_money) <> "" Then IniWrite($Date_History, "History", @MDAY&@MON&@YEAR, GUICtrlRead($Input_money) + $currentamount) _Load_History() EndIf EndFunc Func _Load_History() _GUICtrlListView_DeleteAllItems($ListView_HTR) Local $Date_History = @ScriptDir & "\DateHistorySell.ini" $var = IniReadSection($Date_History, "History") If @error Then Return For $i = 1 To $var[0][0] GUICtrlCreateListViewItem($var[$i][0] & "|" & $var[$i][1], $ListView_HTR) Next EndFunc
    1 point
  2. KryziK

    KryMemory [UDF]

    A short collection of functions to manipulate and query process memory. This is based off of multiple other libraries I've written for other languages and was created because a friend using AutoIt requested it. It also has increased functionality and efficiency compared to NomadMemory. The handle array idea was also taken from NomadMemory and built onto. This small library took me a total of a few hours to write, test, and document. However, much testing is left to do. The error checking could also be extended a bit more to account for new users. If you have any suggestions or find any bugs, do not hesitate to reply here. Make sure you include the code that caused the error, your operating system information, and any other relevant information. Anyways, here it is: KryMemory Library Download Documented Functions: ; _Process_Open($sProcessName, $iDesiredAccess = $PROCESS_ALL_ACCESS, $fInheritAccess = False) ; _Process_Close($ahHandle) ; _Process_ReadMemory($ahHandle, $ivAddress, $sType = "dword") ; _Process_ReadMemoryPointer($ahHandle, $ivAddress, $aiOffsets, $sType = "dword") ; _Process_WriteMemory($ahHandle, $ivAddress, $vData, $sType = "dword") ; _Process_WriteMemoryPointer($ahHandle, $ivAddress, $aiOffsets, $vData, $sType = "dword") ; _Process_GetBaseAddress($ahHandle) ; _Process_GetParent($ahHandle) ; _Process_GetModules($ahHandle) ; ; _Address_CalculateStatic($ahHandle, $sModuleName, $ivOffset) ; _Address_CalculatePointer($ahHandle, $ivAddress, $aiOffsets) ; ; _Module_GetBaseAddress($ahHandle, $sModuleName) Example Usage: #include "KryMemory.au3" ; Opens a process, enabling the other functions to be used on it. Local $oProc = _Process_Open("KryziK.exe") ; Makes sure the process was opened. If @error Then ConsoleWriteError("The specified process could not be opened. Error: " & @error & @CRLF) Exit(0) EndIf ; Lists all of the modules in the process and their base address in a nice, pretty table. ConsoleWrite(StringFormat("%-25s%-25s", "Module Name", "Base Address") & @CRLF) ConsoleWrite("-------------------------------------" & @CRLF) For $sModule in _Process_GetModules($oProc) ConsoleWrite(StringFormat("%-25s 0x%08X", $sModule, _Module_GetBaseAddress($oProc, $sModule)) & @CRLF) Next ; Closes the handles created by _ProcessOpen. _Process_Close($oProc) Disclaimer: Don't use this for anything that would violate AutoIt Forum rules. Don't be stupid! Change Log: - _Process_GetParent added. 1/12/2013 - First release.
    1 point
  3. UEZ

    PNG button image

    #include <ButtonConstants.au3> #include <GDIPlus.au3> #include <GUIConstantsEx.au3> #include <MsgBoxConstants.au3> _GDIPlus_Startup() Global Const $hGUI = GUICreate("Test", 300, 200) GUISetBkColor(0x404040) Global Const $iBtn = GUICtrlCreateButton("", 10, 10, 138, 138, BitOR($BS_BITMAP, $BS_CENTER)) Global Const $hImage = _GDIPlus_ImageLoadFromFile(@ScriptDir & "\StepForwardDisabled.png") Global Const $hHBitmap = _GDIPlus_BitmapCreateHBITMAPFromBitmap($hImage) _WinAPI_DeleteObject(_SendMessage(GUICtrlGetHandle($iBtn), $BM_SETIMAGE, $IMAGE_BITMAP, $hHBitmap)) GUISetState() Do Switch GUIGetMsg() Case $GUI_EVENT_CLOSE _Exit() Case $iBtn MsgBox($MB_APPLMODAL, "Test", "Button was pressed") EndSwitch Until False Func _Exit() _WinAPI_DeleteObject($hHBitmap) _GDIPlus_ImageDispose($hImage) _GDIPlus_Shutdown() GUIDelete() Exit EndFunc Br, UEZ
    1 point
  4. (Example) #include <Constants.au3> #include <WinAPI.au3> _MouseClick(11, 22) ; _MouseMove(11, 22) Func _MouseClick($x, $y) $x = $x * 65535 / @DesktopWidth $y = $y * 65535 / @DesktopHeight _WinAPI_Mouse_Event(BitOR($MOUSEEVENTF_ABSOLUTE, $MOUSEEVENTF_MOVE), $x, $y) _WinAPI_Mouse_Event(BitOR($MOUSEEVENTF_ABSOLUTE, $MOUSEEVENTF_LEFTDOWN), $x, $y) _WinAPI_Mouse_Event(BitOR($MOUSEEVENTF_ABSOLUTE, $MOUSEEVENTF_LEFTUP), $x, $y) EndFunc ;==>_MouseClick Func _MouseMove($x, $y) $x = $x * 65535 / @DesktopWidth $y = $y * 65535 / @DesktopHeight _WinAPI_Mouse_Event(BitOR($MOUSEEVENTF_ABSOLUTE, $MOUSEEVENTF_MOVE), $x, $y) EndFunc ;==>_MouseMove _WinAPI_DrawFrameControl (Example) #include <FrameConstants.au3> #include <GUIConstantsEx.au3> #include <WinAPI.au3> $hGUI = GUICreate("_WinAPI_DrawFrameControl", 400, 300) GUISetState() $hDC = _WinAPI_GetWindowDC($hGUI) $tRect = DllStructCreate($tagRECT) $ptrRect = DllStructGetPtr($tRect) _SetPosSize($tRect, 20, 45, 22, 22) _WinAPI_DrawFrameControl($hDC, $ptrRect, $DFC_BUTTON, $DFCS_BUTTONCHECK + $DFCS_CHECKED) _SetPosSize($tRect, 50, 45, 22, 22) _WinAPI_DrawFrameControl($hDC, $ptrRect, $DFC_BUTTON, $DFCS_BUTTONRADIO + $DFCS_CHECKED) _SetPosSize($tRect, 80, 40, 32, 32) _WinAPI_DrawFrameControl($hDC, $ptrRect, $DFC_CAPTION, $DFCS_CAPTIONCLOSE) Local $aState[9] = [8, $DFCS_BUTTON3STATE, $DFCS_BUTTON3STATE + $DFCS_INACTIVE, $DFCS_BUTTONCHECK, $DFCS_BUTTONPUSH, $DFCS_BUTTONPUSH + $DFCS_FLAT, $DFCS_BUTTONRADIO, $DFCS_BUTTONRADIOIMAGE, $DFCS_BUTTONRADIOMASK] For $i = 1 To $aState[0] _SetPosSize($tRect, $i * 25, 100, 15, 15) _WinAPI_DrawFrameControl($hDC, $ptrRect, $DFC_BUTTON, $aState[$i]) Next Local $aState[6] = [5, $DFCS_CAPTIONCLOSE + $DFCS_HOT, $DFCS_CAPTIonhelp + $DFCS_PUSHED, $DFCS_CAPTIONMAX, $DFCS_CAPTIONMIN, $DFCS_CAPTIONRESTORE] For $i = 1 To $aState[0] _SetPosSize($tRect, $i * 25, 130, 22, 22) _WinAPI_DrawFrameControl($hDC, $ptrRect, $DFC_CAPTION, $aState[$i]) Next Local $aState[5] = [4, $DFCS_MENUARROW + $DFCS_TRANSPARENT, $DFCS_MENUARROWRIGHT, $DFCS_MENUBULLET, $DFCS_MENUCHECK] For $i = 1 To $aState[0] _SetPosSize($tRect, $i * 25, 160, 22, 22) _WinAPI_DrawFrameControl($hDC, $ptrRect, $DFC_MENU, $aState[$i]) Next Local $aState[5] = [4, $DFCS_MENUARROW + $DFCS_TRANSPARENT, $DFCS_MENUARROWRIGHT, $DFCS_MENUBULLET, $DFCS_MENUCHECK] For $i = 1 To $aState[0] _SetPosSize($tRect, $i * 25 + 120, 160, 22, 22) _WinAPI_DrawFrameControl($hDC, $ptrRect, $DFC_POPUPMENU, $aState[$i]) Next Local $aState[9] = [8, $DFCS_SCROLLCOMBOBOX, $DFCS_SCROLLDOWN, $DFCS_SCROLLLEFT, $DFCS_SCROLLRIGHT, $DFCS_SCROLLSIZEGRIP, $DFCS_SCROLLSIZEGRIPRIGHT, $DFCS_SCROLLUP, $DFCS_ADJUSTRECT] For $i = 1 To $aState[0] _SetPosSize($tRect, $i * 25, 190, 22, 22) _WinAPI_DrawFrameControl($hDC, $ptrRect, $DFC_SCROLL, $aState[$i]) Next _WinAPI_ReleaseDC($hGUI, $hDC) Do Until GUIGetMsg() = $GUI_EVENT_CLOSE Func _SetPosSize($tRect, $x, $y, $w, $h) DllStructSetData($tRect, "Left", $x) DllStructSetData($tRect, "Top", $y) DllStructSetData($tRect, "Right", $x + $w) DllStructSetData($tRect, "Bottom", $y + $h) EndFunc ;==>_SetPosSize
    1 point
  5. Download: NomadMemory.au3
    1 point
×
×
  • Create New...