Nine Posted March 29 Share Posted March 29 @rsn Could you explain the purpose of identifying this GUID ? Is this because, you don't want any non necessary registry entry ? “They did not know it was impossible, so they did it” ― Mark Twain Spoiler Block all input without UAC Save/Retrieve Images to/from Text Monitor Management (VCP commands) Tool to search in text (au3) files Date Range Picker Virtual Desktop Manager Sudoku Game 2020 Overlapped Named Pipe IPC HotString 2.0 - Hot keys with string x64 Bitwise Operations Multi-keyboards HotKeySet Recursive Array Display Fast and simple WCD IPC Multiple Folders Selector Printer Manager GIF Animation (cached) Screen Scraping Multi-Threading Made Easy Link to comment Share on other sites More sharing options...
rsn Posted March 29 Share Posted March 29 Not that I don't want non-necessary but I use the data in LastNotificationAddedTime to compare against the current time to create a reboot reminder notification. Link to comment Share on other sites More sharing options...
Nine Posted March 29 Share Posted March 29 Ah, I see, good strategy ! But since it is always the same GUID, you do know what and where to search it, no ? Anyway, there is a GUID inside the structure you can pass to the API. Spoiler Quote guidItem Type: GUID Windows XP and later. Windows 7 and later: A registered GUID that identifies the icon. This value overrides uID and is the recommended method of identifying the icon. The NIF_GUID flag must be set in the uFlags member. Windows XP and Windows Vista: Reserved; must be set to 0. If your application is intended to run on both Windows Vista and Windows 7, it is imperative that you check the version of Windows and only specify a nonzero guidItem if on Windows 7 or later. If you identify the notification icon with a GUID in one call to Shell_NotifyIcon, you must use that same GUID to identify the icon in any subsequent Shell_NotifyIcon calls that deal with that same icon. To generate a GUID for use in this member, use a GUID-generating tool such as Guidgen.exe. Not sure if this will work for you. Let me know. Could you also show the algorithm to calculate the time from a registry entry ? Thanks. “They did not know it was impossible, so they did it” ― Mark Twain Spoiler Block all input without UAC Save/Retrieve Images to/from Text Monitor Management (VCP commands) Tool to search in text (au3) files Date Range Picker Virtual Desktop Manager Sudoku Game 2020 Overlapped Named Pipe IPC HotString 2.0 - Hot keys with string x64 Bitwise Operations Multi-keyboards HotKeySet Recursive Array Display Fast and simple WCD IPC Multiple Folders Selector Printer Manager GIF Animation (cached) Screen Scraping Multi-Threading Made Easy Link to comment Share on other sites More sharing options...
rsn Posted March 29 Share Posted March 29 (edited) On 3/29/2024 at 8:46 AM, Nine said: Ah, I see, good strategy ! I'm humbled. Truly. 😊 I was hoping to "take ownership" of the key and make it all official looking, you know? HKEY_CURRENT_USER\SOFTWARE\Microsoft\Windows\CurrentVersion\Notifications\Settings\rsn.reboot.nag Or something like that. 🤣 I'm looking at the code for the date/time calculation and man is it a pile of slop. I never expected a real programmer to ask to see it! I'm an old school cmd scripter and it shows. The data in LastNotificationAddedTime is in NT time epoch. And in this case I was using w32tm.exe to do the calculations. So the basic snippet looks like the following. In this example, I'm defining $iLastNotificationAddedTime when in the actual I'm fetching it from the registry. $iLastNotificationAddedTime = "133552598496093801" $iPID = Run( @ComSpec & ' /c for /f "tokens=1-8 delims=/ " %a in ' & "( 'w32tm /ntte " & $iLastNotificationAddedTime & "' ) do @echo %f/%d/%e %g", "", @SW_HIDE, $STDOUT_CHILD) It changes the output from normal: "154574 18:24:09.6093801 - 3/18/2024 2:24:09 PM" to "2024/3/18 2:24:09" so I can further massage it for date math. Edited April 3 by rsn wrong code 🤦♂️ Nine 1 Link to comment Share on other sites More sharing options...
Nine Posted March 29 Share Posted March 29 (edited) @rsn Here the way to convert those regedit timestamps without using external program (for the fun of it...) #include <Date.au3> ; convert Regedit time to string Local $sTime = String(RegRead("HKEY_CURRENT_USER\SOFTWARE\Microsoft\Windows\CurrentVersion\Notifications\Settings\Microsoft.Explorer.Notification.{EF042132-5191-5B05-CE52-68DCD8D3A677}", "LastNotificationAddedTime")) Local $iTime = Int(StringLeft($sTime, 11)) $sTime = _DateAdd('s', $iTime, "1601/01/01 00:00:00") Local $aTime = StringRegExp($sTime, "(.{4}).(.{2}).(.{2}).(.{2}).(.{2}).(.{2})", 1) Local $tFile = _Date_Time_EncodeFileTime($aTime[1], $aTime[2], $aTime[0], $aTime[3], $aTime[4], $aTime[5]) $tFile = _Date_Time_FileTimeToLocalFileTime($tFile) $sTime = _Date_Time_FileTimeToStr($tFile, 1) ConsoleWrite($sTime & @CRLF) Edited March 29 by Nine “They did not know it was impossible, so they did it” ― Mark Twain Spoiler Block all input without UAC Save/Retrieve Images to/from Text Monitor Management (VCP commands) Tool to search in text (au3) files Date Range Picker Virtual Desktop Manager Sudoku Game 2020 Overlapped Named Pipe IPC HotString 2.0 - Hot keys with string x64 Bitwise Operations Multi-keyboards HotKeySet Recursive Array Display Fast and simple WCD IPC Multiple Folders Selector Printer Manager GIF Animation (cached) Screen Scraping Multi-Threading Made Easy Link to comment Share on other sites More sharing options...
rsn Posted March 29 Share Posted March 29 Every time I see your posted code, I see some kind of magic. What I especially like is that it's in 24 hour whereas mine was in 12. Less massaging 😅 Thank you @Nine. argumentum 1 Link to comment Share on other sites More sharing options...
WildByDesign Posted October 5 Share Posted October 5 (edited) Deleted comment: Not necessary anymore. Sorry. Edited October 17 by WildByDesign not needed Link to comment Share on other sites More sharing options...
WildByDesign Posted October 5 Share Posted October 5 (edited) Deleted comment: Not necessary anymore. Sorry. Edited October 17 by WildByDesign not necessary Link to comment Share on other sites More sharing options...
WildByDesign Posted October 5 Share Posted October 5 (edited) Deleted comment: Not necessary anymore. Sorry. Edited October 17 by WildByDesign 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