Bilgus Posted June 22, 2016 Share Posted June 22, 2016 (edited) You did try what nickston proposed correct? _TrayIconSetToolTip($nTrayIcon1, "Datornamn: " & @ComputerName & @CRLF & "IPAdress: " & @IPAddress1 & " ," & @IPAddress2 & @CRLF & "Gateway: " & "127.000.000.001") I'd say also try one at a time the same thing with @computername, @IpAddress1, @IpAddress2 I assume the Ip addresses are IPv4 and not IPv6 aswell all else fails try setting a loop sending strings and up the length till it breaks I don't have windows 10 I assume that is what you are using on both of these devices When you say you set the laptop to 63 do you mean the buffer size or StringLeft($sToolTip,63)? Edited June 22, 2016 by Bilgus Link to comment Share on other sites More sharing options...
lgvlgv Posted June 23, 2016 Share Posted June 23, 2016 im going to set a fixed length and run it for a while with Global $sNOTIFYICONDATAW = "dword;" & _ ; Struct size "hwnd;" & _ ; Callback window handle "uint;" & _ ; Icon ID "uint;" & _ ; Flags "uint;" & _ ; Callback message ID "hwnd;" & _ ; Icon handle "WCHAR[64];" & _ ; ToolTip text "dword;" & _ ; Icon state "dword;" & _ ; Icon state mask "WCHAR[256];" & _ ; Balloon ToolTip text "uint;" & _ ; Timeout / Version -> NIM_SETVERSION values 0, 3, 4 "WCHAR[64];" & _ ; Balloon ToolTip title text "dword" ; Balloon ToolTip info flags if @OSVersion = "WIN_10" THEN $sNOTIFYICONDATAW &= ";BYTE[128];" & _ ; Guid "hwnd" ; Balloon ToolTip IconHandle and ;********************************************************************** ; _TrayIconSetToolTip($NotificationID, $sToolTip) ;********************************************************************** Func _TrayIconSetToolTip($nID = -1, $sToolTip = $sDefaultTT) If $nID = -1 Then $nID = $TRAYLASTID If $TRAYMSGWND = 0 Or $nID <= 0 Then Return 0 Local $stNID = DllStructCreate($sNOTIFYICONDATAW) DllStructSetData($stNID, 1, DllStructGetSize($stNID)) DllStructSetData($stNID, 2, $TRAYMSGWND) DllStructSetData($stNID, 3, $nID) DllStructSetData($stNID, 4, $NIF_TIP) DllStructSetData($stNID, 7, StringLeft($sToolTip,127)) ; DllStructSetData($stNID, 7, $sToolTip) Return Shell_NotifyIcon($NIM_MODIFY, DllStructGetPtr($stNID)) EndFunc Main loop expandcollapse popupIf $LatencyTest = 1 Then If TimerDiff($iBegin) > $InternetCheckTime Then ; Loop until 5 sec have passed Local $gate = _GetGatewayIP() _DebugOut("GATE: " & $gate) Local $iPing = Ping($LatencyUrl, $LatencyMS) If @error Then If @error = 1 Then _TrayIconSetIcon($nTrayIcon1, @ScriptFullPath, -5) Local $tool = StringLen(@ComputerName & @CRLF & "IP: " & @IPAddress1 & @CRLF & "Gate: " & $gate & @CRLF & " error: " & @error & ", Host is offline.") _DebugOut("Error1: " & $tool) ; _TrayIconSetToolTip($nTrayIcon1, @ComputerName & @CRLF & "IP: " & @IPAddress1 & @CRLF & "Gate: " & $gate & @CRLF & " error: " & @error & ", Host is offline.") _TrayIconSetToolTip($nTrayIcon1, "blablabla" & @CRLF & "IP: 127.000.000.001" & @CRLF & "Gate: bla.bla.bla.bla" & @CRLF & " error: (1) ") _DebugOut("*PING: " & @error & ", Host is offline") ElseIf @error = 2 Then _TrayIconSetIcon($nTrayIcon1, @ScriptFullPath, -5) Local $tool = StringLen(@ComputerName & @CRLF & "IP: " & @IPAddress1 & @CRLF & "Gate: " & $gate & @CRLF & " error: " & @error & ", Host is unreachable.") _DebugOut("Error2: " & $tool) ;_TrayIconSetToolTip($nTrayIcon1, @ComputerName & @CRLF & "IP: " & @IPAddress1 & @CRLF & "Gate: " & $gate & @CRLF & " error: " & @error & ", Host is unreachable.") _TrayIconSetToolTip($nTrayIcon1, "blablabla" & @CRLF & "IP: 127.000.000.001" & @CRLF & "Gate: bla.bla.bla.bla" & @CRLF & " error:(2) ") _DebugOut("*PING: " & @error & ", Host is unreachable") ElseIf @error = 3 Then _TrayIconSetIcon($nTrayIcon1, @ScriptFullPath, -5) Local $tool = StringLen(@ComputerName & @CRLF & "IP: " & @IPAddress1 & @CRLF & "Gate: " & $gate & @CRLF & " error: " & @error & ", Bad destination") _DebugOut("Error3: " & $tool) ; _TrayIconSetToolTip($nTrayIcon1, @ComputerName & @CRLF & "IP: " & @IPAddress1 & @CRLF & "Gate: " & $gate & @CRLF & " error: " & @error & ", Bad destination") _TrayIconSetToolTip($nTrayIcon1, "blablabla" & @CRLF & "IP: 127.000.000.001" & @CRLF & "Gate: bla.bla.bla.bla" & @CRLF & " error: (3) ") _DebugOut("*PING: " & @error & ", Bad destination") ElseIf @error = 4 Then _TrayIconSetIcon($nTrayIcon1, @ScriptFullPath, -5) Local $tool = StringLen(@ComputerName & @CRLF & "IP: " & @IPAddress1 & @CRLF & "Gate: " & $gate & @CRLF & " error: " & @error & ", Bad destination") _DebugOut("Error4: " & $tool) ; _TrayIconSetToolTip($nTrayIcon1, @ComputerName & @CRLF & "IP: " & @IPAddress1 & @CRLF & "Gate: " & $gate & @CRLF & " error: " & @error & ", Other errors") _TrayIconSetToolTip($nTrayIcon1, "blablabla" & @CRLF & "IP: 127.000.000.001" & @CRLF & "Gate: bla.bla.bla.bla" & @CRLF & " error: (4) ") _DebugOut("*PING: " & @error & ", Other errors") EndIf Else _DebugOut("*PING: The roundtrip-time took: " & $iPing & "ms.") If $iPing > "200" Then _TrayIconSetIcon($nTrayIcon1, @ScriptFullPath, -6) Else _TrayIconSetIcon($nTrayIcon1, @ScriptFullPath, -1) EndIf Local $tool = StringLen(@ComputerName & @CRLF & "IP: " & @IPAddress1 & @CRLF & "Gate: " & $gate & @CRLF & "Internet: " & $iPing & " Ms.") _DebugOut("Good: " & $tool) ; _TrayIconSetToolTip($nTrayIcon1, @ComputerName & @CRLF & "IP: " & @IPAddress1 & @CRLF & "Gate: " & $gate & @CRLF & "Internet: " & $iPing & " Ms.") _TrayIconSetToolTip($nTrayIcon1, "blablabla" & @CRLF & "IP: 127.000.000.001" & @CRLF & "Gate: bla.bla.bla.bla" & @CRLF & " error: (0) ") EndIf $iBegin = TimerInit() EndIf . Link to comment Share on other sites More sharing options...
lgvlgv Posted June 23, 2016 Share Posted June 23, 2016 (edited) hm, the abow Always cut the tip to blablabla IP: 127.000.000.001 Gate: bla.bla.bla.bla error:( So its missing "?) " Edited June 23, 2016 by lgvlgv Link to comment Share on other sites More sharing options...
lgvlgv Posted June 23, 2016 Share Posted June 23, 2016 also my machine at work, a virtuell windows 8.1 have been running the script over 24 hours without any problems. Link to comment Share on other sites More sharing options...
lgvlgv Posted June 23, 2016 Share Posted June 23, 2016 (edited) Update: did a test of when it hangs. after the 425 time of updateing the toolicontip it stopped. the check was set to update the tip every 6 sec, no more no less.. so it must be the way it updates not the string length in it self. so for 425 times it updated the tip correct, then start to run wild in cpu 20% utilisation and not responding to input other then that the Icon menu is availeble, but u cant click anything. Checked 2 times now the magic number is 425 times done every 6 sec Edited June 23, 2016 by lgvlgv Link to comment Share on other sites More sharing options...
lgvlgv Posted June 24, 2016 Share Posted June 24, 2016 Sorry, but u guys where right all along it was the _gateway function that coused problem. I was sure i removed it everywhere when i did the test on a fixed string, but i found it else where in the script.. problem is solved, thx for all ur help and that u took time to help me. Link to comment Share on other sites More sharing options...
Jara_Jara Posted December 25, 2017 Share Posted December 25, 2017 Hi guys, After searching a lot for solutions to have my very own system tray for Windows 10, with a Dark Theme look, I tried this UDF, and by the way it is fantastic. I tried to use it to simulate a "dark look", setting all the colors variables to a dark pattern, but the systray menus always have a gray/light border padding around the menu (and also a little bevel). I don't want to design my own systray menu system, and since I was so close to accomplish that with this UDF, could someone point me to the part of code that adds/puts this light padding around the systray menu, so I can reprogram it? giving it a flat design and really gaining the Dark Theme Windows 10 has? Thanks in advance! And Cheers from Brazil Link to comment Share on other sites More sharing options...
rumple Posted February 23, 2018 Share Posted February 23, 2018 Top job Holder, trying this in a project and looks good. Found an interesting issue when used and you set the background colour of a button on a gui though; ...even without using any of the functions and by just including ModernMenu.au3 a coloured button is blanked. It is still there and functions but not visible. Example: (un-comment the include to see issue) #include <GUIConstantsEx.au3> #include <ColorConstants.au3> ;#include <ModernMenu.au3> Example() Func Example() Local $hGUI = GUICreate("Example", 300, 200) Local $idHello = GUICtrlCreateButton("Hello", 120, 170, 85, 25) Local $idClose = GUICtrlCreateButton("Close", 210, 170, 85, 25) GUICtrlSetBkColor($idHello, $COLOR_SKYBLUE) GUISetState(@SW_SHOW, $hGUI) While 1 Switch GUIGetMsg() Case $GUI_EVENT_CLOSE, $idClose ExitLoop Case $idHello MsgBox(0, "Still Here", "Hi there") EndSwitch WEnd GUIDelete($hGUI) EndFunc ;==>Example Any suggestions ? Link to comment Share on other sites More sharing options...
LarsJ Posted February 24, 2018 Share Posted February 24, 2018 The issue is fixed in the updates in post 289. abberration 1 Controls, File Explorer, ROT objects, UI Automation, Windows Message MonitorCompiled code: Accessing AutoIt variables, DotNet.au3 UDF, Using C# and VB codeShell menus: The Context menu, The Favorites menu. Shell related: Control Panel, System Image ListsGraphics related: Rubik's Cube, OpenGL without external libraries, Navigating in an image, Non-rectangular selectionsListView controls: Colors and fonts, Multi-line header, Multi-line items, Checkboxes and icons, Incremental searchListView controls: Virtual ListViews, Editing cells, Data display functions Link to comment Share on other sites More sharing options...
LarsJ Posted November 13, 2021 Share Posted November 13, 2021 A new small update in post 289. argumentum 1 Controls, File Explorer, ROT objects, UI Automation, Windows Message MonitorCompiled code: Accessing AutoIt variables, DotNet.au3 UDF, Using C# and VB codeShell menus: The Context menu, The Favorites menu. Shell related: Control Panel, System Image ListsGraphics related: Rubik's Cube, OpenGL without external libraries, Navigating in an image, Non-rectangular selectionsListView controls: Colors and fonts, Multi-line header, Multi-line items, Checkboxes and icons, Incremental searchListView controls: Virtual ListViews, Editing cells, Data display functions Link to comment Share on other sites More sharing options...
Parsix Posted August 15, 2023 Share Posted August 15, 2023 hi, how to change background color of a item? Link to comment Share on other sites More sharing options...
Parsix Posted September 5, 2023 Share Posted September 5, 2023 error when compile with Au3Stripper #AutoIt3Wrapper_Run_Au3Stripper=y #AutoIt3Wrapper_Au3Check_Parameters=-d -w 1 -w 2 -w 6 -w 7 #Au3Stripper_Parameters=/sf #Au3Stripper_Ignore_Funcs=_traynotifyicon #Au3Stripper_Ignore_Errors_in_Funcs=_traynotifyicon,GUICtrlSetOnEvent,Call,DllCallbackRegister >Running Au3Stripper (23.402.1150.1) from:C:\Program Files (x86)\AutoIt3\SciTE\Au3Stripper cmdline: -### StripOnly/StripFunc Error: Found Call() statement using unsolvable Func, which will/could lead to removal of Funcs that are used by this Function. >### current Func: _traynotifyicon r:\libs-ext\modernmenuraw.au3(571,1): Warning for line:Call($TRAYNOTIFYIDS[$nID][5], $nID, $lParam) Link to comment Share on other sites More sharing options...
Parsix Posted September 7, 2023 Share Posted September 7, 2023 22 hours ago, moonlol said: This can happen if you are using a function from a third-party library or if you misspelled the function name. This error occurs in ModernMenuRaw.au3 (original file) Link to comment Share on other sites More sharing options...
Recommended Posts
Create an account or sign in to comment
You need to be a member in order to leave a comment
Create an account
Sign up for a new account in our community. It's easy!
Register a new accountSign in
Already have an account? Sign in here.
Sign In Now