Marking frames is a convenient way to temporarily flag a location in the trace you wish to keep track of during a troubleshooting session. But there is no built in way to mark frames in Network Monitor 3.4. However, using frame comments, coloring rules, and AutoHotkey, you can implement frame marking functionality.
Color rules can be created using any general filter. This includes filtering the frame comment title which is exposed using the property FrameVariable.CommentTitle. By appending some text to the comment title, for example “m:red”, we can create color rules that display a color based on that text. What makes this seamless is AutoHotkey’s ability to read and control and UI by running scripts based on the keystrokes we define.
Following these three simple steps will allow you to mark frames with Network Monitor 3.4.
As you can see, there are 6 color rules defined to identify various strings; m:cyan, m:orange, m:purple, m:green, m:yellow, m:blue and m:red. When the appropriate key strokes are hit, the comment title is modified to add the related text. This triggers the associated coloring rule based on the first match in the list above.
Now with the previous steps completed, you will be able to select one frame and mark it. For instance, to mark a frame with the first defined color, just press Shift+F1. This should make the frame show up with a red background. Pressing Shift+F2 will override the color and change it to blue. The associated comment will now end with m:blue. You can also remove any comment color tags by using Shift+F12 or the original keystroke that marked the frame.
I’ve also enabled a multi-level color marking scheme. By using Ctrl+F1, you still get a Red colored frame. But when you press Ctrl+F2, it appends m:blue and since that has a higher priority in the color list the frame is displayed with a blue background. Then by pressing Ctrl+F12, you can revert to the previous color. It will remove that last applied color and leave the m:red portion of the text in the comment. At this point the frame will revert to a red background.
If you’ve applied multiple levels of colors using the Ctrl+Function Key, you can use Shift+F12 to remove them all. Also all of these comment additions should not affect any preexisting comments you have created, unless there’s some text resembling the “m:color” type identifiers I used.
Marking frames can provide an easy way to track interesting parts of a trace as you navigating your way through complex network traffic. You can even jump to the next marked frame by looking for “m:” in the Find dialog (Ctrl+F) with the filter CommentTitle.Contains(“m:”). And while it’s not perfect, for instance you can’t select multiple frames and mark them all, it does provide a simple way to mark frames with color using key strokes.
I've updated the script so that the keystrokes don't get stolen if Network Monitor is not in focus. This way if another app uses Ctrl or Shift F1-F6, they will still work with those apps.
Paul
Hi! Great idea, but i cannot make this work :(
Color rules are fine, but there is something wrong with the script, which seems to be doing noting (not adding comments) even if autohotkey logs the keys being pressed..what might be happening?
I can't say for sure what is going on. But perhaps we can determine how far in the script we are getting by using the 'MsgBox "here"' command to determine how far you are getting in the script. My guess is that for some reason Netmon is not getting activated or not getting the keystrokes. Perhaps some other tool or program is getting in the way.
In the netmon.ahk file, look for MarkColorOverwrite subroutine. Then try to add the MsgBox for the first few lines and let me know how far it gets. Perhaps that will give us a clue as to what is failing.
Don't really know why, but it works only by removing the
#IfWinActive, ahk_class Netmon
command. This means i'm losing the keys being linked to other apps, is that right? (actually i don't bother too much)