life ideas

October 23, 2006

trayicon interactive of AutoHotKey

Filed under: Uncategorized — manoftoday @ 10:31 pm

1) search through icon

 

Sleep, 100
hw_notification := FindWindow( “Shell_TrayWnd|TrayNotifyWnd|SysPager|ToolbarWindow32,Notification Area” )
WinGetPos, s_x, s_y, s_w, s_h, ahk_id %hw_notification%
CoordMode, Pixel, Screen
ImageSearch, t_x, t_y, s_x, s_y, s_x+s_w-1, s_y+s_h-1, *Icon1 %A_ProgramFiles%\autohotkey\autohotkey.exe
if ( ErrorLevel = 0 )
{
   CoordMode, Mouse, Screen
   MouseClick, Right, t_x, t_y, 1
}
return
FindWindow( p_tree )
{
   level_total = 0
   loop, parse, p_tree, |
   {
      level_total++
      ix := InStr( a_LoopField, “,” )
      if ( ix )
      {
         StringMid, tree[%level_total%]?class, a_LoopField, 1, ix-1
         StringMid, tree[%level_total%]?title, a_LoopField, ix+1, StrLen( a_LoopField )-ix
      }
      else
      {
         tree[%level_total%]?class := a_LoopField
         tree[%level_total%]?title = 0
      }
   }
   hw_parent = 0
   hw_child = 0
   level = 1
   loop,
   {
      hw_child := FindWindowEx( hw_parent, hw_child, tree[%level%]?class, tree[%level%]?title )
      if ( hw_child )
      {
         if ( level = level_total )
            return, hw_child
         level++
         hw_parent_old := hw_parent
         hw_parent := hw_child
         hw_child_old := hw_child   
         hw_child = 0
      }
      else
      {
         if ( level = 1 )
            return, 0
         level–
         hw_parent := hw_parent_old
         hw_child := hw_child_old
      }
   }
}
FindWindowEx( p_hw_parent, p_hw_child, p_class, p_title=0 )
{
   if ( p_title = 0 )
      type_title = uint
   else
      type_title = str
   return, DllCall( “FindWindowEx”
                  , “uint”, p_hw_parent
                  , “uint”, p_hw_child
                  , “str”, p_class
                  , type_title, p_title )
}

 

 

2)  walk through ICONS in tray

 

WM_USER = 0x400
hw_notification_area := FindWindow( “Shell_TrayWnd|TrayNotifyWnd|SysPager|ToolbarWindow32,Notification Area” )
MsgBox, hw_notification_area = %hw_notification_area%
VarSetCapacity( pid_explorer, 4 )
WinGet, pid_explorer, PID, ahk_id %hw_notification_area%
MsgBox, pid_explorer: %pid_explorer%
hp_explorer := DllCall( “OpenProcess”, “uint”, 0x8|0x10, “int”, true, “uint”, pid_explorer )
MsgBox, openprocess: %ErrorLevel% – %hp_explorer%
remote_buffer := DllCall( “VirtualAllocEx”
                     , “uint”, hp_explorer
                     , “uint”, 0
                     , “uint”, 0x1000
                     , “uint”, 0x1000
                     , “uint”, 0x4 )
MsgBox, virtualallocex: %ErrorLevel% – %remote_buffer%
TB_BUTTONCOUNT := WM_USER+24
SendMessage, TB_BUTTONCOUNT, 0, 0,, ahk_id %hw_notification_area%
MsgBox, button count = %ErrorLevel%
TB_GETBUTTON := WM_USER+23
SendMessage, TB_GETBUTTON, 0, remote_buffer,, ahk_id %hw_notification_area%
MsgBox, TB_GETBUTTON: %ErrorLevel%
remote_buffer2 := remote_buffer+200
TB_GETITEMRECT := WM_USER+29
SendMessage, TB_GETITEMRECT, index, remote_buffer2,, ahk_id %hw_notification_area%
MsgBox, TB_GETITEMRECT: %ErrorLevel%
VarSetCapacity( buffer, 1000, 0 )
VarSetCapacity( buffer_actual_size, 4, 0 )
pBuffer2 := &buffer+200
result := DllCall( “ReadProcessMemory”
                  , “uint”, hp_explorer
                  , “uint”, remote_buffer
                  , “uint”, &buffer
                  , “uint”, 1000
                  , “uint”, &buffer_actual_size )
buffer_actual_size := ReadInteger( “uint”, &buffer_actual_size, 0 )
MsgBox, readprocessmemory: %ErrorLevel% – %result% ~ %buffer_actual_size%
; — data —
VarSetCapacity( buffer2, 1000, 0 )
VarSetCapacity( buffer_actual_size, 4, 0 )
result := DllCall( “ReadProcessMemory”
                  , “uint”, hp_explorer
                  , “uint”, ReadInteger( “int”, &buffer, 12 )
                  , “uint”, &buffer2
                  , “uint”, 1000
                  , “uint”, &buffer_actual_size )
buffer_actual_size := ReadInteger( “uint”, &buffer_actual_size, 0 )
MsgBox, readprocessmemory: %ErrorLevel% – %result% ~ %buffer_actual_size%
; — string —
VarSetCapacity( buffer3, 1000, 0 )
VarSetCapacity( buffer_actual_size, 4, 0 )
result := DllCall( “ReadProcessMemory”
                  , “uint”, hp_explorer
                  , “uint”, ReadInteger( “int”, &buffer, 16 )
                  , “uint”, &buffer3
                  , “uint”, 1000
                  , “uint”, &buffer_actual_size )
buffer_actual_size := ReadInteger( “uint”, &buffer_actual_size, 0 )
MsgBox, readprocessmemory: %ErrorLevel% – %result% ~ %buffer_actual_size%
MsgBox, %
   ( Join
      “– [” A_Index-1 “] button information –”
      “`n`ncommand = ” ReadInteger( “int”, &buffer, 4 )
      “`nstate = ” ReadInteger( “uchar”, &buffer, 8 )
      “`ndata = ” ReadInteger( “uint”, &buffer, 12 )
      “`nstring = ” ReadInteger( “int”, &buffer, 16 )
      “`n`nrect = ” ReadInteger( “int”, pBuffer2, 0, false )
         “, ” ReadInteger( “int”, pBuffer2, 4, false )
         “, ” ReadInteger( “int”, pBuffer2, 8, false )
         “, ” ReadInteger( “int”, pBuffer2, 12, false )
      “`n`ndata = ” ReadInteger( “uint”, &buffer2, 0 )
      “`nstring = ” ReadStringA( &buffer3, 0, 1000 )
   )
ExitApp
TwosComplement( p_value, p_size )
{
   return, ( p_value^( 2**( p_size*8 )-1 ) )+1
}
ReadInteger( p_type, p_address, p_offset, p_hex=true )
{
   old_FormatInteger := a_FormatInteger
   if ( p_hex )
      SetFormat, integer, hex
   else
      SetFormat, integer, dec
   if ( p_type = “int” )
   {
      sign := true
      size = 4
   }
   else if ( p_type = “uint” )
   {
      sign := false
      size = 4
   }
   else if ( p_type = “short” )
   {
      sign := true
      size = 2
   }
   else if ( p_type = “ushort” )
   {
      sign := false
      size = 2
   }
   else if ( p_type = “char” )
   {
      sign := true
      size = 1
   }
   else if ( p_type = “uchar” )
   {
      sign := false
      size = 1
   }
   else
      MsgBox, [ReadInteger] error: the type %p_type% is undefined!
   value = 0
   loop, %size%
      value := value+( *( ( p_address+p_offset )+( a_Index-1 ) ) << ( 8*( a_Index-1 ) ) )
   if ( sign )
   {
      sign := ( *( p_address+p_offset+( size-1 ) ) ) >> 7
      if ( sign )
         value := -1*TwosComplement( value, size )
   }
   SetFormat, integer, %old_FormatInteger%
   return, value
}
ReadStringA( p_address, p_offset, p_size )
{
   text=
   address := p_address+p_offset-2
   loop, %p_size%
   {
      address += 2
      if ( *( address ) = 0 )
         break
      text := text Chr( *( address ) )
   }
   return, text
}
FindWindow( p_tree )
{
   level_total = 0
   loop, parse, p_tree, |
   {
      level_total++
      ix := InStr( a_LoopField, “,” )
      if ( ix )
      {
         StringMid, tree[%level_total%]?class, a_LoopField, 1, ix-1
         StringMid, tree[%level_total%]?title, a_LoopField, ix+1, StrLen( a_LoopField )-ix
      }
      else
      {
         tree[%level_total%]?class := a_LoopField
         tree[%level_total%]?title = 0
      }
   }
   hw_parent = 0
   hw_child = 0
   level = 1
   loop,
   {
      hw_child := FindWindowEx( hw_parent, hw_child, tree[%level%]?class, tree[%level%]?title )
      if ( hw_child )
      {
         if ( level = level_total )
            return, hw_child
         level++
         hw_parent_old := hw_parent
         hw_parent := hw_child
         hw_child_old := hw_child   
         hw_child = 0
      }
      else
      {
         if ( level = 1 )
            return, 0
         level–
         hw_parent := hw_parent_old
         hw_child := hw_child_old
      }
   }
}
FindWindowEx( p_hw_parent, p_hw_child, p_class, p_title=0 )
{
   if ( p_title = 0 )
      type_title = uint
   else
      type_title = str
   return, DllCall( “FindWindowEx”
                  , “uint”, p_hw_parent
                  , “uint”, p_hw_child
                  , “str”, p_class
                  , type_title, p_title )
}

 

; output is kind like

;– [-1] button information —
;command = 0xc
;state = 0x4
;data = 0x16ec80
;string = 0x120528
;rect = 0, 0, 18, 18
;data = 0x4053c
;string = ActivateTrayIcon2.ahk

3) communicate with a trayICON from pid

;Assign the PID of interest to “pid_target” and run the script.

 

#NoTrayIcon
DetectHiddenWindows, On
OnExit, HandleExit
pid_target = 2532
hw_notification_area := FindWindow( “Shell_TrayWnd|TrayNotifyWnd|SysPager|ToolbarWindow32,Notification Area” )
if ( ErrorLevel or ! hw_notification_area )
{
   MsgBox, [error] FindWindow failed: ToolbarWindow32,Notification Area
   ExitApp
}
WinGet, pid_explorer, PID, ahk_id %hw_notification_area%
if ( ErrorLevel or ! pid_explorer )
{
   MsgBox, [error] WinGet~PID failed: explorer
   ExitApp
}
hp_explorer := DllCall( “OpenProcess”
                     , “uint”, 0x18                              ; PROCESS_VM_OPERATION|PROCESS_VM_READ
                     , “int”, false
                     , “uint”, pid_explorer )
if ( ErrorLevel or ! hp_explorer )
{
   MsgBox, [error] OpenProcess failed: explorer
   ExitApp
}
remote_buffer_size = 0x1000
remote_buffer := DllCall( “VirtualAllocEx”
                     , “uint”, hp_explorer
                     , “uint”, 0
                     , “uint”, remote_buffer_size
                     , “uint”, 0x1000                           ; MEM_COMMIT
                     , “uint”, 0x4 )                              ; PAGE_READWRITE
if ( ErrorLevel or ! remote_buffer )
{
   MsgBox, [error] VirtualAllocEx failed: explorer ~ remote_buffer
   ExitApp
}
; TB_BUTTONCOUNT
SendMessage, 0x418, 0, 0,, ahk_id %hw_notification_area%
button_count := ErrorLevel
buffer_size = 40
VarSetCapacity( buffer, buffer_size )
loop, %button_count%
{
   ; TB_GETBUTTON
   SendMessage, 0x417, A_Index-1, remote_buffer,, ahk_id %hw_notification_area%
   if ( ! ErrorLevel )
   {
      MsgBox, [error] SendMessage~TB_GETBUTTON failed: hw_notification_area
      ExitApp
   }
   result := DllCall( “ReadProcessMemory”
                  , “uint”, hp_explorer
                  , “uint”, remote_buffer
                  , “uint”, &buffer
                  , “uint”, buffer_size
                  , “uint”, 0 )
   if ( ErrorLevel or ! result )
   {
      MsgBox, [error] ReadProcessMemory failed: explorer ~ remote_buffer (TB_GETBUTTON)
      ExitApp
   }
   data_address := *( &buffer+12 )+( ( *( &buffer+13 ) ) << 8 )+( ( *( &buffer+14 ) ) << 16 )+( ( *( &buffer+15 ) ) << 24 )
   result := DllCall( “ReadProcessMemory”
                     , “uint”, hp_explorer
                     , “uint”, data_address
                     , “uint”, &buffer
                     , “uint”, buffer_size
                     , “uint”, 0 )
   if ( ErrorLevel or ! result )
   {
      MsgBox, [error] ReadProcessMemory failed: explorer ~ data_address
      ExitApp
   }
   wid := *( &buffer )+( ( *( &buffer+1 ) ) << 8 )+( ( *( &buffer+2 ) ) << 16 )+( ( *( &buffer+3 ) ) << 24 )
   WinGet, pid, PID, ahk_id %wid%
   if ( pid = pid_target )
   {
      ; TB_GETITEMRECT
      SendMessage, 0x41D, A_Index-1, remote_buffer,, ahk_id %hw_notification_area%
      if ( ! ErrorLevel )
      {
         MsgBox, [error] SendMessage~TB_GETITEMRECT failed: hw_notification_area
         ExitApp
      }
      result := DllCall( “ReadProcessMemory”
                        , “uint”, hp_explorer
                        , “uint”, remote_buffer
                        , “uint”, &buffer
                        , “uint”, buffer_size
                        , “uint”, 0 )
      if ( ErrorLevel or ! result )
      {
         MsgBox, [error] ReadProcessMemory failed: explorer ~ remote_buffer (TB_GETITEMRECT)
         ExitApp
      }
      WinGetPos, x, y,,, ahk_id %hw_notification_area%
      x := x+*( &buffer )+( ( *( &buffer+1 ) ) << 8 )+( ( *( &buffer+2 ) ) << 16 )+( ( *( &buffer+3 ) ) << 24 )+8
      y := y+*( &buffer+4 )+( ( *( &buffer+5 ) ) << 8 )+( ( *( &buffer+6 ) ) << 16 )+( ( *( &buffer+7 ) ) << 24 )+8
      CoordMode, Mouse, Screen
      MouseClick, Right, x, y, 1, 0
      break
   }
}
return

HandleExit:
   result := DllCall( “VirtualFreeEx”
                     , “uint”, hp_explorer
                     , “uint”, remote_buffer
                     , “uint”, 0
                     , “uint”, 0x8000 )                           ; MEM_RELEASE
   if ( ErrorLevel or ! result )
      MsgBox, [warning] VirtualFreeEx failed: explorer ~ remote_buffer
   result := DllCall( “CloseHandle”, “uint”, hp_explorer )
   if ( ErrorLevel or ! result )
      MsgBox, [warning] CloseHandle failed: explorer
ExitApp
FindWindow( p_tree )
{
   level_total = 0
   loop, parse, p_tree, |
   {
      level_total++
      ix := InStr( a_LoopField, “,” )
      if ( ix )
      {
         StringMid, tree[%level_total%]?class, a_LoopField, 1, ix-1
         StringMid, tree[%level_total%]?title, a_LoopField, ix+1, StrLen( a_LoopField )-ix
      }
      else
      {
         tree[%level_total%]?class := a_LoopField
         tree[%level_total%]?title = 0
      }
   }
   hw_parent = 0
   hw_child = 0
   level = 1
   loop,
   {
      hw_child := FindWindowEx( hw_parent, hw_child, tree[%level%]?class, tree[%level%]?title )
      if ( hw_child )
      {
         if ( level = level_total )
            return, hw_child
         level++
         hw_parent_old := hw_parent
         hw_parent := hw_child
         hw_child_old := hw_child   
         hw_child = 0
      }
      else
      {
         if ( level = 1 )
            return, 0
         level–
         hw_parent := hw_parent_old
         hw_child := hw_child_old
      }
   }
}
FindWindowEx( p_hw_parent, p_hw_child, p_class, p_title=0 )
{
   if ( p_title = 0 )
      type_title = uint
   else
      type_title = str
   return, DllCall( “FindWindowEx”
                  , “uint”, p_hw_parent
                  , “uint”, p_hw_child
                  , “str”, p_class
                  , type_title, p_title )
}

 

4)  mouseover a trayicon

 

#persistent
Menu, Tray, Icon, pifmgr.dll, 2 ; set the icon for this script
; the icon to look for (in this case the one of this script)
iconstr = 2 pifmgr.dll ; the number of the icon [space] filename containing the icon
; get the icon sizes (system small) in order to determine the size of the area for the mouseover event
sysget, sm_cxsmicon, 49
sysget, sm_cysmicon, 50
; MsgBox, %sm_cxsmicon% %sm_cysmicon%
SetTimer, mouseovericon, 500 ; check every half second if the mouse is over the icon
mouseovericon:
   mouseovericon := iconfind(iconstr,sm_cxsmicon,sm_cysmicon)
   if mouseovericon = 0
      MsgBox Now! ; display now! when the mouse is over the icon
return
iconfind(iconstr,sm_cxsmicon,sm_cysmicon)
; checks to see if the mouse is over the given tray icon
; returns:
; 0 if mouse is over the icon,
; 1 if image not found
; 2 if imagesearch produced an error or
; 3 if icon was found but mouse was not over the image
{
   coordmode, pixel, screen ; set the coords for imagesearch to absolute
   coordmode, mouse, screen ; set mouse coords to absolute
   ; retrieve the tray position and size in order to limit (speedup) the imagesearch
   WinGetPos, trayX, trayY, trayWidth, trayHeight, ahk_class Shell_TrayWnd
   MouseGetPos, mouseX, mouseY ; get the mouse position
   ; see if the icon exists in the traywindow
   ImageSearch, imageX, imageY, trayX, trayY, trayX+trayWidth, trayY+trayHeight, *Icon%iconstr%
   coordmode, pixel, relative ; reset the coords for imagesearch to default
   coordmode, mouse, relative ; reset mouse coords to default
   if ErrorLevel > 0 ; image not found or an image search error occurred
      return %errorlevel%
   imageXlarge := imageX+sm_cxsmicon ; the outerlimit for X
   imageYlarge := ImageY+sm_cysmicon ; the outerlimit for Y
   if mouseX between %imageX% and %imageXlarge%
      if mouseY between %imageY% and %imageYlarge%
         return 0 ; if the mouse is over the designated icon
   return 3 ; 3 means mouse not over the icon
}

 

5) activate an application and simulate close action

 

SetKeyDelay,10
WinShow,ahk_class ZAFrameWnd
WinActivate,ahk_class ZAFrameWnd
WinWaitActive,ahk_class ZAFrameWnd,,0
if errorlevel != 1
 {
  Send, !{Space}
  Send SS
  Send {Enter 2}
 }

Advertisements

basic tutaorial on AutoHotKey

Filed under: Uncategorized — manoftoday @ 8:12 pm

0) hotkeys

 

!: Sends an ALT keystroke. For example, Send This is text!a would send the keys “This is text” and then press ALT+a. Note: !A produces a different effect in some programs than !a. This is because !A presses ALT+SHIFT+A and !a presses ALT+a. If in doubt, use lowercase.

+: Sends a SHIFT keystroke. For example, Send +abC would send the text “AbC”, and Send !+a would press ALT+SHIFT+a.

^: Sends a CONTROL keystroke. For example, Send ^!a would press CTRL+ALT+a, and Send ^{Home} would send CONTROL+HOME. Note: ^A produces a different effect in some programs than ^a. This is because ^A presses CONTROL+SHIFT+A and ^a presses CONTROL+a. If in doubt, use lowercase.

#: Sends a WIN keystroke, therefore Send #e would hold down the Windows key and then press the letter “e”.

1) use IfWinActive and if  else

;use the F1 & F2 keys to switch tabs

F1::
IfWinActive, ahk_class TFormEditPadLite
{
  PostMessage, 0x111, 83,,, ahk_class TFormEditPadLite ; prev tab
  return
}
else
Send, {F1}
return

 

$F2::
IfWinActive, ahk_class TFormEditPadLite
{
  PostMessage, 0x111, 82,,, ahk_class TFormEditPadLite ; next tab
  return
}
else
Send, {F2}
return

2) loop

 

Loop %RunCount%
{
	Run C:\Check Server Status.exe
	Sleep 60000  ; Wait 60 seconds.
}

In the above, the loop is performed the specified number of times unless RunCount contains 0, in which case the loop is skipped entirely.

A loop may also terminate itself when one or more conditions change. The following example clicks the left mouse button repeatedly while the user is holding down the F1 key:

$F1::  ; Make the F1 key into a hotkey (the $ symbol facilitates the "P" mode of GetKeyState below).
Loop  ; Since no number is specified with it, this is an infinite loop unless "break" or "return" is encountered inside.
{
	if not GetKeyState("F1", "P")  ; If this statement is true, the user has physically released the F1 key.
		break  ; Break out of the loop.
	; Otherwise (since the above didn't "break"), keep clicking the mouse.
	Click  ; Click the left mouse button at the cursor's current position.
}
return

3) variable

 

MyVar1 = 123
MyVar2 = my string

To compare the contents of a variable to a number or string, follow these examples:

if MyVar2 = my string
{
	MsgBox MyVar2 contains the string "my string".
}
if MyVar1 >= 100
{
	MsgBox MyVar1 contains %MyVar1%, which is a number greater than or equal to 100.
}
 
if ErrorLevel <> FAIL
{
}
if (ItemCount > ItemLimit)
{
	MsgBox The value in ItemCount, which is %ItemCount%, is greater than %ItemLimit%.
}

Notice that the first line of the example above contains parentheses. The parentheses signify that the if-statement contains an expression.

NetPrice := Price * (1 - Discount/100)

4) logic

if (ColorName <> “” AND not FindColor(ColorName))
  MsgBox %ColorName% could not be found.

5) share functions

 

Using #Include to Share Functions Among Multiple Scripts

The #Include directive may be used (even at the top of a script) to load functions from an external file.

Explanation: When the script’s flow of execution encounters a function definition, it jumps over it (using an instantaneous method) and resumes execution at the line after its closing brace. Consequently, execution can never fall into a function from above, nor does the presence of one or more functions at the very top of a script affect the auto-execute section.

6) use pid 

*) from process name to pid

Process, Exist, asshole.exe
AssholePID=%Errorlevel%
if AssholePID

{
   msgbox, Gotcha Asshole! (%AssholePID%)

   ; To use a pid…

   ; IfWinActive, ahk_pid %AssholePID%

   ; or WinGet, AssholeHWND, id, ahk_pid %AssholePID%   ; use pid to get window id . a.k.a hwnd 

 

   ;  note, window id is a different cencept

   ;WinGet, notepad1, ID, Untitled – Notepad  ;the notepad1 is windows id, we can then use it to minimize or close

   ; WinMinimize, ahk_id %notepad1%  
}

else
   msgbox, F**k!@#!@#!@

 

*) from window id  to pid

WinGet, pid_explorer, PID, ahk_id %hw_notification_area%

 

     *) enumerate processes

 

Gui, Add, ListView, x5 y5 w400 h200, PID|file name
Gui, Show, x50 y50, EnumProcesses experiment
total := EnumProcesses( pid_list )
loop, parse, pid_list, |
   LV_Add( “”, A_LoopField, GetModuleFileNameEx( A_LoopField ) )
LV_ModifyCol( 1, “Integer Sort AutoHdr” )
LV_ModifyCol( 2, “AutoHdr” )
return

GuiClose:
ExitApp

EnumProcesses( byref r_pid_list )
{
   if A_OSVersion in WIN_95,WIN_98,WIN_ME
   {
      MsgBox, This Windows version (%A_OSVersion%) is not supported.
      return, false
   }
   pid_list_size := 4*1000
   VarSetCapacity( pid_list, pid_list_size )
   status := DllCall( “psapi.dll\EnumProcesses”, “uint”, &pid_list, “uint”, pid_list_size, “uint*”, pid_list_actual )
   if ( ErrorLevel or !status )
      return, false
   total := pid_list_actual//4
   r_pid_list=
   address := &pid_list
   loop, %total%
   {
      r_pid_list := r_pid_list “|” ( *( address )+( *( address+1 ) << 8 )+( *( address+2 ) << 16 )+( *( address+3 ) << 24 ) )
      address += 4
   }
   StringTrimLeft, r_pid_list, r_pid_list, 1
   return, total
}

GetModuleFileNameEx( p_pid )
{
   if A_OSVersion in WIN_95,WIN_98,WIN_ME
   {
      MsgBox, This Windows version (%A_OSVersion%) is not supported.
      return
   }
   h_process := DllCall( “OpenProcess”, “uint”, 0x10|0x400, “int”, false, “uint”, p_pid )
   if ( ErrorLevel or h_process = 0 )
      return
   name_size = 255
   VarSetCapacity( name, name_size )
   result := DllCall( “psapi.dll\GetModuleFileNameExA”, “uint”, h_process, “uint”, 0, “str”, name, “uint”, name_size )
   DllCall( “CloseHandle”, h_process )
   return, name
}

or through pslist

; Get list of running processes with PSList http://www.sysinternals.com/Utilities/PsList.html

 

RunWait %comspec% /c pslist -t >list.txt, , Hide
Loop, Read, list.txt
{
  if A_LoopReadLine not contains Russinovich,Sysinternals,Process,Name,Idle
  Loop, parse, A_LoopReadLine, %A_Space%
   {
     if A_LoopField !=
        count++
         if count = 2 ; pid column
         {
           name := getmodulefilenameex(A_LoopField) ; MsgBox, %A_LoopField%
            ; use splitpath to obtain drive letter of each app:     
            SplitPath, name, , , , , Drive
            if Drive = %mydrive%
               WinClose, ahk_pid %pid%
            count=
            break
         }   
   }
}
return

combined effect

 

; code by Serenity, shimanov
; pieced together and modified by corrupt
if A_OSVersion in WIN_95,WIN_98,WIN_ME
{
  MsgBox, 16, Error, This Windows version (%A_OSVersion%) is not supported.
  ExitApp
}
Gui, Add, Button, x22 y80 w75 h23 gCloseApps, OK
Gui, Add, Button, x103 y80 w75 h23 gGuiClose, Cancel
Gui, Add, Text, x14 y10 w180 h15 , Please choose your device from the list:
Gui, Add, DropDownList, x16 y40 w170 h120 Choose1 vList1, 
SplashTextOn, 200, 60,, Please wait.`n Generating a list of drives on your system…
driveget, list, list  ; all drives
stringlen, len, list
loop, %len%
{
  stringleft, drive, list, 1
  If drive <> A
    driveget, label, label, %drive%:
  GuiControl,,List1, %drive%:     %label%
  stringtrimleft, list, list, 1
}
GuiControl,Choose, List1, 1
Gui, Show, h116 w200, Close Programs
SplashTextOff
Return
CloseApps:
GuiControlGet, List1
Gui, Hide
DetectHiddenWindows, On
stringleft, mydrive, List1, 2
total := EnumProcesses( pid_list )
; get PID for this script to avoid self destruction
Process, Exist
this_pid = %ErrorLevel%
loop, parse, pid_list, |
{
  lname := GetModuleFileNameEx( A_LoopField )
  If lname<>
  {                 
    ; use splitpath to obtain drive letter of each app:     
    SplitPath, lname, , , , , Drive
    ; close the program if drive matches:
    if ( Drive = mydrive AND A_LoopField <> this_pid )
    {
      WinKill, ahk_pid %A_LoopField%
      Process, Exist, %A_LoopField%
      If (ErrorLevel)
      {
        Process, Close, %A_LoopField%
        If ErrorLevel = 0
        {
          RetError := KillProcess( A_LoopField )
          If RetError = 0
            MsgBox, %lname% is not responding. `nPlease manually close this application
        }
      }
    }
  }
}
MsgBox, 64, Done, Finished processing drive %mydrive%
GuiClose:
ExitApp
EnumProcesses( byref r_pid_list )
{
   pid_list_size := 4*1000
   VarSetCapacity( pid_list, pid_list_size )
   status := DllCall( “psapi.dll\EnumProcesses”, “uint”, &pid_list, “uint”, pid_list_size, “uint*”, pid_list_actual )
   if ( ErrorLevel or !status )
      return, false
   total := pid_list_actual//4
   r_pid_list=
   address := &pid_list
   loop, %total%
   {
      r_pid_list := r_pid_list “|” ( *( address )+( *( address+1 ) << 8 )+( *( address+2 ) << 16 )+( *( address+3 ) << 24 ) )
      address += 4
   }
   StringTrimLeft, r_pid_list, r_pid_list, 1
   return, total
}
GetModuleFileNameEx( p_pid )
{
   h_process := DllCall( “OpenProcess”, “uint”, 0x10|0x400, “int”, false, “uint”, p_pid )
   if ( ErrorLevel or h_process = 0 )
      return
   name_size = 255
   VarSetCapacity( name, name_size )
   result := DllCall( “psapi.dll\GetModuleFileNameExA”, “uint”, h_process, “uint”, 0, “str”, name, “uint”, name_size )
   DllCall( “CloseHandle”, h_process )
   return, name
}
KillProcess( p_pid )
{
   h_process := DllCall( “OpenProcess”, “uint”, 0xF0000|0x100000|0xFFF, “int”, false, “uint”, p_pid )
   if ( ErrorLevel or h_process = 0 )
      return
   result := DllCall( “TerminateProcess”, “uint”, h_process, “uint”, 0)
   DllCall( “CloseHandle”, h_process )
   return, result
}

  • use output from a command

Testing shows that due to file caching, a temporary file can be very fast for relatively small outputs. In fact, if the file is deleted immediately after use, it often does not actually get written to disk. For example:

RunWait %comspec% /c dir > C:\My Temp File.txt
FileRead, VarToContainContents, C:\My Temp File.txt
FileDelete, C:\My Temp File.txt

     *) get pid from Run

Run, notepad,,, PID

*) getpid from active window or title

WinGet, active_pid, PID, A
WinGet, active_pid, PID, Untitled-Notepad 
;get pid of  AutoHotKey script

DetectHiddenWindows on
WinGet, scriptPID, PID, %A_ScriptFullPath% – AutoHotkey v
MsgBox, PID=%scriptPID%

*)Get windows id from mouse position

 

CoordMode, Mouse, Relative
SysGet, TitleBarHeight, 4 ; 4 is SM_CYCAPTION

MButton::
MouseGetPos,, ClickY, WindowIDClicked
If, ClickY <= %TitleBarHeight%
  {
  WinGet, WindowPIDClicked, PID, ahk_id %WindowIDClicked%
  WinClose, ahk_pid %WindowPIDClicked%
  }
Return
Return

 

 

7) loop through windows

 

WinGet, id, list
Loop, %id%
{
   loop_id:=id%a_index%
   WinGetClass, loop_class, ahk_id %loop_id%
   ;IfNotInString, loop_class, Afx:400000:8:10011:0:   ; for you (uncomment)
   IfNotInString, loop_class, Note                  ; I tested on notepad
      continue
   Else
   {
      assid:=loop_id
      assclass:=loop_class
      WinGet, asspid, pid, ahk_id %assid%
      WinGetTitle, asstitle, ahk_id %assid%
      msgbox, 64, ,
      (LTrim
      Gotcha Asshole!
      PID: %asspid%
      ID: %assid%
      Title: %asstitle%
      Class: %assclass%
      )
      exit
   }
}
msgbox, 16, , Couldn’t find asshole!

8) refresh desktop icons

 

WinGet, hw_program_manager, ID, Program Manager ahk_class Progman
;MsgBox, % hw_program_manager
hw_SHELLDLL_DefView := FindWindowEx( hw_program_manager, 0, “SHELLDLL_DefView”, 0 )
;MsgBox, % hw_SHELLDLL_DefView
hw_FolderView := FindWindowEx( hw_SHELLDLL_DefView, 0, “SysListView32”, “FolderView” )
;MsgBox, % hw_FolderView
MsgBox, Now you see them …
WinHide, ahk_id %hw_FolderView%
MsgBox, .. now you dont!
WinShow, ahk_id %hw_FolderView%
return
FindWindowEx( p_hw_parent, p_hw_child, p_class, p_title )
{
   if ( p_title = 0 )
      type_title = uint
   else
      type_title = str
   return, DllCall( “FindWindowEx”
                  , “uint”, p_hw_parent
                  , “uint”, p_hw_child
                  , “str”, p_class
                  , type_title, p_title )
}

 

9) customized menu

 

#SingleInstance ignore
#Persistent
SetKeyDelay, -1
MsgBox, 4096, AbrExpansion, AbrExpansion is now loaded. You can exit this program by pressing Shift+E or by right clicking`non it’s system tray icon. Press “Ok” to exit this dialogue, and enable Abbreviation Expansion.
Menu, tray, NoStandard
menu, tray, add
menu, tray, add, Exit
menu, tray, add
Return
Exit:
Send, {Shift Down}e{Shift Up}
Return
+e::
Msgbox, 4096, AbrExpansion, Thank you for using AbrExpansion.`nThe program will now exit., 6
ExitApp
Return

windows msg code ref for AutoHotKey

Filed under: Uncategorized — manoftoday @ 6:57 pm

0x0000					WM_NULL		
0x0001					WM_CREATE		
0x0002					WM_DESTROY		
0x0003					WM_MOVE		
0x0005					WM_SIZE		
0x0006					WM_ACTIVATE		
0x0007					WM_SETFOCUS		
0x0008					WM_KILLFOCUS		
0x000A					WM_ENABLE		
0x000B					WM_SETREDRAW		
0x000C					WM_SETTEXT		
0x000D					WM_GETTEXT		
0x000E					WM_GETTEXTLENGTH		
0x000F					WM_PAINT		
0x0010					WM_CLOSE		
0x0011					WM_QUERYENDSESSION		
0x0012					WM_QUIT		
0x0013					WM_QUERYOPEN		
0x0014					WM_ERASEBKGND		
0x0015					WM_SYSCOLORCHANGE		
0x0016					WM_ENDSESSION		
0x0017					WM_SYSTEMERROR		
0x0018					WM_SHOWWINDOW		
0x0019					WM_CTLCOLOR		
0x001A					WM_WININICHANGE		
0x001A					WM_SETTINGCHANGE		
0x001B					WM_DEVMODECHANGE		
0x001C					WM_ACTIVATEAPP		
0x001D					WM_FONTCHANGE		
0x001E					WM_TIMECHANGE		
0x001F					WM_CANCELMODE		
0x0020					WM_SETCURSOR		
0x0021					WM_MOUSEACTIVATE		
0x0022					WM_CHILDACTIVATE		
0x0023					WM_QUEUESYNC		
0x0024					WM_GETMINMAXINFO		
0x0026					WM_PAINTICON		
0x0027					WM_ICONERASEBKGND		
0x0028					WM_NEXTDLGCTL		
0x002A					WM_SPOOLERSTATUS		
0x002B					WM_DRAWITEM		
0x002C					WM_MEASUREITEM		
0x002D					WM_DELETEITEM		
0x002E					WM_VKEYTOITEM		
0x002F					WM_CHARTOITEM		
0x0030					WM_SETFONT		
0x0031					WM_GETFONT		
0x0032					WM_SETHOTKEY		
0x0033					WM_GETHOTKEY		
0x0037					WM_QUERYDRAGICON		
0x0039					WM_COMPAREITEM		
0x0041					WM_COMPACTING		
0x0041					WM_COMPACTING		
0x0044{obsoleteinWin32}			WM_COMMNOTIFY		
0x0044{obsoleteinWin32}			WM_COMMNOTIFY		
0x0046					WM_WINDOWPOSCHANGING		
0x0047					WM_WINDOWPOSCHANGED		
0x0048					WM_POWER		
0x0048					WM_POWER		
0x004A					WM_COPYDATA		
0x004B					WM_CANCELJOURNAL		
0x004E					WM_NOTIFY		
0x0050					WM_INPUTLANGCHANGEREQUEST	
0x0051					WM_INPUTLANGCHANGE		
0x0052					WM_TCARD		
0x0053					WM_HELP		
0x0054					WM_USERCHANGED		
0x0055					WM_NOTIFYFORMAT		
0x0055					WM_NOTIFYFORMAT		
0x007B					WM_CONTEXTMENU		
0x007C					WM_STYLECHANGING		
0x007D					WM_STYLECHANGED		
0x007E					WM_DISPLAYCHANGE		
0x007F					WM_GETICON		
0x0080					WM_SETICON		
0x0080					WM_SETICON		
0x0081					WM_NCCREATE		
0x0082					WM_NCDESTROY		
0x0083					WM_NCCALCSIZE		
0x0084					WM_NCHITTEST		
0x0085					WM_NCPAINT		
0x0086					WM_NCACTIVATE		
0x0087					WM_GETDLGCODE		
0x00A0					WM_NCMOUSEMOVE		
0x00A1					WM_NCLBUTTONDOWN		
0x00A2					WM_NCLBUTTONUP		
0x00A3					WM_NCLBUTTONDBLCLK		
0x00A4					WM_NCRBUTTONDOWN		
0x00A5					WM_NCRBUTTONUP		
0x00A6					WM_NCRBUTTONDBLCLK		
0x00A7					WM_NCMBUTTONDOWN		
0x00A8					WM_NCMBUTTONUP		
0x00A9					WM_NCMBUTTONDBLCLK		
0x00A9					WM_NCMBUTTONDBLCLK		
0x0100					WM_KEYFIRST		
0x0100					WM_KEYDOWN		
0x0101					WM_KEYUP		
0x0102					WM_CHAR		
0x0103					WM_DEADCHAR		
0x0104					WM_SYSKEYDOWN		
0x0105					WM_SYSKEYUP		
0x0106					WM_SYSCHAR		
0x0107					WM_SYSDEADCHAR		
0x0108					WM_KEYLAST		
0x0108					WM_KEYLAST		
0x0110					WM_INITDIALOG		
0x0111					WM_COMMAND		
0x0112					WM_SYSCOMMAND		
0x0113					WM_TIMER		
0x0114					WM_HSCROLL		
0x0115					WM_VSCROLL		
0x0116					WM_INITMENU		
0x0117					WM_INITMENUPOPUP		
0x011F					WM_MENUSELECT		
0x0120					WM_MENUCHAR		
0x0121					WM_ENTERIDLE		
0x0121					WM_ENTERIDLE		
0x0132					WM_CTLCOLORMSGBOX		
0x0133					WM_CTLCOLOREDIT		
0x0134					WM_CTLCOLORLISTBOX		
0x0135					WM_CTLCOLORBTN		
0x0136					WM_CTLCOLORDLG		
0x0137					WM_CTLCOLORSCROLLBAR		
0x0138					WM_CTLCOLORSTATIC		
0x0138					WM_CTLCOLORSTATIC		
0x0200					WM_MOUSEFIRST		
0x0200					WM_MOUSEMOVE		
0x0201					WM_LBUTTONDOWN		
0x0202					WM_LBUTTONUP		
0x0203					WM_LBUTTONDBLCLK		
0x0204					WM_RBUTTONDOWN		
0x0205					WM_RBUTTONUP		
0x0206					WM_RBUTTONDBLCLK		
0x0207					WM_MBUTTONDOWN		
0x0208					WM_MBUTTONUP		
0x0209					WM_MBUTTONDBLCLK		
0x020A					WM_MOUSEWHEEL		
0x020A					WM_MOUSELAST		
0x020A					WM_MOUSELAST		
0x0210					WM_PARENTNOTIFY		
0x0211					WM_ENTERMENULOOP		
0x0212					WM_EXITMENULOOP		
0x0213					WM_NEXTMENU		
0x0213					WM_NEXTMENU		
532					WM_SIZING		
533					WM_CAPTURECHANGED		
534					WM_MOVING		
536					WM_POWERBROADCAST		
537					WM_DEVICECHANGE		
537					WM_DEVICECHANGE		
0x010D					WM_IME_STARTCOMPOSITION		
0x010E					WM_IME_ENDCOMPOSITION		
0x010F					WM_IME_COMPOSITION		
0x010F					WM_IME_KEYLAST		
0x010F					WM_IME_KEYLAST		
0x0281					WM_IME_SETCONTEXT		
0x0282					WM_IME_NOTIFY		
0x0283					WM_IME_CONTROL		
0x0284					WM_IME_COMPOSITIONFULL		
0x0285					WM_IME_SELECT		
0x0286					WM_IME_CHAR		
0x0286					WM_IME_CHAR		
0x0290					WM_IME_KEYDOWN		
0x0291					WM_IME_KEYUP		
0x0291					WM_IME_KEYUP		
0x0220					WM_MDICREATE		
0x0221					WM_MDIDESTROY		
0x0222					WM_MDIACTIVATE		
0x0223					WM_MDIRESTORE		
0x0224					WM_MDINEXT		
0x0225					WM_MDIMAXIMIZE		
0x0226					WM_MDITILE		
0x0227					WM_MDICASCADE		
0x0228					WM_MDIICONARRANGE		
0x0229					WM_MDIGETACTIVE		
0x0230					WM_MDISETMENU		
0x0230					WM_MDISETMENU		
0x0231					WM_ENTERSIZEMOVE		
0x0232					WM_EXITSIZEMOVE		
0x0233					WM_DROPFILES		
0x0234					WM_MDIREFRESHMENU		
0x0234					WM_MDIREFRESHMENU		
0x02A1					WM_MOUSEHOVER		
0x02A3					WM_MOUSELEAVE		
0x02A3					WM_MOUSELEAVE		
0x0300					WM_CUT		
0x0301					WM_COPY		
0x0302					WM_PASTE		
0x0303					WM_CLEAR		
0x0304					WM_UNDO		
0x0305					WM_RENDERFORMAT		
0x0306					WM_RENDERALLFORMATS		
0x0307					WM_DESTROYCLIPBOARD		
0x0308					WM_DRAWCLIPBOARD		
0x0309					WM_PAINTCLIPBOARD		
0x030A					WM_VSCROLLCLIPBOARD		
0x030B					WM_SIZECLIPBOARD		
0x030C					WM_ASKCBFORMATNAME		
0x030D					WM_CHANGECBCHAIN		
0x030E					WM_HSCROLLCLIPBOARD		
0x030F					WM_QUERYNEWPALETTE		
0x0310					WM_PALETTEISCHANGING		
0x0311					WM_PALETTECHANGED		
0x0312					WM_HOTKEY		
0x0312					WM_HOTKEY		
791					WM_PRINT		
792					WM_PRINTCLIENT		
792					WM_PRINTCLIENT		
856					WM_HANDHELDFIRST		
863					WM_HANDHELDLAST		
863					WM_HANDHELDLAST		
0x0380					WM_PENWINFIRST		
0x038F					WM_PENWINLAST		
0x038F					WM_PENWINLAST		
0x0390					WM_COALESCE_FIRST		
0x039F					WM_COALESCE_LAST		
0x039F					WM_COALESCE_LAST		
0x03E0					WM_DDE_FIRST		
0x03E0					WM_DDE_INITIATE		
0x03E1					WM_DDE_TERMINATE		
0x03E2					WM_DDE_ADVISE		
0x03E3					WM_DDE_UNADVISE		
0x03E4					WM_DDE_ACK		
0x03E5					WM_DDE_DATA		
0x03E6					WM_DDE_REQUEST		
0x03E7					WM_DDE_POKE		
0x03E8					WM_DDE_EXECUTE		
0x03E8					WM_DDE_LAST		
0x03E8					WM_DDE_LAST		
0x8000					WM_APP		
0x8000					WM_APP		
0x0400					WM_USER		
0x0400					WM_USER		
0x0400					WM_USER		
0x0400					WM_USER		
0x0400					WM_USER		
0x0000					WM_NULL
0x0001					WM_CREATE
0x0002					WM_DESTROY
0x0003					WM_MOVE
0x0005					WM_SIZE
0x0006					WM_ACTIVATE
0x0007					WM_SETFOCUS
0x0008					WM_KILLFOCUS
0x000A					WM_ENABLE
0x000B					WM_SETREDRAW
0x000C					WM_SETTEXT
0x000D					WM_GETTEXT
0x000E					WM_GETTEXTLENGTH
0x000F					WM_PAINT
0x0010					WM_CLOSE
0x0011					WM_QUERYENDSESSION
0x0012					WM_QUIT
0x0013					WM_QUERYOPEN
0x0014					WM_ERASEBKGND
0x0015					WM_SYSCOLORCHANGE
0x0016					WM_ENDSESSION
0x0018					WM_SHOWWINDOW
0x001A					WM_WININICHANGE
0x001A					WM_SETTINGCHANGE
0x001B					WM_DEVMODECHANGE
0x001C					WM_ACTIVATEAPP
0x001D					WM_FONTCHANGE
0x001E					WM_TIMECHANGE
0x001F					WM_CANCELMODE
0x0020					WM_SETCURSOR
0x0021					WM_MOUSEACTIVATE
0x0022					WM_CHILDACTIVATE
0x0023					WM_QUEUESYNC
0x0024					WM_GETMINMAXINFO
0x0026					WM_PAINTICON
0x0027					WM_ICONERASEBKGND
0x0028					WM_NEXTDLGCTL
0x002A					WM_SPOOLERSTATUS
0x002B					WM_DRAWITEM
0x002C					WM_MEASUREITEM
0x002D					WM_DELETEITEM
0x002E					WM_VKEYTOITEM
0x002F					WM_CHARTOITEM
0x0030					WM_SETFONT
0x0031					WM_GETFONT
0x0032					WM_SETHOTKEY
0x0033					WM_GETHOTKEY
0x0037					WM_QUERYDRAGICON
0x0039					WM_COMPAREITEM
0x003D					WM_GETOBJECT
0x0041					WM_COMPACTING
0x0046					WM_WINDOWPOSCHANGING
0x0047					WM_WINDOWPOSCHANGED
0x0048					WM_POWER
0x004A					WM_COPYDATA
0x004B					WM_CANCELJOURNAL
0x004E					WM_NOTIFY
0x0050					WM_INPUTLANGCHANGEREQUEST
0x0051					WM_INPUTLANGCHANGE
0x0052					WM_TCARD
0x0053					WM_HELP
0x0054					WM_USERCHANGED
0x0055					WM_NOTIFYFORMAT
0x007B					WM_CONTEXTMENU
0x007C					WM_STYLECHANGING
0x007D					WM_STYLECHANGED
0x007E					WM_DISPLAYCHANGE
0x007F					WM_GETICON
0x0080					WM_SETICON
0x0081					WM_NCCREATE
0x0082					WM_NCDESTROY
0x0083					WM_NCCALCSIZE
0x0084					WM_NCHITTEST
0x0085					WM_NCPAINT
0x0086					WM_NCACTIVATE
0x0087					WM_GETDLGCODE
0x0088					WM_SYNCPAINT
0x00A0					WM_NCMOUSEMOVE
0x00A1					WM_NCLBUTTONDOWN
0x00A2					WM_NCLBUTTONUP
0x00A3					WM_NCLBUTTONDBLCLK
0x00A4					WM_NCRBUTTONDOWN
0x00A5					WM_NCRBUTTONUP
0x00A6					WM_NCRBUTTONDBLCLK
0x00A7					WM_NCMBUTTONDOWN
0x00A8					WM_NCMBUTTONUP
0x00A9					WM_NCMBUTTONDBLCLK
0x0100					WM_KEYFIRST
0x0100					WM_KEYDOWN
0x0101					WM_KEYUP
0x0102					WM_CHAR
0x0103					WM_DEADCHAR
0x0104					WM_SYSKEYDOWN
0x0105					WM_SYSKEYUP
0x0106					WM_SYSCHAR
0x0107					WM_SYSDEADCHAR
0x0108					WM_KEYLAST
0x010D					WM_IME_STARTCOMPOSITION
0x010E					WM_IME_ENDCOMPOSITION
0x010F					WM_IME_COMPOSITION
0x010F					WM_IME_KEYLAST
0x0110					WM_INITDIALOG
0x0111					WM_COMMAND
0x0112					WM_SYSCOMMAND
0x0113					WM_TIMER
0x0114					WM_HSCROLL
0x0115					WM_VSCROLL
0x0116					WM_INITMENU
0x0117					WM_INITMENUPOPUP
0x011F					WM_MENUSELECT
0x0120					WM_MENUCHAR
0x0121					WM_ENTERIDLE
0x0122					WM_MENURBUTTONUP
0x0123					WM_MENUDRAG
0x0124					WM_MENUGETOBJECT
0x0125					WM_UNINITMENUPOPUP
0x0126					WM_MENUCOMMAND
0x0132					WM_CTLCOLORMSGBOX
0x0133					WM_CTLCOLOREDIT
0x0134					WM_CTLCOLORLISTBOX
0x0135					WM_CTLCOLORBTN
0x0136					WM_CTLCOLORDLG
0x0137					WM_CTLCOLORSCROLLBAR
0x0138					WM_CTLCOLORSTATIC
0x0200					WM_MOUSEFIRST
0x0200					WM_MOUSEMOVE
0x0201					WM_LBUTTONDOWN
0x0202					WM_LBUTTONUP
0x0203					WM_LBUTTONDBLCLK
0x0204					WM_RBUTTONDOWN
0x0205					WM_RBUTTONUP
0x0206					WM_RBUTTONDBLCLK
0x0207					WM_MBUTTONDOWN
0x0208					WM_MBUTTONUP
0x0209					WM_MBUTTONDBLCLK
0x020A					WM_MOUSEWHEEL
0x0210					WM_PARENTNOTIFY
0x0211					WM_ENTERMENULOOP
0x0212					WM_EXITMENULOOP
0x0213					WM_NEXTMENU
0x0214					WM_SIZING
0x0215					WM_CAPTURECHANGED
0x0216					WM_MOVING
0x0219					WM_DEVICECHANGE
0x0220					WM_MDICREATE
0x0221					WM_MDIDESTROY
0x0222					WM_MDIACTIVATE
0x0223					WM_MDIRESTORE
0x0224					WM_MDINEXT
0x0225					WM_MDIMAXIMIZE
0x0226					WM_MDITILE
0x0227					WM_MDICASCADE
0x0228					WM_MDIICONARRANGE
0x0229					WM_MDIGETACTIVE
0x0230					WM_MDISETMENU
0x0231					WM_ENTERSIZEMOVE
0x0232					WM_EXITSIZEMOVE
0x0233					WM_DROPFILES
0x0234					WM_MDIREFRESHMENU
0x0281					WM_IME_SETCONTEXT
0x0282					WM_IME_NOTIFY
0x0283					WM_IME_CONTROL
0x0284					WM_IME_COMPOSITIONFULL
0x0285					WM_IME_SELECT
0x0286					WM_IME_CHAR
0x0288					WM_IME_REQUEST
0x0290					WM_IME_KEYDOWN
0x0291					WM_IME_KEYUP
0x02A1					WM_MOUSEHOVER
0x02A3					WM_MOUSELEAVE
0x0300					WM_CUT
0x0301					WM_COPY
0x0302					WM_PASTE
0x0303					WM_CLEAR
0x0304					WM_UNDO
0x0305					WM_RENDERFORMAT
0x0306					WM_RENDERALLFORMATS
0x0307					WM_DESTROYCLIPBOARD
0x0308					WM_DRAWCLIPBOARD
0x0309					WM_PAINTCLIPBOARD
0x030A					WM_VSCROLLCLIPBOARD
0x030B					WM_SIZECLIPBOARD
0x030C					WM_ASKCBFORMATNAME
0x030D					WM_CHANGECBCHAIN
0x030E					WM_HSCROLLCLIPBOARD
0x030F					WM_QUERYNEWPALETTE
0x0310					WM_PALETTEISCHANGING
0x0311					WM_PALETTECHANGED
0x0312					WM_HOTKEY
0x0317					WM_PRINT
0x0318					WM_PRINTCLIENT
0x0358					WM_HANDHELDFIRST
0x035F					WM_HANDHELDLAST
0x0360					WM_AFXFIRST
0x037F					WM_AFXLAST
0x0380					WM_PENWINFIRST
0x038F					WM_PENWINLAST
0x0400					WM_USER
0x8000					WM_APP
0x8000					WM_APP
0x8000					WM_APP
0x8000					WM_APP
1					CS_VREDRAW
2					CS_HREDRAW
4					CS_KEYCVTWINDOW
8					CS_DBLCLKS
32					CS_OWNDC
64					CS_CLASSDC
128					CS_PARENTDC
256					CS_NOKEYCVT
512					CS_NOCLOSE
2048					CS_SAVEBITS
4096					CS_BYTEALIGNCLIENT
8192					CS_BYTEALIGNWINDOW
16384					CS_PUBLICCLASS
16384					CS_PUBLICCLASS
16384					CS_PUBLICCLASS
16384					CS_PUBLICCLASS
0x0					WS_OVERLAPPED
0x80000000				WS_POPUP
0x40000000				WS_CHILD
0x20000000				WS_MINIMIZE
0x10000000				WS_VISIBLE
0x8000000				WS_DISABLED
0x4000000				WS_CLIPSIBLINGS
0x2000000				WS_CLIPCHILDREN
0x1000000				WS_MAXIMIZE
0xC00000				WS_CAPTION
0x800000				WS_BORDER
0x400000				WS_DLGFRAME
0x200000				WS_VSCROLL
0x100000				WS_HSCROLL
0x80000					WS_SYSMENU
0x40000					WS_THICKFRAME
0x20000					WS_GROUP
0x10000					WS_TABSTOP
0x20000					WS_MINIMIZEBOX
0x10000					WS_MAXIMIZEBOX
0x0					WS_TILED
0x20000000				WS_ICONIC
0x40000					WS_SIZEBOX
0xCF0000				WS_OVERLAPPEDWINDOW
0x80880000				WS_POPUPWINDOW
0x80880000				WS_POPUPWINDOW
0x80880000				WS_POPUPWINDOW
0x80880000				WS_POPUPWINDOW
0x1					WS_EX_DLGMODALFRAME
0x4					WS_EX_NOPARENTNOTIFY
0x8					WS_EX_TOPMOST
0x10					WS_EX_ACCEPTFILES
0x20					WS_EX_TRANSPARENT
0x40					WS_EX_MDICHILD
0x80					WS_EX_TOOLWINDOW
0x100					WS_EX_WINDOWEDGE
0x200					WS_EX_CLIENTEDGE
0x400					WS_EX_CONTEXTHELP
0x1000					WS_EX_RIGHT
0x0					WS_EX_LEFT
0x2000					WS_EX_RTLREADING
0x0					WS_EX_LTRREADING
0x4000					WS_EX_LEFTSCROLLBAR
0x0					WS_EX_RIGHTSCROLLBAR
0x10000					WS_EX_CONTROLPARENT
0x20000					WS_EX_STATICEDGE
0x40000					WS_EX_APPWINDOW
0x300					WS_EX_OVERLAPPEDWINDOW
0x188					WS_EX_PALETTEWINDOW
0x80000					WS_EX_LAYERED
0x80000					WS_EX_LAYERED
0x80000					WS_EX_LAYERED
0x80000					WS_EX_LAYERED
0					HCBT_MOVESIZE
1					HCBT_MINMAX
2					HCBT_QS
3					HCBT_CREATEWND
4					HCBT_DESTROYWND
5					HCBT_ACTIVATE
6					HCBT_CLICKSKIPPED
7					HCBT_KEYSKIPPED
8					HCBT_SYSCOMMAND
9					HCBT_SETFOCUS
0					PM_NOREMOVE
1					PM_REMOVE
2					PM_NOYIELD
0					HC_ACTION
1					HC_GETNEXT
2					HC_SKIP
3					HC_NOREMOVE
3					HC_NOREM
4					HC_SYSMODALON
5					HC_SYSMODALOFF
0					MSGF_DIALOGBOX
1					MSGF_MESSAGEBOX
2					MSGF_MENU
5					MSGF_SCROLLBAR
6					MSGF_NEXTWINDOW
8					MSGF_MAX
4096					MSGF_USER
32769					MSGF_DDEMGR
1					HSHELL_WINDOWCREATED
2					HSHELL_WINDOWDESTROYED
3					HSHELL_ACTIVATESHELLWINDOW
4					HSHELL_WINDOWACTIVATED
5					HSHELL_GETMINRECT
6					HSHELL_REDRAW
7					HSHELL_TASKMAN
8					HSHELL_LANGUAGE
8					HSHELL_LANGUAGE
8					HSHELL_LANGUAGE
8					HSHELL_LANGUAGE
0x00000000L				const long BS_PUSHBUTTON
0x00000001L				const long BS_DEFPUSHBUTTON
0x00000002L				const long BS_CHECKBOX
0x00000003L				const long BS_AUTOCHECKBOX
0x00000004L				const long BS_RADIOBUTTON
0x00000005L				const long BS_3STATE
0x00000006L				const long BS_AUTO3STATE
0x00000007L				const long BS_GROUPBOX
0x00000008L				const long BS_USERBUTTON
0x00000009L				const long BS_AUTORADIOBUTTON
0x0000000BL				const long BS_OWNERDRAW
0x00000020L				const long BS_LEFTTEXT
0x00000000L				const long BS_TEXT
0x00000040L				const long BS_ICON
0x00000080L				const long BS_BITMAP
0x00000100L				const long BS_LEFT
0x00000200L				const long BS_RIGHT
0x00000300L				const long BS_CENTER
0x00000400L				const long BS_TOP
0x00000800L				const long BS_BOTTOM
0x00000C00L				const long BS_VCENTER
0x00001000L				const long BS_PUSHLIKE
0x00002000L				const long BS_MULTILINE
0x00004000L				const long BS_NOTIFY
0x00008000L				const long BS_FLAT
0x00000020L				const long BS_RIGHTBUTTON
0					const long BN_CLICKED
1					const long BN_PAINT
2					const long BN_HILITE
3					const long BN_UNHILITE
4					const long BN_DISABLE
5					const long BN_DOUBLECLICKED
2					const long BN_PUSHED
2					const long BN_UNPUSHED
5					const long BN_DBLCLK
6					const long BN_SETFOCUS
7					const long BN_KILLFOCUS
0x00F0					const long BM_GETCHECK
0x00F1					const long BM_SETCHECK
0x00F2					const long BM_GETSTATE
0x00F3					const long BM_SETSTATE
0x00F4					const long BM_SETSTYLE
0x00F5					const long BM_CLICK
0x00F6					const long BM_GETIMAGE
0x00F7					const long BM_SETIMAGE
0x0000					const long BST_UNCHECKED
0x0001					const long BST_CHECKED
0x0002					const long BST_INDETERMINATE
0x0004					const long BST_PUSHED
0x0008					const long BST_FOCUS
0x0000L					const long ES_LEFT
0x0001L					const long ES_CENTER
0x0002L					const long ES_RIGHT
0x0004L					const long ES_MULTILINE
0x0008L					const long ES_UPPERCASE
0x0010L					const long ES_LOWERCASE
0x0020L					const long ES_PASSWORD
0x0040L					const long ES_AUTOVSCROLL
0x0080L					const long ES_AUTOHSCROLL
0x0100L					const long ES_NOHIDESEL
0x0400L					const long ES_OEMCONVERT
0x0800L					const long ES_READONLY
0x1000L					const long ES_WANTRETURN
0x2000L					const long ES_NUMBER
0x0100					const long EN_SETFOCUS
0x0200					const long EN_KILLFOCUS
0x0300					const long EN_CHANGE
0x0400					const long EN_UPDATE
0x0500					const long EN_ERRSPACE
0x0501					const long EN_MAXTEXT
0x0601					const long EN_HSCROLL
0x0602					const long EN_VSCROLL
0x0001					const long EC_LEFTMARGIN
0x0002					const long EC_RIGHTMARGIN
0xffff					const long EC_USEFONTINFO
0x0001					const long EMSIS_COMPOSITIONSTRING
0x0001					const long EIMES_GETCOMPSTRATONCE
0x0002					const long EIMES_CANCELCOMPSTRINFOCUS
0x0004					const long EIMES_COMPLETECOMPSTRKILLFOCUS
0x00B0					const long EM_GETSEL
0x00B1					const long EM_SETSEL
0x00B2					const long EM_GETRECT
0x00B3					const long EM_SETRECT
0x00B4					const long EM_SETRECTNP
0x00B5					const long EM_SCROLL
0x00B6					const long EM_LINESCROLL
0x00B7					const long EM_SCROLLCARET
0x00B8					const long EM_GETMODIFY
0x00B9					const long EM_SETMODIFY
0x00BA					const long EM_GETLINECOUNT
0x00BB					const long EM_LINEINDEX
0x00BC					const long EM_SETHANDLE
0x00BD					const long EM_GETHANDLE
0x00BE					const long EM_GETTHUMB
0x00C1					const long EM_LINELENGTH
0x00C2					const long EM_REPLACESEL
0x00C4					const long EM_GETLINE
0x00C5					const long EM_LIMITTEXT
0x00C6					const long EM_CANUNDO
0x00C7					const long EM_UNDO
0x00C8					const long EM_FMTLINES
0x00C9					const long EM_LINEFROMCHAR
0x00CB					const long EM_SETTABSTOPS
0x00CC					const long EM_SETPASSWORDCHAR
0x00CD					const long EM_EMPTYUNDOBUFFER
0x00CE					const long EM_GETFIRSTVISIBLELINE
0x00CF					const long EM_SETREADONLY
0x00D0					const long EM_SETWORDBREAKPROC
0x00D1					const long EM_GETWORDBREAKPROC
0x00D2					const long EM_GETPASSWORDCHAR
0x00D3					const long EM_SETMARGINS
0x00D4					const long EM_GETMARGINS
0x00C5					const long EM_SETLIMITTEXT
0x00D5					const long EM_GETLIMITTEXT
0x00D6					const long EM_POSFROMCHAR
0x00D7					const long EM_CHARFROMPOS
0x00D8					const long EM_SETIMESTATUS
0x00D9					const long EM_GETIMESTATUS
0x00000000L				const long SS_LEFT
0x00000001L				const long SS_CENTER
0x00000002L				const long SS_RIGHT
0x00000003L				const long SS_ICON
0x00000004L				const long SS_BLACKRECT
0x00000005L				const long SS_GRAYRECT
0x00000006L				const long SS_WHITERECT
0x00000007L				const long SS_BLACKFRAME
0x00000008L				const long SS_GRAYFRAME
0x00000009L				const long SS_WHITEFRAME
0x0000000AL				const long SS_USERITEM
0x0000000BL				const long SS_SIMPLE
0x0000000CL				const long SS_LEFTNOWORDWRAP
0x0000000DL				const long SS_OWNERDRAW
0x0000000EL				const long SS_BITMAP
0x0000000FL				const long SS_ENHMETAFILE
0x00000010L				const long SS_ETCHEDHORZ
0x00000011L				const long SS_ETCHEDVERT
0x00000012L				const long SS_ETCHEDFRAME
0x0000001FL				const long SS_TYPEMASK
0x00000080L				const long SS_NOPREFIX
0x00000100L				const long SS_NOTIFY
0x00000200L				const long SS_CENTERIMAGE
0x00000400L				const long SS_RIGHTJUST
0x00000800L				const long SS_REALSIZEIMAGE
0x00001000L				const long SS_SUNKEN
0x00004000L				const long SS_ENDELLIPSIS
0x00008000L				const long SS_PATHELLIPSIS
0x0000C000L				const long SS_WORDELLIPSIS
0x0000C000L				const long SS_ELLIPSISMASK
0x0170					const long STM_SETICON
0x0171					const long STM_GETICON
0x0172					const long STM_SETIMAGE
0x0173					const long STM_GETIMAGE
0					const long STN_CLICKED
1					const long STN_DBLCLK
2					const long STN_ENABLE
3					const long STN_DISABLE
0x0174					const long STM_MSGMAX
0					const long LB_OKAY
(-1)					const long LB_ERR
(-2)					const long LB_ERRSPACE
(-2)					const long LBN_ERRSPACE
1					const long LBN_SELCHANGE
2					const long LBN_DBLCLK
3					const long LBN_SELCANCEL
4					const long LBN_SETFOCUS
5					const long LBN_KILLFOCUS
0x0180					const long LB_ADDSTRING
0x0181					const long LB_INSERTSTRING
0x0182					const long LB_DELETESTRING
0x0183					const long LB_SELITEMRANGEEX
0x0184					const long LB_RESETCONTENT
0x0185					const long LB_SETSEL
0x0186					const long LB_SETCURSEL
0x0187					const long LB_GETSEL
0x0188					const long LB_GETCURSEL
0x0189					const long LB_GETTEXT
0x018A					const long LB_GETTEXTLEN
0x018B					const long LB_GETCOUNT
0x018C					const long LB_SELECTSTRING
0x018D					const long LB_DIR
0x018E					const long LB_GETTOPINDEX
0x018F					const long LB_FINDSTRING
0x0190					const long LB_GETSELCOUNT
0x0191					const long LB_GETSELITEMS
0x0192					const long LB_SETTABSTOPS
0x0193					const long LB_GETHORIZONTALEXTENT
0x0194					const long LB_SETHORIZONTALEXTENT
0x0195					const long LB_SETCOLUMNWIDTH
0x0196					const long LB_ADDFILE
0x0197					const long LB_SETTOPINDEX
0x0198					const long LB_GETITEMRECT
0x0199					const long LB_GETITEMDATA
0x019A					const long LB_SETITEMDATA
0x019B					const long LB_SELITEMRANGE
0x019C					const long LB_SETANCHORINDEX
0x019D					const long LB_GETANCHORINDEX
0x019E					const long LB_SETCARETINDEX
0x019F					const long LB_GETCARETINDEX
0x01A0					const long LB_SETITEMHEIGHT
0x01A1					const long LB_GETITEMHEIGHT
0x01A2					const long LB_FINDSTRINGEXACT
0x01A5					const long LB_SETLOCALE
0x01A6					const long LB_GETLOCALE
0x01A7					const long LB_SETCOUNT
0x01A8					const long LB_INITSTORAGE
0x01A9					const long LB_ITEMFROMPOINT
0x01B0					const long LB_MSGMAX
0x0001L					const long LBS_NOTIFY
0x0002L					const long LBS_SORT
0x0004L					const long LBS_NOREDRAW
0x0008L					const long LBS_MULTIPLESEL
0x0010L					const long LBS_OWNERDRAWFIXED
0x0020L					const long LBS_OWNERDRAWVARIABLE
0x0040L					const long LBS_HASSTRINGS
0x0080L					const long LBS_USETABSTOPS
0x0100L					const long LBS_NOINTEGRALHEIGHT
0x0200L					const long LBS_MULTICOLUMN
0x0400L					const long LBS_WANTKEYBOARDINPUT
0x0800L					const long LBS_EXTENDEDSEL
0x1000L					const long LBS_DISABLENOSCROLL
0x2000L					const long LBS_NODATA
0x4000L					const long LBS_NOSEL
(0x0001L|0x0002L|0x200000|0x800000)	const long LBS_STANDARD
0					const long CB_OKAY
(-1)					const long CB_ERR
(-2)					const long CB_ERRSPACE
(-1)					const long CBN_ERRSPACE
1					const long CBN_SELCHANGE
2					const long CBN_DBLCLK
3					const long CBN_SETFOCUS
4					const long CBN_KILLFOCUS
5					const long CBN_EDITCHANGE
6					const long CBN_EDITUPDATE
7					const long CBN_DROPDOWN
8					const long CBN_CLOSEUP
9					const long CBN_SELENDOK
10					const long CBN_SELENDCANCEL
0x0001L					const long CBS_SIMPLE
0x0002L					const long CBS_DROPDOWN
0x0003L					const long CBS_DROPDOWNLIST
0x0010L					const long CBS_OWNERDRAWFIXED
0x0020L					const long CBS_OWNERDRAWVARIABLE
0x0040L					const long CBS_AUTOHSCROLL
0x0080L					const long CBS_OEMCONVERT
0x0100L					const long CBS_SORT
0x0200L					const long CBS_HASSTRINGS
0x0400L					const long CBS_NOINTEGRALHEIGHT
0x0800L					const long CBS_DISABLENOSCROLL
0x2000L					const long CBS_UPPERCASE
0x4000L					const long CBS_LOWERCASE
0x0140					const long CB_GETEDITSEL
0x0141					const long CB_LIMITTEXT
0x0142					const long CB_SETEDITSEL
0x0143					const long CB_ADDSTRING
0x0144					const long CB_DELETESTRING
0x0145					const long CB_DIR
0x0146					const long CB_GETCOUNT
0x0147					const long CB_GETCURSEL
0x0148					const long CB_GETLBTEXT
0x0149					const long CB_GETLBTEXTLEN
0x014A					const long CB_INSERTSTRING
0x014B					const long CB_RESETCONTENT
0x014C					const long CB_FINDSTRING
0x014D					const long CB_SELECTSTRING
0x014E					const long CB_SETCURSEL
0x014F					const long CB_SHOWDROPDOWN
0x0150					const long CB_GETITEMDATA
0x0151					const long CB_SETITEMDATA
0x0152					const long CB_GETDROPPEDCONTROLRECT
0x0153					const long CB_SETITEMHEIGHT
0x0154					const long CB_GETITEMHEIGHT
0x0155					const long CB_SETEXTENDEDUI
0x0156					const long CB_GETEXTENDEDUI
0x0157					const long CB_GETDROPPEDSTATE
0x0158					const long CB_FINDSTRINGEXACT
0x0159					const long CB_SETLOCALE
0x015A					const long CB_GETLOCALE
0x015b					const long CB_GETTOPINDEX
0x015c					const long CB_SETTOPINDEX
0x015d					const long CB_GETHORIZONTALEXTENT
0x015e					const long CB_SETHORIZONTALEXTENT
0x015f					const long CB_GETDROPPEDWIDTH
0x0160					const long CB_SETDROPPEDWIDTH
0x0161					const long CB_INITSTORAGE
0x0162					const long CB_MSGMAX
0x0000L					const long SBS_HORZ
0x0001L					const long SBS_VERT
0x0002L					const long SBS_TOPALIGN
0x0002L					const long SBS_LEFTALIGN
0x0004L					const long SBS_BOTTOMALIGN
0x0004L					const long SBS_RIGHTALIGN
0x0002L					const long SBS_SIZEBOXTOPLEFTALIGN
0x0004L					const long SBS_SIZEBOXBOTTOMRIGHTALIGN
0x0008L					const long SBS_SIZEBOX
0x0010L					const long SBS_SIZEGRIP
0x00E0					const long SBM_SETPOS
0x00E1					const long SBM_GETPOS
0x00E2					const long SBM_SETRANGE
0x00E6					const long SBM_SETRANGEREDRAW
0x00E3					const long SBM_GETRANGE
0x00E4					const long SBM_ENABLE_ARROWS
0x00E9					const long SBM_SETSCROLLINFO
0x00EA					const long SBM_GETSCROLLINFO
0x0001					const long SIF_RANGE
0x0002					const long SIF_PAGE
0x0004					const long SIF_POS
0x0008					const long SIF_DISABLENOSCROLL
0x0010					const long SIF_TRACKPOS
(0x0001|0x0002|0x0004|0x0010)		const long SIF_ALL
0xfffffffc				const long GWL_WNDPROC
0x80000000				const long COL_SYS_MASK
0x0					const long PS_SOLID
0x0					const long SIZE_RESTORED
0x0					const long SW_HIDE
0x4					const long SW_SHOWNOACTIVATE
0x5					const long SW_SHOW
0x80					const long SWP_HIDEWINDOW
0x40					const long SWP_SHOWWINDOW
12					const long BITSPIXEL
0x1002					const long SPI_GETMENUANIMATION
0x1024					const long SPI_GETDROPSHADOW
0x1024					const long SPI_GETDROPSHADOW
0x1024					const long SPI_GETDROPSHADOW

AutoHotKey

Filed under: Uncategorized — manoftoday @ 6:30 pm

 

1)  simulate a close action

WinGet, window_id, ID, MSN Messenger ;  as the title name
; 0x112 = WM_SYSCOMMAND, 0xF060 = SC_CLOSE
PostMessage, 0x112, 0xF060,,, ahk_id %window_id% ; approach to simulate a click on close button

 

the downside is that it will mimimize to trayicon, unless the program has no tray icon.

 

2) by process Exit

Process, Exist, msnmsgr.exe

 

the downside is that it will still have a dead trayicon there, unless you manually refresh the tray window

 

3)  perfect approach

WM_CLOSE=0x10
WM_QUIT=0x12

DetectHiddenWindows, On
Process, Exist, msnmsgr.exe
pid:=errorlevel
Loop
{
    IfWinExist, ahk_pid %pid%
    {
         ;WinClose
         ;PostMessage, WM_CLOSE
         PostMessage, WM_QUIT
    }
    else if A_Index>1
        break
    ;else msgbox, No dice!
}

 

4) by send a WM_COMMAN exit command

PostMessage, 0x111, 32770,,,雅虎通

 

how to find 32770?

please refer http://www.autohotkey.com/docs/misc/SendMessage.ht…

Subversion

Filed under: software — manoftoday @ 6:20 am

1)no undo-checkout

On Thu, 2005-01-27 at 23:43, David S. wrote:
> Some version control systems have the notion of undo check-out. In can
> see that with Subversion you can revert.
‘svn revert’ is used to undo the changes you make. You can’t
undo a checkout with ‘svn revert’.
Checkout in subversion means, you get a local copy of the repository,
or a portion of the repository. The server does not keep track of
working copies – If you need to get rid of a working copy, just
delete it.
> But what if you want to
> eliminate your view altogether? Do you just delete the directory?
>
> Thanks.
>
2) Commit failed: file has inconsistent newlines.

http://www.hanselman.com/blog/CategoryView.aspx?category=Subversion

3)  can not show diff because of inconsistent newlines in file

cannot show diff because of inconsistent newlines in file的解决方法

cannot show diff because of inconsistent newlines in file

有时候比较两个文件时,因为存在不同的换行格式,导致上面这个错误。

错误原因应该是TortoiseSVN自带的比较工具TortoiseMerge目前无法处理不同的换行格式。

解决方法:使用WinMerge作为外部比较工具

步骤:
1、下载WinMerge 2.6.0(本站下载区)或http://winmerge.org/downloads.php

2、安装WinMerge,在“选择额外任务”对话框中,将“integrate with TortoiseSVN”选上,

安装后,TortoiseSVN中的外部比较工具变成

e:\Program Files\WinMerge\WinMergeU.exe -e -x -ub -dl %bname -dr %yname %base %mine

(假设你的WinMerge安装在e:\Program Files\WinMerge)

再进行比较时,就不会出现cannot show diff because of inconsistent newlines in file了

http://www.iusesvn.com/bbs/thread-413-1-1.html

Blog at WordPress.com.