Skip to content
조회 수 20425 추천 수 0 댓글 0
?

단축키

Prev이전 문서

Next다음 문서

크게 작게 위로 아래로 댓글로 가기 인쇄
?

단축키

Prev이전 문서

Next다음 문서

크게 작게 위로 아래로 댓글로 가기 인쇄

Tips N Tricks



Using Registry Editor, browse to the following value in the registry: 
HKEY_CURRENT_USER\Software\Microsoft\Command Processor\CompletionChar 
and modify it to be 9Note: Chr(9) = TAB 

To Undo it modify the value to be 0

    The following code will toggle the Command Completion Feature between OFF & ON (Tab)

Code:
/*
UNIX Shell "Command Completion" feature for WINDOWS.
This scripts toggles the feature (affects CURRENT User) everytime run.
Change RootKey to "HKEY_LOCAL_MACHINE" for applying a Global change.
*/


Rootkey :="HKEY_CURRENT_USER"
SubKey  :="Software\Microsoft\Command Processor"

RegRead,cChar,%RootKey%,%SubKey%,CompletionChar
IfEqual,cChar,0,RegWrite,REG_DWORD,%RootKey%,%SubKey%,CompletionChar,9
IfEqual,cChar,9,RegWrite,REG_DWORD,%RootKey%,%SubKey%,CompletionChar,0
RegRead,cChar,%RootKey%,%SubKey%,CompletionChar

MsgBox,64,Command Completion feature, Completion Character = %cChar%


Process Listing - Using third party DLL! 





Quote:
Foreword: 

A much simpler & effective code ( 8 lines only) for retrieving 
the Process List (from the Task Manager) has been posted by Mr.Laszlo in this same topic: 

http://www.autohotkey.com/forum/viewtopic.php?p=81207#81207 

A pure AHK solution by calling Windows API functions has been posted by Titan in this same topic: 

http://www.autohotkey.com/forum/viewtopic.php?p=81564#81564
 

Note: If you are using Windows 2000 and no processes are returned, then add #NoEnv to be the first line in Titan's script. I faced this problem & it took me many hours before I found the truth. 




Code (Expand):
/*

Demonstration code for third party DLL : KJLPROC.DLL
This script creates a ListView of running processes.
Tested only in Windows 2000.

Title        : Easy Process Listing with Third Party DLL.
Author       : A.N.Suresh Kumar aka "Goyyah"
Created Date : 30-Sep-2006
Last Modfied : 30-Sep-2006

Download Information:

ZIP File : http://www.kjlsoftware.com/demos/kjlproc.zip [30K]
WebSite  : http://www.kjlsoftware.com/freeware.html
 Backup  : http://autohotkey.net/~goyyah/3PDLL/Process/KJL/kjlproc.zip 

Only DLL : http://autohotkey.net/~goyyah/3PDLL/Process/KJL/kjlproc.dll [52K]
License  : http://autohotkey.net/~goyyah/3PDLL/Process/KJL/SoftwareLicense.txt

SnapShot : http://autohotkey.net/~goyyah/3PDLL/Process/KJL/proclist.png

*/


#NoTrayIcon
Menu, Tray, Icon, User32.dll, 1
Gui, +AlwaysOnTop
Gui, Margin, 1, 1
Gui, Add, ListView, w640 h400, Process|PID|Win ID|Win Title|Priority

DataPointer := DllCall("kjlproc.dll\KJLPList", Int,1)

/*
The above DllCall returns a pointer to memory address of
the actual text data. The following lines extracts the data
from the pointer. 
*/


Slen := DllCall("lstrlen", UInt, DataPointer) 
VarSetCapacity(ProcessList, Slen) 
DllCall("lstrcpy", Str, ProcessList, UInt, DataPointer)

/*
My sincere thanks to Philippe Lhoste aka PhiLho for above code.
 See: http://www.autohotkey.com/forum/viewtopic.php?p=77558#77558
*/


Ctr=1
Loop, PARSE, ProcessList, |
   {
     StringSplit, Field, A_LoopField, ^
     IfEqual, Field1, _Total.exe, Continue
     Field5 := GetPriority(Field2)
     LV_Add("", Field1, Field2, Field3, Field4, Field5)
     Ctr++
   }
LV_ModifyCol()
Gui, Add, StatusBar, ,Total Process Running: %Ctr%
Gui, Show, , ListView of Processes [ KJLPROC.DLL ]
Return

/*
GetPriority() has been posted at the following URL:
http://www.autohotkey.com/forum/viewtopic.php?p=80548#80548
*/


GetPriority(PID=0) { 
 IfLessOrEqual, PID, 0, Return, "Error!" 
 hProcess := DllCall("OpenProcess", Int,1024, Int,0, Int,PID) 
 Priority := DllCall("GetPriorityClass", Int,hProcess) 
 DllCall("CloseHandle", Int,hProcess) 
 IfEqual, Priority, 64   , Return, "Low" 
 IfEqual, Priority, 16384, Return, "BelowNormal" 
 IfEqual, Priority, 32   , Return, "Normal" 
 IfEqual, Priority, 32768, Return, "AboveNormal" 
 IfEqual, Priority, 128  , Return, "High" 
 IfEqual, Priority, 256  , Return, "Realtime" 
Return "" 
}

GuiClose:
GuiEscape:
 ExitApp
Return

Remarks: 

  • Disclaimer: Not tested/experimented enough! . 
  • Standalone download : kjlproc.dll 
  • kjlproc.dll contains only one function : KJLPList() and is fast enough! 
  • kjlproc.dll is sized at 52 Kb .. That is big for a single function, but it saves me many lines of confusion! 
  • The DLL is freeware but I find the license confusing: Software License.txt 
  • The retrieval of the "Process list" as a single string involves only 4 lines: 

      Copy / Paste / Try example :

    Code:
    DataPointer := DllCall("kjlproc.dll\KJLPList", Int,1) 
    Slen := DllCall("lstrlen", UInt, DataPointer) 
    VarSetCapacity(ProcessList, Slen) 
    DllCall("lstrcpy", Str, ProcessList, UInt, DataPointer) 

    FileAppend, %ProcessList%, proc.txt
    MsgBox, 64,List of Process, %ProcessList%

  • Here is a copy of proc.txt 


    Edit: 11-Nov-2006

Quote:

To ascertain which processes are GUI based one may use the IsGUI() 
Code:
A := IsGui("System")
MsgBox, % A
Return

IsGUI(process="") { 
 Process, Exist, %process% 
 PID := ErrorLevel 
 IfLessOrEqual, PID, 0, Return, "Process:%process% does not exist!" 

 hProcess   := DllCall("OpenProcess", Int,1024, Int,0, Int,PID) 
 GuiObjects := DllCall("GetGuiResources", Int,hProcess, Int,1)
 DllCall("CloseHandle", Int,hProcess) 
Return 1-!GuiObjects ; Return 1 if process has GUI, else 0
}


GetGuiResources maybe used with Titan's Process Listing solution ( also available in AHK Documentation) to determine whether a process is GUI based. However, you cannot use it to verify an AHK process, because even a non-GUI AHK script has a GUI which can be viewed by double-clicking the tray icon. 

See MSDN : GetGuiResources 







로그인 후 댓글쓰기가 가능합니다.

?

List of Articles
번호 분류 제목 날짜 조회 수
67 AutoHotKey ahk로 만든 파일을 exe로 컴파일 한 후 실행시킬때 변수를 임의 1 1 2011.02.24 15333
66 AutoHotKey AHK에서 가능한 COM 인터넷 익스플로러 및 GUI 브라우저 1 2011.02.11 19502
65 AutoHotKey ahk와 ahk_l 의 웹페이지 로딩완료 체크 비교 3 2011.02.11 20324
64 AutoHotKey Autohotkey + mypeople(마이피플) 메시지 전송 1 2013.03.12 15431
63 컴퓨터잡담 autohotkey - 변수리스트(Variables and Expressions) 모음 2011.09.30 11830
62 AutoHotKey AutoHotkey COM Standard Library 2 2011.02.10 18046
61 컴퓨터잡담 Autohotkey DllCall() 호출하기 5 2010.12.19 23469
60 컴퓨터잡담 autohotkey 변수의 이해 2010.10.02 20631
59 AutoHotKey Autohotkey 브라우저 제어 테스트 file 2015.01.26 8203
58 AutoHotKey autohotkey) 30분마다 자동으로 디스크 정리하기 file 2013.07.31 33070
57 AutoHotKey Autohotkey) Find WM_COMMAND parameter with Winspector 17 2012.02.22 35869
56 AutoHotKey autohotkey) IPv6 모두 사용안함 설정하기 1 file 2011.12.30 19133
55 AutoHotKey autohotkey) Mutex에 대해서 1 4 2011.12.31 24094
54 AutoHotKey autohotkey) postmessage mouse control 13 2012.02.22 28628
53 AutoHotKey autohotkey) Virus? 6 2011.12.31 34679
52 AutoHotKey autohotkey) 네 코드를 보여, 내가 당신에게서 배우고 싶어요 1 2012.01.08 15114
51 AutoHotKey autohotkey) 맥어드레스 추출 2 2011.12.21 15057
50 AutoHotKey autohotkey) 오토핫키에서 자주쓰는 함수모음 2013.10.30 33659
49 AutoHotKey autohotkey) 웹페이지의 프레임 내용보기 & 클릭하기 2011.11.29 15147
48 AutoHotKey autohotkey) 윈도우 ahk_id 추출하기 2 2012.03.06 30088
Board Pagination Prev 1 2 3 4 5 Next
/ 5

http://urin79.com

우린친구블로그

sketchbook5, 스케치북5

sketchbook5, 스케치북5

나눔글꼴 설치 안내


이 PC에는 나눔글꼴이 설치되어 있지 않습니다.

이 사이트를 나눔글꼴로 보기 위해서는
나눔글꼴을 설치해야 합니다.

설치 취소