Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- #NoTrayIcon
- #include <NomadMemory.au3>
- #include <GDIPlus.au3>
- $vWinTitle = "PW Map"
- $vBase = 10437900
- $vBaseOffset = 32
- $vXOffset = 60
- $vYOffset = 68
- $bTimer = True
- $vRefreshTime = 2000
- $vDotSize = 6
- $hGuiMain = GUICreate($vWinTitle, 986, 743)
- $hGuiPic = GUICtrlCreatePic("", 0, 0, 985, 742)
- GUISetState(@SW_SHOW)
- _PWM_Refresh()
- While 1
- If GUIGetMsg() = -3 Then Exit
- If $bTimer = True Then
- $vTimer = TimerInit()
- $bTimer = False
- EndIf
- If TimerDiff($vTimer) >= $vRefreshTime Then
- _PWM_Refresh()
- $bTimer = True
- EndIf
- $vCurInfo = GUIGetCursorInfo($hGuiMain)
- If WinActive($hGuiMain) And $vCurInfo[4] = 3 Then
- WinSetTitle($hGuiMain,"",$vWinTitle & " --- X: " & Round($vCurInfo[0] * 1.52 - 348) & " - Y: " & Round(-($vCurInfo[1] * 1.52 - 1116)))
- EndIf
- WEnd
- Func _PWM_Refresh()
- _GDIPlus_Startup()
- $hBitmap = _GDIPlus_ImageLoadFromFile("pwmap.bmp")
- $hGraphic = _GDIPlus_ImageGetGraphicsContext($hBitmap)
- $hBrush = _GDIPlus_BrushCreateSolid(0xFFFF0000)
- $hPen = _GDIPlus_PenCreate(0xFFFFFFFF)
- $vList = WinList("[CLASS:ElementClient Window]")
- For $i = 1 To $vList[0][0]
- $vProcess = WinGetProcess($vList[$i][1])
- $vOpen = _MemoryOpen(WinGetProcess($vList[$i][1]))
- $vRead = _MemoryRead($vBase, $vOpen) + $vBaseOffset
- $vMemX = _MemoryRead(_MemoryRead($vRead,$vOpen) + $vXOffset,$vOpen,"float")
- $vMemY = _MemoryRead(_MemoryRead($vRead,$vOpen) + $vYOffset,$vOpen,"float")
- $vX = Round(((($vMemX+4000)/10)+348)/1.52,2)
- $vY = Round((-(($vMemY+5500)/10)+1116)/1.52,2)
- _MemoryClose($vOpen)
- _GDIPlus_GraphicsFillEllipse($hGraphic, $vX, $vY, $vDotSize, $vDotSize, $hBrush)
- _GDIPlus_GraphicsDrawEllipse($hGraphic, $vX, $vY, $vDotSize, $vDotSize, $hPen)
- Next
- $hNewBitmap = _GDIPlus_BitmapCreateHBITMAPFromBitmap($hBitmap)
- _PWM_SetBitmapToCtrl($hGuiPic, $hNewBitmap)
- _GDIPlus_BitmapDispose($hBitmap)
- _GDIPlus_GraphicsDispose($hGraphic)
- _GDIPlus_PenDispose($hBrush)
- _GDIPlus_BrushDispose($hPen)
- _WinAPI_DeleteObject($hNewBitmap)
- _GDIPlus_Shutdown()
- EndFunc
- ;Set a bitmap to a control - by Zedna
- Func _PWM_SetBitmapToCtrl($vCtrlID, $hBitmap)
- Local $hWnd = GUICtrlGetHandle($vCtrlID)
- If $hWnd = 0 Then Return SetError(1, 0, 0)
- Local $vOldStyle = _WinAPI_GetWindowLong($hWnd, -16)
- _WinAPI_SetWindowLong($hWnd, -16, BitOR($vOldStyle, 0xE))
- Local $vOldBmp = _SendMessage($hWnd, 0x0172, 0, $hBitmap)
- If $vOldBmp <> 0 Then _WinAPI_DeleteObject($vOldBmp)
- EndFunc
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement