Jump to content

Sky Slate Blueberry Blackcurrant Watermelon Strawberry Orange Banana Apple Emerald Chocolate

Process Monitor Controller/Indicator

  • Please log in to reply
No replies to this topic
  • Administrators
  • 3864 posts
  • Last active:
  • Joined: 21 Aug 2006
Just a small script that allows you to toggle/clear capture
and embeds a small display status into Sysinternals Process Monitor
Posted Image
; Tested on Win7Ult64/32 XPSP3
; Confirmed to work on Process Monitor 2.94
; http://technet.microsoft.com/en-us/sysinternals/bb896645

#singleInstance, ignore

if !winExist( tWin:="ahk_class PROCMON_WINDOW_CLASS" ) {
  msgbox, 0x10, Fatal Error!, Please make sure Process Monitor is running!`nThis script will now exit.

setTimer, prcMn, 10

cnt:=!cnt, rCnt:=!!rCnt
controlGet, tbHwnd, hwnd,, toolbarWindow321, % tWin

gui +toolWindow -caption
gui, font, s7 c333366, arial
gui, add, text, y0 vsT, % "F1: Toggle Capture [ .... ]"
	. sTxt:= a_tab "F2: Clear Capture" a_tab
	. "code by:TLM"
gui, show, y-200 h13, stWin

winWait, stWin
winGet, chHwnd, id, stWin
dllCall("SetParent", "UInt", chHwnd, "UInt", tbHwnd )
winMove, 500, 0

setTimer, stBr, 1000

f1::postMsg( 0x9C52, tWin ) ; toggle
f2::postMsg( 0x9C54, tWin ) ; clear

  statusBarGetText, sbTxt%cnt%, 1, % tWin
  guiControl,, sT, % "F1: Toggle Capture [ "
	. (( sbTxt%cnt%, cnt++ ) = ( sbTxt%rCnt%, rCnt++ )
	|| ( inStr(sbTxt%cnt%, nE:="No") || inStr(sbTxt%rCnt%, nE ))
	? ( "off", gClr:=0xff3000 ) : ( "on", gClr:=0x00ff00 )) " ] " sTxt
  gui color, % gClr

  if !winExist( tWin:="ahk_class PROCMON_WINDOW_CLASS" )

postMsg( wP, tWn ) {
  postMessage, 0x111, wP,,, % tWn
It has 2 minor advantages to PM's built in hotkeys:- The ability to toggle/clear capture without PM being active.
- Uses single hotkeys without the need for modifiers keys.Notes:- Exiting or closing PM will also exit the control script.
- The indicator sometimes switches during capture because of the way PM buffers events.
- The GUI tends to flicker at times.Feel free to mod the code and post any questions or issues you may have.

Posted Image

don't duplicate, iterate!