Jump to content

Leaderboard

Popular Content

Showing content with the highest reputation on 09/29/2014 in all areas

  1. I decided to make this program to calculate distances based off of GPS coordinates. My next step is to calculate it with differences in elevation between the GPS points. I got the code from here http://www.movable-type.co.uk/scripts/latlong-vincenty.html http://www.movable-type.co.uk/scripts/latlong.html The Autoit _Radian() function doesn't output all the time because sometimes the IsNumber() function thinks the float is not a number... don't ask me why... so the /57.2957795130823 in my code used to be _Radian(). I got the Haversine function to work correctly but the Vincenty one is still broken. If you see anything in my code that doesn't add up, that would be helpful... The atan2() function missing might be the problem but i kinda doubt it. http://www.autoitscript.com/forum/index.php?showtopic=17501 From http://www.movable-type.co.uk/scripts/latlong.html The atan2() function widely used here takes two arguments, atan2(y, x), and computes the arc tangent of the ratio y/x. It is more flexible than atan(y/x), since it handles x=0, and it also returns values in all 4 quadrants -π to +π (the atan function returns values in the range -π/2 to +π/2). #include <Math.au3> #include <GUIConstants.au3> Global $PI = 4 * ATan(1) ;Global $PI = 3.14159265358979323846264338327950288419716939937510 ; Calculate geodesic distance (in m) between two points specified by latitude/longitude (in DMS) ; using Vincenty inverse formula for ellipsoids func distVincenty($lat1, $lon1, $lat2, $lon2, $radius = 6378137) $lat1 = DMStoDD($lat1) $lat2 = DMStoDD($lat2) $lon1 = DMStoDD($lon1) $lon2 = DMStoDD($lon2) ; WGS-84 ellipsiod $a = 6378137 $b_new = 6356752.3142 $f = 1/298.257223563 $a = $radius $L = ($lon2-$lon1)/57.2957795130823 $U1 = ATan ((1-$f) * Tan ($lat1/57.2957795130823)) $U2 = ATan ((1-$f) * Tan ($lat2/57.2957795130823)) $sinU1 = Sin ($U1) $cosU1 = Cos ($U1) $sinU2 = Sin ($U2) $cosU2 = Cos ($U2) $lambda = $L $lambdaP = 2 * $PI $iterLimit = 256 While (Abs($lambda-$lambdaP) > 10^-12) And ($iterLimit > 0) $iterLimit -= 1 $sinLambda = Sin($lambda) $cosLambda = Cos($lambda) $sinSigma = Sqrt (($cosU2*$sinLambda) * ($cosU2*$sinLambda) + ($cosU1*$sinU2-$sinU1*$cosU2*$cosLambda) * ($cosU1*$sinU2-$sinU1*$cosU2*$cosLambda)) If $sinSigma==0 Then Return 0; co-incident points $cosSigma = $sinU1*$sinU2 + $cosU1*$cosU2*$cosLambda $sigma = atan($sinSigma/$cosSigma) $sinAlpha = $cosU1 * $cosU2 * $sinLambda / $sinSigma $cosSqAlpha = 1 - $sinAlpha*$sinAlpha $cos2SigmaM = $cosSigma - 2*$sinU1*$sinU2/$cosSqAlpha ;If (IsNumber($cos2SigmaM)) Then $cos2SigmaM = 0; equatorial line: cosSqAlpha=0 (§6) $C = $f/16*$cosSqAlpha*(4+$f*(4-3*$cosSqAlpha)) $lambdaP = $lambda; $lambda = $L + (1-$C) * $f * $sinAlpha * ($sigma + $C*$sinSigma*($cos2SigmaM+$C*$cosSigma*(-1+2*$cos2SigmaM*$cos2SigmaM))) WEnd If ($iterLimit==0) Then Return "NaN"; formula failed to converge $uSq = $cosSqAlpha * ($a*$a - $b_new*$b_new) / ($b_new*$b_new) $A = 1 + $uSq/16384*(4096+$uSq*(-768+$uSq*(320-175*$uSq))) $B = $uSq/1024 * (256+$uSq*(-128+$uSq*(74-47*$uSq))) $innerb = -1 + 2 * $cos2SigmaM * $cos2SigmaM $innerc = -3 + 4 * $sinSigma * $sinSigma $innerd = -3 + 4 * $cos2SigmaM * $cos2SigmaM $innere = $B/6 * $cos2SigmaM $innera = ($cosSigma * ($innerb) - $innere * ($innerc) * ($innerd)) $innerz = $cos2SigmaM + $B/4 $innery = $B * $sinSigma $deltaSigma = $innery * ($innerz * $innera) $s = $b_new * $A * ($sigma-$deltaSigma) Return $s; EndFunc func distHaversine($lat1, $lon1, $lat2, $lon2, $radius = 6378135) $lat1 = DMStoDD($lat1) $lat2 = DMStoDD($lat2) $lon1 = DMStoDD($lon1) $lon2 = DMStoDD($lon2) $R = 6378135; // earth's mean radius in M (wikipedia) $dLat = ($lat2-$lat1)/57.2957795130823 $dLon = _Radian($lon2-$lon1) $lat1 = _Radian($lat1) $lat2 = _Radian($lat2) $R = $radius $a = sin($dLat/2) * sin($dLat/2) + cos($lat1) * cos($lat2) * sin($dLon/2) * sin($dLon/2) $c = 2 * atan(sqrt($a)/sqrt(1-$a)); $d = $R * $c; return $d; EndFunc ; convert DMS to DD // convert from DMS to DD, decimal degrees = whole number of degrees, plus minutes divided by 60, plus seconds divided by 3600. Func DMStoDD($DMS) $neg = False If StringInStr($DMS, "S") Or StringInStr($DMS, "E") Or StringInStr($DMS, "-")Then $neg = True EndIf $DMS = StringSplit(StringStripWS(StringRegExpReplace($DMS, "[^\d\s]", " "), 7), " ") Switch $DMS[0] Case 1 $DD = $DMS[1] Case 2 $DD = $DMS[1] + $DMS[2]/60 Case 3 $DD = $DMS[1] + $DMS[2]/60 + $DMS[3]/3600 Case 4 $temp = "." & $DMS[4] $DMS[3] += $temp $DD = $DMS[1] + $DMS[2]/60 + $DMS[3]/3600 EndSwitch ;MsgBox (0, "", $DD) If $neg Then Return -$DD Else Return $DD EndIf EndFunc #Region ### START Koda GUI section ### Form= $Form1 = GUICreate("DMS Points to Distance", 633, 150, 199, 123) $lat1 = GUICtrlCreateInput("53 09 02N", 72, 24, 217, 21) $lon1 = GUICtrlCreateInput("001 50 40W", 360, 24, 217, 21) $lat2 = GUICtrlCreateInput("52 12 19N", 72, 56, 217, 21) $lon2 = GUICtrlCreateInput("000 08 33W", 360, 56, 217, 21) $Label1 = GUICtrlCreateLabel("lat 1", 16, 24, 43, 17) $Label2 = GUICtrlCreateLabel("long 1", 304, 24, 43, 17) $Label3 = GUICtrlCreateLabel("lat 2", 16, 56, 43, 17) $Label4 = GUICtrlCreateLabel("long 2", 304, 56, 43, 17) $CalculateH = GUICtrlCreateButton("Calculate Distance With Haversine", 56, 96, 201, 20, 0) $CalculateV = GUICtrlCreateButton("Calculate Distance With Vincenty", 56, 120, 201, 20, 0) $Result = GUICtrlCreateInput("Results", 312, 104, 241, 21) GUISetState(@SW_SHOW) #EndRegion ### END Koda GUI section ### While 1 $nMsg = GUIGetMsg() Switch $nMsg Case $CalculateH GUICtrlSetData($Result, distHaversine(GUICtrlRead($lat1), GUICtrlRead($lon1), GUICtrlRead($lat2), GUICtrlRead($lon2))) Case $CalculateV GUICtrlSetData($Result, distVincenty(GUICtrlRead($lat1), GUICtrlRead($lon1), GUICtrlRead($lat2), GUICtrlRead($lon2))) Case $GUI_EVENT_CLOSE Exit EndSwitch WEndLet me know what you think! ps it outputs in KM (Haversine) or M (Vincenty) Edit Fixed: Vincenty function works kinda... the isNumber() was acting up as well as the 2 different $b $B variables. I split up some of the calculations now as well. It still acts up on long distances... any ideas??? Both output in meters now.
    1 point
  2. Kernel Objects Information Sample output of Object Handles probing _ I've assembled a number of UDF's which use "undocumented" features of the O/S over the years. And this here would be the latest, and possibly the last (I hope?). The purpose of this UDF is to query kernel objects in the system. It's actually a pretty big UDF that ties together a lot of functionality, and hopefully makes it more accessible. With the UDF you can: Query a Kernel Object for 'hidden' information using its handle: Object Type and stats (_ObjectGetTypeInfoUD), Attributes and Access (_ObjectGetBasicInfoUD), Kernel Object Name (_ObjectGetNameUD), etc Query certain Kernel Event Objects for current states:Event, IoCompletion and Mutex ("Mutant") signal states (and more), Semaphore counts, Timer's remaining time, etc Get a list of opened File handles and filenames (there's already a few UDF's dedicated to that, though) Collect all the current handles held by the O/S and its processes, using specific filters, and get information on what the object is and its current state Kernel Objects Inspector script _ What's an Object you say? Whats a Kernel? Whats an NT? Gosh, maybe you shouldn't be here - go read Youtube. As Windows programmers, we make use of these Kernel Objects all the time... Object Types List Some of the most common System Objects: Token, Process, Thread, Event, Mutant (Mutex), Semaphore, Timer, File (includes NamedPipe and Mailslot), Key (Registry Key) Anytime you work with these objects, you are generating new objects at the kernel level. Luckily, the O/S allows above 16 million handles per process (see Pushing the Limits of Windows: Handles by Mark Russinovich), so this isn't a concern. However, if an individual process has in excess of 16K handles, there will be some trunacted values returned from the NT API call as it only returns 16-bit values for handles. See >this post where I try to describe this in better detail. However, this is no longer a problem with the latest update, which restores the upper bits of handles through a simple wraparound detection technique. There's more to say, but perhaps its best to show what functions are available. From the NTKernelObjectsInfo UDF Header: Querying time issues: Note that any call to query handles (_NTObjGetHandlesUD, _NTObjGetHandlesInfoEx) relies on a call to NtQuerySystemInformation, which gathers information on EVERY handle held by the system and it's processes. This can take a few seconds! Be patient. (Also, _NTObjBuildTypesIndexMap calls it indirectly) IMPORTANT: Be a little careful with looking for 'File' objects on Vista and Win7.. on XP there's already some safeguards which unfortunately prevent detecting certain objects. Newer versions of the O/S don't seem to have problems with threaded probing of File objects, but there may be some cases.. The Console output is still a bit noisy, but its good for analyzing where there's problems in reading handles, or analyzing "File" handles which can cause major problems, especially in the case of NamedPipes. Some example UDFs are included: NTSystemObjectsList: displays a list of System Object Types NTKernelObjectsCollectExample: A collection query at its simplest (see below for this example) NTKernelObjectsSelfExamine: creates a number of different Objects before listing everything NTKernelObjectsInspect: Inspect Kernel Objects with Filtering options from a GUI This GUI needs work! Notice that with the ArrayDisplay function, there is a 'Run User Func' option which will display any extra info retrieved for the object (see ExInfo column). NTKernelObjectsSpam: Creates a crapload of Kernel Objects. This is mostly useless, but its here to demonstrate how NTKernelObjectsInspect now is able to report correct handle values beyond 65,536 NTKernelObjectsCollectExample In this example I query only 2 processes for handles, and use exclusion criteria to remove "File" and "EtwRegistration" from the resultant list. ; =========================================================================================================== ; <NTKernelObjectsCollectExample.au3> ; ; Pretty barebones example of NTKernelObjectsInfo, showing the ease with which objects can be collected ; Uses multipe query types, multiple processes, and multiple Object Types with exclusion rules ; ; Author: Ascend4nt ; =========================================================================================================== #include "NTKernelObjectsInfo.au3" #include <Array.au3> ; -= FLAGS to Tweak Object Querying =- ; Force Win2000/XP Attribute skipping (must appear AFTER #include): ;$g_NTKO_bNamedPipeProtect = True ; Alternatively set own: ;$g_NTKO_sFileAttribSkipList = "0x0012019F|" ; Additionally, can force BadMask Skipping to OFF (not recommended): ;$g_NTKO_bSkipBadMasks = False ; Other queries available, although less often used: ; $NTOBJ_QUERYBY_PID (example: @AuotItPID), $NTOBJ_QUERYBY_OBJTYPE (ex: 28), and $NTOBJ_QUERYBY_HANDLE (actual object handle) $aRet = _NTObjGetHandlesInfoEx($NTOBJ_QUERYBY_PROCESSNAME, "firefox.exe|autoit3.exe", _ $NTOBJ_QUERYBY_OBJTYPENAME + $NTOBJ_QUERY_EXCLUDE, "File|EtwRegistration") ConsoleWrite("Errors: " & @error & ", @extended = " & @extended & @CRLF) _ArrayDisplay($aRet, "_NTObjGetHandlesInfoEx") Thanks for testing this out! Change History: NTKernelObjects.zip ~prev Downloads: 55
    1 point
  3. 1 point
  4. Xibalba, You can indeed skip that line - but you seemed to require it in your OP so I left it in. The main point is that you can redeclare an array whenever you wish - but you will overwrite the existing content when you do so. As I said before - a little more detail of exactly what you are trying to do might help. Just asking basic array questions is unlikely to get you a satisfactory answer - giving us a concrete case might well do just that. m23
    1 point
  5. If you don't want to set the values upon declaration you must do like this Local $numbers[4] $numbers[0] = 23 $numbers[1] = 65 $numbers[2] = 3 $numbers[3] = 88
    1 point
  6. MikahS

    hotkey Stop script

    Doesn't want to exit
    1 point
  7. JohnOne

    Im new here .. how to ..

    Well done ia85,
    1 point
  8. Xandy

    Im new here .. how to ..

    This code will replace 'sleep()' so that your script does not lockup or halt during the sleep() command. You can process other information, instead of idling (sleeping) with this code. $timer_len= 2*60*1000;set the timer for two min $timer= timerinit();start the timer While 1 if timerdiff($timer)>= $timer_len then;check the timer $timer= timerinit();reset timer WinActivate("[CLASS:Notepad]", "");do that thing endif WEnd .I'm not sure about the elegant focus. You could use a handle to only activate a specific notepad window. Is that what you want?
    1 point
  9. Which part of the warning you got in 2012 was unclear to you? You have 5 days to re-read our forumrules. Jos
    1 point
  10. Well, then try this: ;coded by UEZ build 2014-09-27 #include <GDIPlus.au3> #include <GUIConstantsEx.au3> #include <WindowsConstants.au3> _GDIPlus_Startup() Global $iCountdown = 20 ;in seconds Global Const $iW = 800, $iH = 50, $STM_SETIMAGE = 0x0172 Global Const $hGUI = GUICreate("Test", $iW, $iH, -1, -1, $WS_POPUP) Global Const $hPic = GUICtrlCreatePic("", 0, 0, $iW, $iH) Global Const $hRegion = _WinAPI_CreateRoundRectRgn(0, 0, $iW + 1, $iH + 1, 12, 12) _WinAPI_SetWindowRgn($hGUI, $hRegion) Global $hGDIBmp_Bg = _GDIPlus_BitmapCreateRoundCornerRectProgressbar(100, $iCountdown & " seconds left to start rocket", $iW, $iH, 6) _WinAPI_DeleteObject(GUICtrlSendMsg($hPic, $STM_SETIMAGE, $IMAGE_BITMAP, $hGDIBmp_Bg)) GUISetState() Global $iDiff, $iTimer = TimerInit() Do Switch GUIGetMsg() Case $GUI_EVENT_CLOSE _Exit() EndSwitch $iDiff = (TimerDiff($iTimer) / 1000) If $iDiff < $iCountdown + 1 Then $hGDIBmp_Bg = _GDIPlus_BitmapCreateRoundCornerRectProgressbar(100 - $iDiff / $iCountdown * 100, Int($iCountdown - $iDiff) & " seconds left to take off", $iW, $iH, 6) _WinAPI_DeleteObject(GUICtrlSendMsg($hPic, $STM_SETIMAGE, $IMAGE_BITMAP, $hGDIBmp_Bg)) _WinAPI_DeleteObject($hGDIBmp_Bg) Else $hGDIBmp_Bg = _GDIPlus_BitmapCreateRoundCornerRectProgressbar(0, "Taking off...", $iW, $iH, 6) _WinAPI_DeleteObject(GUICtrlSendMsg($hPic, $STM_SETIMAGE, $IMAGE_BITMAP, $hGDIBmp_Bg)) _WinAPI_DeleteObject($hGDIBmp_Bg) Sleep(2000) _Exit() EndIf Until False Func _Exit() _WinAPI_DeleteObject($hRegion) _WinAPI_DeleteObject($hGDIBmp_Bg) GUIDelete() _GDIPlus_Shutdown() Exit EndFunc ;==>_Exit Func _GDIPlus_BitmapCreateRoundCornerRectProgressbar($fPerc, $sText, $iW, $iH, $iRadius_Corner = 6, _ $iColorOuter_Pb = 0xFFC4A000, $iColorInner_Pb = 0xFFFCE94F, $iColorOuter_Bg = 0xFFA0A0A0, $iColorInner_Bg = 0xFFD3D7CF, _ $iSizeBorder_Bg = 4, $iSizeBorder_Pb = 4, _ $sFont = "Arial Black", $fFontSize = 20, $iColor_FontBorder = 0xFF101010, $iColor_Font = 0xFFFFFFFF, $iSizeBorder_Ft = 2, $bGDIBitmap = True) Local Const $hBitmap = _GDIPlus_BitmapCreateFromScan0($iW, $iH), $hGraphics = _GDIPlus_ImageGetGraphicsContext($hBitmap) _GDIPlus_GraphicsSetSmoothingMode($hGraphics, 4) #Region background Local Const $hPath = _GDIPlus_PathCreate() Local $iWidth = $iW - $iSizeBorder_Bg - 1, $iHeight = $iH - $iSizeBorder_Bg - 1 _GDIPlus_PathAddArc($hPath, $iSizeBorder_Bg / 2, $iSizeBorder_Bg / 2, $iRadius_Corner * 2, $iRadius_Corner * 2, 180, 90) ;left upper corner _GDIPlus_PathAddArc($hPath, $iWidth - $iRadius_Corner * 2 + $iSizeBorder_Bg / 2, $iSizeBorder_Bg / 2, $iRadius_Corner * 2, $iRadius_Corner * 2, 270, 90) ;right upper corner _GDIPlus_PathAddArc($hPath, $iWidth - $iRadius_Corner * 2 + $iSizeBorder_Bg / 2, $iHeight - $iRadius_Corner * 2 + $iSizeBorder_Bg / 2, $iRadius_Corner * 2, $iRadius_Corner * 2, 0, 90) ;right bottom corner _GDIPlus_PathAddArc($hPath, $iSizeBorder_Bg / 2, $iHeight - $iRadius_Corner * 2 + $iSizeBorder_Bg / 2, $iRadius_Corner * 2, $iRadius_Corner * 2, 90, 90) ;left bottm corner _GDIPlus_PathCloseFigure($hPath) Local $hPen = _GDIPlus_PenCreate($iColorOuter_Bg, $iSizeBorder_Bg), $hBrush = _GDIPlus_BrushCreateSolid($iColorInner_Bg) _GDIPlus_GraphicsDrawPath($hGraphics, $hPath, $hPen) _GDIPlus_GraphicsFillPath($hGraphics, $hPath, $hBrush) #EndRegion background #Region progressbar Local $iX = 3 * $iSizeBorder_Pb, $iY = 3 * $iSizeBorder_Pb $iHeight = $iH - 2 * $iY $fPerc = $fPerc < 0 ? 0 : $fPerc > 100 ? 100 : $fPerc $iWidth = ($iW - 2 * $iX) * $fPerc / 100 _GDIPlus_PathReset($hPath) _GDIPlus_PenSetColor($hPen, $iColorOuter_Pb) _GDIPlus_PenSetWidth($hPen, $iSizeBorder_Pb) _GDIPlus_BrushSetSolidColor($hBrush, $iColorInner_Pb) _GDIPlus_PathAddRectangle($hPath, $iX, $iY, $iWidth, $iHeight) _GDIPlus_GraphicsDrawPath($hGraphics, $hPath, $hPen) _GDIPlus_GraphicsFillPath($hGraphics, $hPath, $hBrush) #EndRegion progressbar #Region text render _GDIPlus_PathReset($hPath) Local Const $hFormat = _GDIPlus_StringFormatCreate() Local Const $hFamily = _GDIPlus_FontFamilyCreate($sFont) Local Const $tLayout = _GDIPlus_RectFCreate(0, 0, $iW, $iH) _GDIPlus_StringFormatSetAlign($hFormat, 1) _GDIPlus_StringFormatSetLineAlign($hFormat, 1) _GDIPlus_GraphicsSetTextRenderingHint($hGraphics, 4) _GDIPlus_PathAddString($hPath, $sText, $tLayout, $hFamily, 0, $fFontSize, $hFormat) _GDIPlus_PenSetColor($hPen, $iColor_FontBorder) _GDIPlus_PenSetWidth($hPen, $iSizeBorder_Ft) _GDIPlus_BrushSetSolidColor($hBrush, $iColor_Font) _GDIPlus_GraphicsDrawPath($hGraphics, $hPath, $hPen) _GDIPlus_GraphicsFillPath($hGraphics, $hPath, $hBrush) #EndRegion text render _GDIPlus_StringFormatDispose($hFormat) _GDIPlus_FontFamilyDispose($hFamily) _GDIPlus_PathDispose($hPath) _GDIPlus_PenDispose($hPen) _GDIPlus_BrushDispose($hBrush) _GDIPlus_GraphicsDispose($hGraphics) If $bGDIBitmap Then Local Const $hGDIBmp_Bg = _GDIPlus_BitmapCreateHBITMAPFromBitmap($hBitmap) _GDIPlus_BitmapDispose($hBitmap) Return $hGDIBmp_Bg EndIf Return $hBitmap EndFunc ;==>_GDIPlus_BitmapCreateRoundCornerRectProgressbar Br, UEZ
    1 point
  11. It seems to me that I used $SS_CENTERIMAGE to get vertical centering on a label control.
    1 point
  12. You can try the following code. I assume your running beta. ;Menu Help ;Stephen Podhajecki [eltorro] gehossafats@netmdc.com #Include <GuiConstants.au3> #include <Array.au3> Global $USE_TOOLTIP = TRUE Global $DEBUG = True Local $aCtrlArray[1], $aCtrlMsgArray[1],$ControlID, $Global_I = 0, $__ControlID, $HoverActive = 0, $Temp_Found = 0, $szTemp_Array[2] Global $defaultstatus = "Ready" Global $status Global $Timer Global Const $WM_MENUSELECT = 0x011F GUIRegisterMsg($WM_MENUSELECT,"MouseOverMenu") $Form1 = GUICreate('TITLE', 400, 285) $filemenu = GUICtrlCreateMenu("&File") _AddCtrl($filemenu,"FileMenu") $file1 = GUICtrlCreateMenuitem("Label 1", $filemenu) _AddCtrl($file1,"This is Label1") $file2 = GUICtrlCreateMenuitem("Label 2", $filemenu) _AddCtrl($file2,"Label 2 at Your Service") $file3 = GUICtrlCreateMenuitem("Label3", $filemenu) _AddCtrl($file3,"Pleased to meet you from Label 3") $file4 = GUICtrlCreateMenuitem("Label 4", $filemenu) _AddCtrl($file4,"Well, you get the picture, Label 4") $statuslabel = GUICtrlCreateLabel($defaultstatus, 0, 250, 300, 16, BitOR($SS_SIMPLE, $SS_SUNKEN)) $statuslabel2 =GUICtrlCreateLabel($defaultstatus, 300, 250, 100, 16, BitOR($SS_SIMPLE, $SS_SUNKEN)) $file11= GUICtrlCreateMenuitem("Label 11",$file1) GUISetState() While 1 $msg = GUIGetMsg() Select Case $msg = $GUI_EVENT_CLOSE ExitLoop Case $msg = $file1 MsgBox(266288,"Menu Clicked","Label1 clicked.") EndSelect ;~ $t_Sec = int( TimerDiff($Timer)/1000) ;~ ;if $t_Sec = int($t_Sec) then ;~ GuiCtrlSetData($statuslabel2,$t_Sec) ;~ ;EndIf ;~ ;~ if TimerDiff($Timer) >3000 Then ToolTip("") WEnd Exit Func MouseOverMenu($hWndGUI, $MsgID, $WParam, $LParam) if $DEBUG then ConsoleWrite( "hWndGui= "&$hWndGUI& @LF &"MsgId= "&$MsgID& @LF &"WParam= " &$WParam& @LF &"$LParam= "&$LParam& @LF) Local $id = BitAnd($WParam, 0xFFFF) if $DEBUG then ConsoleWrite("ID= "& $id & @LF) for $x= 0 to UBound($aCtrlArray)-1 if $id = ($aCtrlArray[$x]) then GuiCtrlSetData($statuslabel , $aCtrlMsgArray[$x]) if $USE_TOOLTIP then ToolTip($aCtrlMsgArray[$x]) ;~ $Timer = TimerInit() ExitLoop EndIf Next Return $GUI_RUNDEFMSG EndFunc Func _AddCtrl($ControlID,$ControlMsg) _ArrayAdd($aCtrlArray,$ControlID) _ArrayAdd($aCtrlMsgArray,$ControlMsg) EndFunc Regards
    1 point
×
×
  • Create New...