-
Posts
7,148 -
Joined
-
Last visited
-
Days Won
2
Everything posted by martin
-
If you want to send a binary zero then sending a string won't work. You need to use _CommSendByte, or if you have a few bytes to send you can use _CommSendByteArray. There is an example of _CommSendByteArray here https://www.autoitscript.com/forum/topic/128546-serial-port-com-port-udf/?do=findComment&comment=1130587
- 680 replies
-
- serial port
- virtual port
-
(and 2 more)
Tagged with:
-
That link is now broken. But maybe this one might be helpful for some https://blog.csdn.net/analogous_love/article/details/42264605
-
The window title doesn't change for me. The script works so I don't see a problem. Maybe there is some problem because of a different language - my PC is Windows 10 and the language is English (UK).
-
Hello Adnadeau, Apologies for the delay - I rarely visit the Autoit forums now. Thanks for the feedback. I will investigate what you have told me and I will correct the files in the zip. It might be a couple of weeks before I get back with something. Martin
- 680 replies
-
- serial port
- virtual port
-
(and 2 more)
Tagged with:
-
$ES_AUTOVSCROLL Not Scrolling
martin replied to DynamicRookie's topic in AutoIt General Help and Support
I haven't investigated your problem but it might be that you could send "^{END}' to the edit with ControlSend and that should make it scroll down I think.- 1 reply
-
- edit not autoscrolling
- autoscroll edit
- (and 3 more)
-
Here is a 64 bit version for someone to try. Any feedback would be appreciated. The dll is COMMG64.DLL. The example script is Commg64Example.au3 and the UDF is CommMG64.au3. The only changes to the AU3 scripts for the 64 bit version is that I have simply replaced CommMg.au3 with CommMG64.au3 and commg.dll with commg64.dll. COMMG64.zip
- 680 replies
-
- serial port
- virtual port
-
(and 2 more)
Tagged with:
-
I don't know why setting the paper size wasn't ever included in the udf, but if you still need this I will try to add something. If I don't see a reply over the next week then I will do nothing on the assumption that I am too late to help.
-
Tooltips can be made to work in W10 when an app is maximized if the maximum window size is set to be larger than the screen size. I added this information to post 1.
- 3 replies
-
- windows 10
- tooltips
-
(and 1 more)
Tagged with:
-
Thanks argumentum, I hadn't thought of that even though I sometimes use 2 monitors myself. I've changed the code but it might not survive long.
- 3 replies
-
- windows 10
- tooltips
-
(and 1 more)
Tagged with:
-
Maximized Windows in Windows 10 usually (for me) don't show tooltips or hints. For a short time following a WIndows update this was fixed on my laptop but after another day, and maybe another update, the problem returned, so I don't understand what the conditions are. The script below checks for maximized windows and sets their size to a few pixels less than the screen size and this brings back tooltips. I have found another way to fix the problem which might help some people. There are several programs I use regularly and the tooltips are important. On the programs I compile the tooltips help my users if they are not familiar with using the programs. If I set the maximum window size to be greater than the screen size ( @DesktopHeight/@Desktopwidth) then when maximized it still fits the screen ok but the tooltips still work. This can be done in AUtoIt with GUIRegisterMsg($WM_GETMINMAXINFO, "MY_WM_GETMINMAXINFO")---- (search for examples) In Delphi it can be done with Form.Constraints. I don't know about other languages. For apps where the maximum size can't be controlled the script below could help someone; it helps me at least. Const $SPI_SETWORKAREA = 47, $SPI_GETWORKAREA = 48, $SPIF_SENDCHANGE = 11 $StartRect = DllStructCreate("int[4]") $PStartRect = DllStructGetPtr($StartRect) $res = DllCall("user32.dll", "int", "SystemParametersInfo", "int", $SPI_GETWORKAREA, "int", 0, "ptr", $PStartRect, "int", 0) $maxwid = DllStructGetData($StartRect, 1, 3) - DllStructGetData($StartRect, 1, 1) $maxht = DllStructGetData($StartRect, 1, 4) - DllStructGetData($StartRect, 1, 2) While 1 $aList = WinList() $res = DllCall("user32.dll", "int", "SystemParametersInfo", "int", $SPI_GETWORKAREA, "int", 0, "ptr", $PStartRect, "int", 0) $maxwid = DllStructGetData($StartRect, 1, 3) - DllStructGetData($StartRect, 1, 1) $maxht = DllStructGetData($StartRect, 1, 4) - DllStructGetData($StartRect, 1, 2) For $i = 1 To $aList[0][0] If $aList[$i][0] <> 'Program Manager' Then $ws = WinGetPos($aList[$i][1]) if isarray($ws) then;for some reason it isn't always If $aList[$i][0] <> "" And $ws[2] > $maxwid And $ws[3] > $maxht Then WinSetState($aList[$i][1], '', @SW_RESTORE);because changing the size leaves it as maximised as far as Windows is concerned! WinMove($aList[$i][1], '', $ws[0],$ws[1], $maxwid, $maxht) Endif EndIf EndIf Next Sleep(5000) WEnd 25th January 2016. WIndows 10 had a major update overnight on my PC. Now the problem with missing tooltips has gone. I din't know Microsoft studied these forums so carefully. So this means this script is no longer needed by me or anyone else. 24 Jan 2016 Edit again after Argumentum pointed out more than one monitor not allowed for. Not certain this is still correct but will test it with another monitor during next few days. 24th Jan 2016 Improved to use working area of desktop because the Taskbar and other apps can use up some of the desktop, so a maximised window is not necessarily to desktop size. (I tried testing for @Maximized but it failed, and I didn't spend any time worying about why though it would be better.)
- 3 replies
-
- windows 10
- tooltips
-
(and 1 more)
Tagged with:
-
Your bug report needs to be redirected to Microsoft I think Have a look at the definition of windows styles WS_DLGFRAME Creates a window with a double border but no title. So you cannot have a caption and the WS_DLGFRAME style.
-
No message generated for controls in child window.
martin replied to martin's topic in AutoIt General Help and Support
That's beyond what I was looking at though the effect might be related. The help makes no claims about controlclick working on hidden windows and even warns that it is best to activate the target window before using controlclick, so I think expecting a control on a hidden AutoIt window to respond is a bit optimisistic. -
No message generated for controls in child window.
martin replied to martin's topic in AutoIt General Help and Support
Yes, I agree that it's odd which is why I started the thread. But we discovered that using using GuiSetState(@SW_HIDE) stops messages from most controls and they aren't turned on again using WinSetState(...,..,$SW_SHOW), but if you hide the gui using WinSetState then when you show it again with WInSetState everything works. In my opinion its a bug but it's pretty trivial to get round and it will only happen very rarely so I'm not going to worry about it. -
No message generated for controls in child window.
martin replied to martin's topic in AutoIt General Help and Support
@BrewManNH You are seeing the codes for MouseDown and MouseUp I think. -
No message generated for controls in child window.
martin replied to martin's topic in AutoIt General Help and Support
Yes, I hadn't thought of trying that. It shows exactly what I'm saying and it gives the solution. If instead of GuiSetState(@SW_HIDE) I can use WinSetState("Child","",@SW_HIDE) and that works $ch = GUICreate("Child",300,300,10,10) $testBtn = GUICtrlCreateButton("Test",100,100) GUISetState() sleep(500) winsetstate("Child","",@SW_HIDE) while 1 $Msg = GUIGetMsg() if $msg = -3 then Exit if $msg = $testBtn then msgbox(262144,"result","button pressed") WEnd Thanks czardas -
No message generated for controls in child window.
martin replied to martin's topic in AutoIt General Help and Support
There is an error in my example in the first post and it was over complicated, although the problem is exactly the same. If you create a window like this $ch = GUICreate("Child",300,300,10,10) $testBtn = GUICtrlCreateButton("Test",100,100) GUISetState() sleep(500); some code which maybe takes some time GUISetState(@SW_HIDE) while 1 $Msg = GUIGetMsg() if $msg = -3 then Exit if $msg = $testBtn then msgbox(262144,"result","button pressed") WEnd Say you compile that and run it. Then run this scrript winsetstate("Child","",@SW_SHOW) Then you will see that the button is unresponsive. So if an AutoIt gui sets itself to hide, and an external method is used to show it then the gui is unresponsive. That is what I am trying to demonstrate and to me it seems wrong. But I suppose that, apart from the problem it caused me for a while, it isn't a big deal. -
Is the example below expected behaviour? This is the child window which can be run by itself in which case it isn't a child $ch = GUICreate("Child",300,300) $testBtn = GUICtrlCreateButton("Test",100,100) if winexists("Parent") then GUISetState(@SW_HIDE) Else GUISetState() EndIf while 1 $Msg = GUIGetMsg() if $msg = -3 then Exit if $msg = $testBtn then msgbox(262144,"result","button pressed") WEnd When the button is pressed a message box appears of course. But if you run this $AutoItProdexePath = RegRead("HKEY_LOCAL_MACHINE\SOFTWARE\AutoIt v3\AutoIt", "InstallDir") $Parent = guicreate("Parent",700,500) GUISetState() Run('"' & $AutoItProdexePath & '\AutoIt3.exe "' & ' "' & @ScriptDir & '\Child.au3"') DllCall("user32.dll", "int", "SetParent", "hwnd", "Child", "hwnd", $Parent) WinSetState("Child", "", @SW_SHOW) while GUIGetMsg() <> -3 WEnd then the button doesn't generate a message although the close icon does. Should I have expected that or is something wrong?
-
Ah I see. Yes that worked, thanks Jos. martin
-
Hello Jos, I don't know the answer. I just saw that the thread here about the bug for version 3.5 was closed as fixed by Neil Hodgson in December 2014. martin
-
I see the problem with the vanishing cursor has been fixed in Scite, but my understanding of Scite and the AutoIt version is poor so I don't know how to apply that. Anyone know if there is an update for AutoIt due or how to apply the latest Scite version?
-
Nerds in Math, help me to draw a secant
martin replied to Luigi's topic in AutoIt General Help and Support
Yes, I think that's right now. Maybe I understand how you are drawing things now. Are you making it so that the value is always (red line length)/(green line length) ? -
Nerds in Math, help me to draw a secant
martin replied to Luigi's topic in AutoIt General Help and Support
A secant is the inverse of cos, so to me the two sides which should be shown are the hypotenuse and the adjacent. For tan and cotan the sides are opposite and adjacent, for sin they are opposite and hypotenuse. The red line you have drawn has a length Rad * sec(angle) - Rad or (Rad/cos(angle)) - Rad which has no significane to me. -
Nerds in Math, help me to draw a secant
martin replied to Luigi's topic in AutoIt General Help and Support
I would draw them more like this, but you need something to show which which line length is divided by which other line length. #include <Array.au3> #include <Misc.au3> #include <GDIPlus.au3> #include <GUIConstantsEx.au3> #include <GuiComboBoxEx.au3> Global $hGui, $hMsg, $active = True Global $hGraphic, $hPen, $hPen2, $hBitmap, $hBackbuffer, $width = 350, $height = 300, $hCursor, $mouse[4], $xx2, $yy2 Global $mapa[10][10] Global $largura = 800, $altura = 600, $limites[6] Global Const $PI = 3.1415926535897932384626433832795 Global Const $radToDeg = 180 / $PI $hGui = GUICreate('Ângulos', $largura, $altura) Global $hSeno = GUICtrlCreateCheckbox('Seno', 10, 5, 80, 20) Global $hCos = GUICtrlCreateCheckbox('Cosseno', 10, 25, 80, 20) Global $hTan = GUICtrlCreateCheckbox('Tangente', 100, 5, 80, 20) Global $hCot = GUICtrlCreateCheckbox('Cotangente', 100, 25, 80, 20) Global $hSec = GUICtrlCreateCheckbox('Secante', 190, 5, 80, 20) Global $hPasso = GUICtrlCreateCombo('', 280, 5, 80, 20, $CBS_DROPDOWNLIST) Global $hInvertido = GUICtrlCreateCheckbox('Inverso', 370, 5, 80, 20) GUICtrlSetData($hPasso, 'Livre|1|5|10|15|30', 'Livre') Global $iSeno = 0, $iCos = 0, $iTan = 0, $iCot = 0, $iSec = 0, $iInverso = 0 GUISetState(@SW_SHOWNORMAL) _GDIPlus_Startup() $hGraphic = _GDIPlus_GraphicsCreateFromHWND($hGui) $hBitmap = _GDIPlus_BitmapCreateFromGraphics($largura - 20, $altura - 60, $hGraphic) _limites() Func _limites() $limites[0] = 10 $limites[1] = 50 $limites[2] = $largura - 20 $limites[3] = $altura - 50 $limites[4] = ($largura - 20) / 2 $limites[5] = ($altura - 50) / 2 ;_ArrayDisplay($limites) EndFunc ;==>_limites $hBackbuffer = _GDIPlus_ImageGetGraphicsContext($hBitmap) $hPen = _GDIPlus_PenCreate() $hPen2 = _GDIPlus_PenCreate(0xFFFF0000, 3) $hPen3 = _GDIPlus_PenCreate(0xFF00FF00) _GDIPlus_GraphicsClear($hBackbuffer) _GDIPlus_GraphicsSetSmoothingMode($hBackbuffer, 2) Global $hBrush_01 = _GDIPlus_BrushCreateSolid(0xFF336699) Global $hBrush_02 = _GDIPlus_BrushCreateSolid(0xFFFF0000) Global $hBrush_03 = _GDIPlus_BrushCreateSolid(0xFF00FF00) Global $hFamily = _GDIPlus_FontFamilyCreate('Courier New') Global $hFont = _GDIPlus_FontCreate($hFamily, 10) Global $hPosX = _GDIPlus_RectFCreate(2, 0, 120, 15) Global $hPosY = _GDIPlus_RectFCreate(2, 20, 120, 15) Global $hAng = _GDIPlus_RectFCreate(2, 80, 120, 15) Global $hInv = _GDIPlus_RectFCreate(2, 100, 120, 15) Global $hPosX1 = _GDIPlus_RectFCreate(2, 40, 120, 15) Global $hPosY1 = _GDIPlus_RectFCreate(2, 60, 120, 15) Global $hStringFormat = _GDIPlus_StringFormatCreate() Global $start = TimerInit() While 1 $hMsg = GUIGetMsg() Switch $hMsg Case $GUI_EVENT_CLOSE _exit() Case $hSeno $iSeno = _Iif($iSeno == 0, 1, 0) Case $hCos $iCos = _Iif($iCos == 0, 1, 0) Case $hTan $iTan = _Iif($iTan == 0, 1, 0) Case $hCot $iCot = _Iif($iCot == 0, 1, 0) Case $hSec $iSec = _Iif($iSec == 0, 1, 0) Case $hInvertido $iInverso = _Iif($iInverso == 0, 1, 0) EndSwitch $hCursor = GUIGetCursorInfo() If Not $hCursor Then $mouse[0] = $hCursor[0] - $limites[0] $mouse[1] = $hCursor[1] - $limites[1] EndIf If WinActive($hGui) Then If Not $active Then $active = True If TimerDiff($start) >= 10 Then _update() $start = TimerInit() EndIf ElseIf Not WinActive($hGui) And $active Then $active = False EndIf WEnd Func _update() _GDIPlus_GraphicsClear($hBackbuffer, 0xF0FFFFFF) ;_GDIPlus_StringFormatSetAlign($hStringFormat, 1) _GDIPlus_GraphicsDrawStringEx($hBackbuffer, 'x[' & $mouse[0] & ']', $hFont, $hPosX, $hStringFormat, $hBrush_01) _GDIPlus_GraphicsDrawStringEx($hBackbuffer, 'y[' & $mouse[1] & ']', $hFont, $hPosY, $hStringFormat, $hBrush_01) _GDIPlus_GraphicsDrawStringEx($hBackbuffer, 'x[' & $mouse[0] - 389 & ']', $hFont, $hPosX1, $hStringFormat, $hBrush_02) _GDIPlus_GraphicsDrawStringEx($hBackbuffer, 'y[' & - ($mouse[1] - 270) & ']', $hFont, $hPosY1, $hStringFormat, $hBrush_02) $ang = _ang(0, 0, $mouse[0] - 389, -($mouse[1] - 270)) _GDIPlus_GraphicsDrawStringEx($hBackbuffer, 'º[' & $ang[0] & ']', $hFont, $hAng, $hStringFormat, $hBrush_02) _box($hBackbuffer, 0, 0, $largura - 21, $altura - 61) _GDIPlus_GraphicsDrawLine($hBackbuffer, ($largura - 21) / 2, 0, ($largura - 21) / 2, $altura - 60, $hPen) _GDIPlus_GraphicsDrawLine($hBackbuffer, 0, ($altura - 60) / 2, $largura - 21, ($altura - 60) / 2, $hPen) _GDIPlus_GraphicsDrawEllipse($hBackbuffer, ($largura - 20) / 2 - 200 - 1, ($altura - 60) / 2 - 200, 400, 400) ;_GDIPlus_GraphicsDrawLine($hBackbuffer, ($largura - 21) / 2, ($altura - 60) / 2, $mouse[0], $mouse[1], $hPen2) $cos = Int(200 * Cos(($ang[0] / 180) * $PI)) $sen = Int(200 * Sin(($ang[0] / 180) * $PI)) $tan = Int(200 * ($sen / $cos)) $cot = Int(200 * ($cos / $sen)) _GDIPlus_GraphicsDrawPie($hBackbuffer, ($largura - 20) / 2 - 1 - 25, ($altura - 60) / 2 - 25, 50, 50, 0, -$ang[0]) If $iSeno Then _GDIPlus_GraphicsDrawLine($hBackbuffer, ($largura - 20) / 2 - 1 + $cos, ($altura - 60) / 2, 389+$cos, 270 - $sen, $hPen2) _GDIPlus_GraphicsDrawLine($hBackbuffer, ($largura - 20) / 2 - 1 , ($altura - 60) / 2, 389+$cos, 270-$sen, $hPen2) ;_GDIPlus_GraphicsDrawLine($hBackbuffer, 389 + $cos, 270 - $sen, 389, 270 - $sen, $hPen) EndIf If $iCos Then _GDIPlus_GraphicsDrawLine($hBackbuffer, ($largura - 20) / 2 - 1, ($altura - 60) / 2, 389 + $cos, 270, $hPen2) _GDIPlus_GraphicsDrawLine($hBackbuffer, ($largura - 20) / 2 - 1 , ($altura - 60) / 2, 389+$cos, 270-$sen, $hPen2) _GDIPlus_GraphicsDrawLine($hBackbuffer, 389 + $cos, 270 - $sen, 389 + $cos, 270, $hPen) EndIf If $iTan Then _GDIPlus_GraphicsDrawLine($hBackbuffer, ($largura - 20) / 2 - 1 + $cos, ($altura - 60) / 2, 389+$cos, 270 - $sen, $hPen2) _GDIPlus_GraphicsDrawLine($hBackbuffer, ($largura - 20) / 2 - 1 + $cos, ($altura - 60) / 2, 389, 270, $hPen2) EndIf If $iCot Then _GDIPlus_GraphicsDrawLine($hBackbuffer, ($largura - 20) / 2 - 1 + $cos, ($altura - 60) / 2, 389+$cos, 270 - $sen, $hPen2) _GDIPlus_GraphicsDrawLine($hBackbuffer, ($largura - 20) / 2 - 1 + $cos, ($altura - 60) / 2, 389, 270, $hPen2) EndIf If $iSec Then Local $resposta = '' Select Case $ang[0] == 0 Or $ang[0] = 360 $resposta = '#1 secante[não existe]' Case $ang[0] > 0 And $ang[0] < 90 $resposta = '#2 secante[' & $ang[0] & '] angulo[' & 90 + $ang[0] & ']' Case $ang[0] == 90 Or $ang[0] == 180 $resposta = '#3 secante[não existe]' Case $ang[0] > 90 And $ang[0] < 180 $resposta = '#4 secante[' & $ang[0] & '] angulo[' & $ang[0] - 90 & ']' Case $ang[0] > 180 And $ang[0] < 270 $resposta = '#5 secante[' & $ang[0] & ']' Case $ang[0] > 270 And $ang[0] < 360 $resposta = '#6 secante[' & $ang[0] & ']' EndSelect $nn1 = 389 + 0 + 1 / Int(200 * Cos(($ang[0] / 180) * $PI)) $nn2 = 270 + 0 - $sen ConsoleWrite('nn1[' & $nn1 & '] nn2[' & $nn2 & ']' & @LF) _GDIPlus_GraphicsDrawLine($hBackbuffer, ($largura - 20) / 2 - 1, ($altura - 60) / 2, 389 + $cos, 270, $hPen2) _GDIPlus_GraphicsDrawLine($hBackbuffer, ($largura - 20) / 2 - 1 , ($altura - 60) / 2, 389+$cos, 270-$sen, $hPen2) _GDIPlus_GraphicsDrawLine($hBackbuffer, 389 + $cos, 270 - $sen, 389 + $cos, 270, $hPen) ;_GDIPlus_GraphicsDrawLine($hBackbuffer, 389 + $cos, 270 - $sen, $nn1, $nn2, $hPen2) ;~ _GDIPlus_GraphicsDrawEllipse($hBackbuffer, ($largura - 20) / 2 - 250 - 1, ($altura - 60) / 2 - 250, 500, 500) ConsoleWrite($resposta & @LF) EndIf If $iInverso Then Local $invertido = _Iif($ang[0] > 180, $ang[0] - 180, 180 + $ang[0]) $invertido = _Iif($invertido = 360, 0, $invertido) $invertido = StringFormat('%.2f', $invertido) _GDIPlus_GraphicsDrawLine($hBackbuffer, ($largura - 20) / 2 - 1, ($altura - 60) / 2, 389 - $cos, 270 + $sen, $hPen3) _GDIPlus_GraphicsDrawStringEx($hBackbuffer, 'º[' & $invertido & ']', $hFont, $hInv, $hStringFormat, $hBrush_03) EndIf _GDIPlus_GraphicsDrawLine($hBackbuffer, ($largura - 20) / 2 - 1, ($altura - 60) / 2, 389 + $cos, 270 - $sen, $hPen3) _GDIPlus_GraphicsDrawImageRect($hGraphic, $hBitmap, 10, 50, $largura - 20, $altura - 60) EndFunc ;==>_update Func _exit() _GDIPlus_BrushDispose($hBrush_01) _GDIPlus_BrushDispose($hBrush_02) _GDIPlus_BrushDispose($hBrush_03) _GDIPlus_FontFamilyDispose($hFamily) _GDIPlus_FontDispose($hFont) _GDIPlus_StringFormatDispose($hStringFormat) _GDIPlus_GraphicsDispose($hBackbuffer) _GDIPlus_BitmapDispose($hBitmap) _GDIPlus_PenDispose($hPen) _GDIPlus_PenDispose($hPen2) _GDIPlus_PenDispose($hPen3) _GDIPlus_GraphicsDispose($hGraphic) _GDIPlus_Shutdown() Exit EndFunc ;==>_exit Func _box($hToGraphic, $ix1, $iy1, $il, $ia) Local $aBox[5][2] $aBox[0][0] = 4 $aBox[1][0] = $ix1 $aBox[1][1] = $iy1 $aBox[2][0] = $ix1 + $il $aBox[2][1] = $iy1 $aBox[3][0] = $ix1 + $il $aBox[3][1] = $iy1 + $ia $aBox[4][0] = $ix1 $aBox[4][1] = $iy1 + $ia _GDIPlus_GraphicsDrawPolygon($hToGraphic, $aBox) EndFunc ;==>_box Func _ang($xx1, $yy1, $xx2, $yy2) Local $arr[2], $ca = Abs($yy2 - $yy1), $co = Abs($xx2 - $xx1) Select Case $xx1 > $xx2 Select Case $yy1 < $yy2 $arr[0] = ATan(($co) / ($ca)) * $radToDeg + 90 Case $yy1 == $yy2 $arr[0] = 180 Case $yy1 > $yy2 $arr[0] = 270 - ATan(($co) / ($ca)) * $radToDeg EndSelect Case $xx1 == $xx2 Select Case $yy1 < $yy2 $arr[0] = 90 Case $yy1 == $yy2 $arr[0] = 0 Case $yy1 > $yy2 $arr[0] = 270 EndSelect Case $xx1 < $xx2 Select Case $yy1 < $yy2 $arr[0] = 90 - ATan(($co) / ($ca)) * $radToDeg Case $yy1 == $yy2 $arr[0] = 0 Case $yy1 > $yy2 $arr[0] = ATan(($co) / ($ca)) * $radToDeg + 270 ;$arr[0] = 270 - ATan(($co) / ($ca)) * $radToDeg EndSelect EndSelect $arr[0] = StringFormat('%.2f', $arr[0]) $arr[1] = Sqrt($co ^ 2 + $ca ^ 2) Return $arr EndFunc ;==>_ang Func _Iif($aa, $bb, $cc) If $aa Then Return $bb Return $cc EndFunc ;==>_Iif -
Need a better alternative to move many GDI box/fields
martin replied to Luigi's topic in AutoIt General Help and Support
If you want to move items which have been drawn, which amounts to redrawing evrything with the moved item in the new place, then I think there is no choice but to use the mouse X,Y position and work everything out and use double buffering for your graphics. I think you need something like this pseudocode. global $arrayOfElements[100];to be redimed as needed Global $ElementCount, $hovered func createItemType1 $Elementcount += 1; $arrayOfElements[$ElementCount] = createItem1 endfunc func drawAll clearcanvas for $n = 1 to $ElementCount drawelement($arrayOfElements[$n) next endfunc func OnMouseMove if not $mousedown for $n = 1 to $ElementCount if isInItem($arrayOfElements[$n]) then $hovered = $n next else if mousexy <> lastmousexy then setnewpos($arrayOfElements[$hovered],lastmousexy, mousexy) drawall endif endfunc func onMouseDown $Mousedown = true endfunc func onMouseUp $Mousedown = false endfunc For the function isInItem then >Malkey has done some work on this. Every item created would have to have some border set as a set of lines or points to make an enclosed shape. Then Malkeys functions can be used to see if the x,y coord is inside an item. There are example in that thread showing how you can detect a cursor is inside different shapes. -
Disable touch input with BlockInput
martin replied to tlman12's topic in AutoIt General Help and Support
Definitely not the case.