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
번호 분류 제목 날짜 조회 수
27 컴퓨터잡담 인터넷 익스플러러 속도 향샹을 위한 팁 1 file 2012.02.25 24571
26 AutoHotKey autohotkey) 윈도우 ahk_id 추출하기 2 2012.03.06 30088
25 AutoHotKey autohotkey) 편입 변수 4 2012.03.13 28888
24 AutoHotKey Autohotkey) 화면보호기(ScreenSaver) On/Off 방법 17 2012.03.16 40675
23 AutoHotKey AHK) AUTOKEY 웹페이지 열지않고 소스 가져오기 또는 로그인 하기 14 2012.05.12 52952
22 Excel GET.CELL 매크로함수 응용 11 2012.07.16 40175
21 AutoHotKey AHK) 보안프로그램 등으로 화면복사(Printscreen) 안될때 사용방법 1 12 file 2012.11.21 47165
20 AutoHotKey autohotkey) 파일리스트 가져오기 3 2012.11.26 14981
19 AutoHotKey Ahk) 웹페이지 감시결과에 따라 마이피플로 글 전송하기 12 file 2013.01.06 44023
18 AutoHotKey autohotkey)매월 1일의 요일 구하기 1 2013.01.27 15262
17 AutoHotKey Autohotkey + mypeople(마이피플) 메시지 전송 1 2013.03.12 15431
16 AutoHotKey autohotkey) 30분마다 자동으로 디스크 정리하기 file 2013.07.31 33070
15 회로도전자부품 Joule thief 회로(저전압 승압회로) file 2013.10.02 64153
14 회로도전자부품 주문한 부품 리스트 file 2013.10.26 20757
13 AutoHotKey ahk) 열려진 엑셀창의 값 불러오기 1 2013.10.30 32529
12 AutoHotKey ahk) autohotkey 글자 자르기 방법 2013.10.30 34672
11 AutoHotKey ahk) autohotkey 엑셀(Excel)에서 행값 증가시키기 2013.10.30 37416
10 AutoHotKey autohotkey) 오토핫키에서 자주쓰는 함수모음 2013.10.30 33686
9 AutoHotKey ahk) 오토핫키 콤보박스 제어하기 file 2013.10.30 38180
8 AutoHotKey ahk) autohotkey controlgettext 이름을 마우스커서에 졸졸 따라다니게 하기 file 2014.04.01 12182
Board Pagination Prev 1 2 3 4 5 Next
/ 5

http://urin79.com

우린친구블로그

sketchbook5, 스케치북5

sketchbook5, 스케치북5

나눔글꼴 설치 안내


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

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

설치 취소