-
Posts
43 -
Joined
-
Last visited
Content Type
Forums
Downloads
Forum Articles
Events
Everything posted by ImOracle
-
Problem with drawing a ScreencaptureWnd on GUI
ImOracle replied to ImOracle's topic in AutoIt GUI Help and Support
wow that was a lot easier than i thought Thanks! -
Problem with drawing a ScreencaptureWnd on GUI
ImOracle replied to ImOracle's topic in AutoIt GUI Help and Support
Interesting approach but not quite what i wanted to do I may just try to create a buffer and draw the ellipses directly onto the graphics object... -
Problem with drawing a ScreencaptureWnd on GUI
ImOracle replied to ImOracle's topic in AutoIt GUI Help and Support
can someone at least tell me if it works for them? -
Problem with drawing a ScreencaptureWnd on GUI
ImOracle replied to ImOracle's topic in AutoIt GUI Help and Support
Bump And here is the whole script (just something that went through my mind and a lot of free time/boredom) #include <GDIPlus.au3> #include <GUIConstantsEx.au3> #include <ScreenCapture.au3> Global Const $title = StringTrimRight(@ScriptName, 4) Global $curBrush = 0 Global $redBrush = 0 Global $saveImage = 0 _GDIPlus_Startup() $mainGUI = GUICreate($title, @DesktopWidth, @DesktopHeight, 0, 0, 0x80000000) $mainMenu = GUICtrlCreateContextMenu() $restartMenuItem = GUICtrlCreateMenuItem("Restart", $mainMenu) GUISetState() $_Graphics = _GDIPlus_GraphicsCreateFromHWND($mainGUI) _GDIPlus_GraphicsClear($_Graphics, 0xFFFFFFFF) Global $redPen = _GDIPlus_PenCreate(0xFFFF0000, 2) While 1 Switch GUIGetMsg() Case -3 _exit() Case $GUI_EVENT_MOUSEMOVE _drawRect() Case $GUI_EVENT_PRIMARYDOWN $saveImage = _ScreenCapture_CaptureWnd("", $mainGUI, Default, Default, Default, Default, False) $mouseX = MouseGetPos(0) $mouseY = MouseGetPos(1) $counter = 30 $increase = 20 While 1 $counter += $increase _GDIPlus_GraphicsDrawEllipse($_Graphics, $mouseX-($counter/2), $mouseY-($counter/2), $counter, $counter, $redPen) Sleep(50) If GUIGetMsg() = $GUI_EVENT_PRIMARYUP Then _GDIPlus_GraphicsDrawImageRect($_Graphics, $saveImage, 0, 0, @DesktopWidth, @DesktopHeight) ExitLoop EndIf WEnd EndSwitch WEnd Func _drawRect() Local $amountMin = 1 Local $amountMax = 4 Local $offsetXMin = -20 Local $offsetXMax = 20 Local $offsetYMin = -20 Local $offsetYMax = 20 Local $widthMin = 20 Local $widthMax = 100 Local $heightMin = 20 Local $heightMax = 100 Local $mouseX = MouseGetPos(0) Local $mouseY = MouseGetPos(1) $amount = Random($amountMin, $amountMax, 1) $curBrush = _GDIPlus_BrushCreateSolid(_randomColor()) $offsetX = Random($offsetXMin, $offsetXMax, 1) $offsetY = Random($offsetYMin, $offsetYMax, 1) $width = Random($widthMin, $widthMax, 1) $height = Random($heightMin, $heightMax, 1) For $i = 0 To $amount _GDIPlus_GraphicsFillRect($_Graphics, $mouseX+$offsetX, $mouseY+$offsetY, $width, $height, $curBrush) Next EndFunc Func _randomColor() Local $red, $green, $blue, $color $red = Hex(Random(0, 255, 1), 2) $green = Hex(Random(0, 255, 1), 2) $blue = Hex(Random(0, 255, 1), 2) $color = "0xFF"&$red&$green&$blue Return $color EndFunc Func _exit() _GDIPlus_ImageDispose($saveImage) _GDIPlus_BrushDispose($curBrush) _GDIPlus_PenDispose($redPen) _GDIPlus_GraphicsDispose($_Graphics) _GDIPlus_Shutdown() Exit 1 EndFunc art.au3 -
So im messing around with GDIPlus stuff and im creating an effect where, as long as the user holds down the Left mouse button, red circles are drawn, which increase with the time the left mouse button is held down. After the effect is over, i want to "erase" the circles from the gui. I came up with the following idea: Just before i draw the circles, i make a screenshot of the gui using _screencapture_captureWnd and after the user releases the left mouse button, the Screenshot image is drawn on the gui, "erasing" the previously drawn circles. Here is the main loop of my script While 1 Switch GUIGetMsg() Case -3 _exit() Case $GUI_EVENT_MOUSEMOVE _drawRect() ;==> this is the important bit Case $GUI_EVENT_PRIMARYDOWN $saveImage = _ScreenCapture_CaptureWnd("", $mainGUI, Default, Default, Default, Default, False) $mouseX = MouseGetPos(0) $mouseY = MouseGetPos(1) $counter = 30 $increase = 20 While 1 $counter += $increase _GDIPlus_GraphicsDrawEllipse($_Graphics, $mouseX-($counter/2), $mouseY-($counter/2), $counter, $counter, $redPen) Sleep(50) If GUIGetMsg() = $GUI_EVENT_PRIMARYUP Then _GDIPlus_GraphicsDrawImageRect($_Graphics, $saveImage, 0, 0, @DesktopWidth, @DesktopHeight) ExitLoop EndIf WEnd EndSwitch WEnd
-
Thanks for the arraydelete side note And i think i have an idea for the loop already, maybe something will come up in the example scripts section soon
-
Hey everyone, "Lets get straight to the point" (this is actually a paradox cause by saying this, you dont actually get "straight to the point... anyways) So in my Script, i have a Array full of colors. And i would like to draw 10x10 Rects with GDIPlus on a gui with the color extracted from an entry of the array. I already tried it but it just wont work (Im not that good with arrays). For $i = 0 To 255 $blue = $colorBytes[$i] _ArrayDelete($colorBytes, $i) $green = $colorBytes[$i] _ArrayDelete($colorBytes, $i+1) $curBrush = _GDIPlus_BrushCreateSolid("0xFFFF"&$green&$blue) If $i >= 0 And $i <= 32 Then $y = 10 ElseIf $i >= 32 And $i <= 64 Then $y = 20 ElseIf $i >= 96 And $i <= 128 Then $y = 30 ElseIf $i >= 128 And $i <= 160 Then $y = 40 ElseIf $i >= 160 And $i <= 192 Then $y = 50 ElseIf $i >= 192 And $i <= 224 Then $y = 60 ElseIf $i >= 224 And $i <= 256 Then $y = 70 ElseIf $i >= 256 Then $y = 80 EndIf _GDIPlus_GraphicsFillRect($graphics, $i*10, $y, $blockSize, $blockSize, $curBrush) _GDIPlus_BrushDispose($curBrush) Nextthe array $colorBytes is 256 big, the GUI: Height=320; Width=80 Maybe a nested For loop is the solution? Thanks in advance, Oracle
-
Hello Possible Problem Solver (yeah i tried to be creative), My friend wants to play games like cookie clicker, Clicker Heroes and so on without playing them (he doesnt want to sit there and click all the time) so he asked me if i could help him out. I did by simply writing a MouseClick While Loop. Now he is complaining about not being able to use the mouse cursor and i found out that one possible way to fix this problem is using the _SendMessage wrapper and just sending a WM_LBUTTONDOWN and WM_LBUTTONUP message to the appwindow instead of using the MouseClick. But looking into the usage of the actual WINAPI call i realized you have to use a Short as the lParam to deliver the coordinates. How do i create a signed Short in AutoIt? Also, the low-order word of the Short is supposed to contain the x-coordinate of the cursor. but a low-order word of a Short can only contain 2 characters. How is this even supposed to work? Or do i not understand something here? (Another thing: If this is a bot in someones mind, im sorry. But a answer to the second problem would still be awesome!)
-
so basically the same but with the additional parameter of _GUIImageList_AddIcon() set to 0 which is defaulted to 0. Im sorry but this still doenst make sense to me. I created: 1. The Listview 2. the image list 3. added the icon to the imagelist 4. assigned the image list to the ListView 5. added the Items for the ListView. Still doesnt work...
-
Please tell me if the about boxes work cause i used a font that i downloaded (maybe not installed on youre pc) and im not sure if that works...
-
Hi, I made a Tool that can set the Priority of Processes cause im sick of slow games. Thats it. v1.1 may include Icons next to the ListViewItems if i can figure out how that works and also a List in which you can enter Processes and the Priority level on which they should be so that if that process starts, its automatically set to that priority. And somewhen in the far future a gdiplus gui... i dont know This script also uses Melba23's ExtMsgBox.au3 and StringSize.au3, so i should give him credit for that i guess: Process Priority v1.0.au3
-
Hi, So i have seen a lot of Posts about this already and most of the time the users figured it out somehow, unlike me. The Problem im having is that i cant assign Icons to Listview items. I know that you have to create some fancy ImageList and i did all that. I tried extracting the Icon out of the process and now i just tried to use the icon from the .exe that is running. #include <GuiListView.au3> #include <GuiImageList.au3> #include <WinAPIProc.au3> $mainForm = GUICreate("test", 500, 500) $List = _GUICtrlListView_Create($mainForm, "Process Name|PID", 0, 0, 500, 500) $exStyles = BitOR($LVS_EX_FULLROWSELECT, $LVS_EX_SUBITEMIMAGES) _GUICtrlListView_SetExtendedListViewStyle($List, $exStyles) $aProcess = ProcessList() $hImage = _GUIImageList_Create(64, 64, 0, 1) For $i = 0 To $aProcess[0][0] $CurIcon = _WinAPI_GetProcessFileName($aProcess[$i][1]) ConsoleWrite("CurIcon: "&$CurIcon&@CRLF) _GUIImageList_AddIcon($hImage, $CurIcon) Next For $i = 0 To $aProcess[0][0] _GUICtrlListView_AddItem($List, $aProcess[$i][0]) Next _GUICtrlListView_SetImageList($List, $hImage) GUISetState() While 1 Switch GUIGetMsg() Case -3 Exit EndSwitch WEndNow i think my only problem is that im not defining the 3rd parameter in _GUIImageList_AddIcon() "$iIndex[optional] Specifies the 0-based index of the icon to extract" What is a 0-based index in an icon? I bet i just missed a single thing thats really obivious, Oracle
-
yes dammit And im even using this entry aswell... It just looked weird to me that there is a window with a number thats changing from time to time slightly and doesnt have a Handle... Should have thought of that, but thanks for reminder anyways
-
While scripting a bit, i realized that the WinList function returns a Window with the title "590" and no hWnd... Didnt do any research on it yet and it might already be explained and if so im just a huge jerk
-
Nice! I already knew about the HotKey UDF and thought about implementing it. But i didnt know there were the other ones aswell! That makes things much easier. Thanks Zedna
-
Yea i implemented it using the typing technique, replaced all the ALT,SHIFT,WIN,CTRL using StringReplace with the corresponding Chars (!, #, + and so on) and set the resulting Hotkey to a test function. if the Hotkeyset call would return 1 it was valid and actually saved, if not repeat the whole thing. Just for anyone else who might stumble upon this in a few years. But thanks for the suggestion.
-
That would be an options for the A-Z keys... But what about ALT, CTRL, DEL, INS, SHIFT, WIN, and so on... Guess they could just type it in... and i guess i thought to complicated once again...
-
$var = 0 Or $var = 0.0 is diferent?
ImOracle replied to Luigi's topic in AutoIt General Help and Support
I guess the float would take up more space but we are talking about a few bytes here... -
Hello everyone (once again ), Im creating a program that relies on using Hotkeys and i would like the user to choose which Hotkey should call which function. So i created a list with labels just like in some games where its display like this: walk forward - "W" walk backwards - "S" The hard part is, to make it work. I guess i could have a little GUI displayed which said "press a button" then you press the button and the function would be assigned to that pressed button. But i dont wanna make a whole list of "_IsPressed" calls (partially because i know that would look ugly, slow down the app, maybe not even work and so on). And yes, i know Melba, The answer to this Problem could be used as a "Keylogger" but i simply dont know any other way around it apart from a InputBox that would prompt the user to type in the corresponding KeyCode (_isPressed Codes). Thank you in advance Oracle
-
Test Window/GUI that is hung up or doesnt respond
ImOracle replied to ImOracle's topic in AutoIt General Help and Support
Btw: i was just about to write dllcall for the SendMessageTimeout function when i realized. there is a _WinAPI_IsHungAppWindow($hWnd) function. i knew it... -
Test Window/GUI that is hung up or doesnt respond
ImOracle replied to ImOracle's topic in AutoIt General Help and Support
Yes thank you!! Not exactly what i was looking for but i found some useful snippets And another 'Thank you' for the quick response -
Hi everyone, I was just wondering if it is possible to manipulate a window so that it isn't responding. I just need this for testing purposes (a little app that checks if the selected window is still responding) Also i think i can remember a function called _WinAPI_IsHungApp() or something along those lines. Correct me if im wrong. The App that would check if the window is still responding would use the SendMessageTimeout function (https://msdn.microsoft.com/de-de/library/windows/desktop/ms644952(v=vs.85).aspx) or the built-in _SendMessage() function to send the "WM_NULL" message and then get a response or something like that? I dont quite know what the "WM_NULL" message does to the Window but thats why i would like to have a hung up testing window.
-
Local Variables arent shown in syntax highlighting, not sure if this was already reportet.
- 995 replies
-
- isn autoit studio
- isn
-
(and 3 more)
Tagged with:
-
Lock CD Tray - Disable Eject Button - Prevent Media Removal
ImOracle replied to dabigfish's topic in AutoIt Example Scripts
you can also quote people using the appropiate button like this -
0x4E6F205061747269636B20646964