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 AutoHotKey [AHK_B&AHK_L] 익스플로러 HTML 문서정보 알아내기(IE HTML Element Spy) 2011.08.08 15160
26 AutoHotKey autohotkey) 웹페이지의 프레임 내용보기 & 클릭하기 2011.11.29 15147
25 AutoHotKey autohotkey) 네 코드를 보여, 내가 당신에게서 배우고 싶어요 1 2012.01.08 15114
24 AutoHotKey autohotkey) 맥어드레스 추출 2 2011.12.21 15057
23 AutoHotKey autohotkey) 파일리스트 가져오기 3 2012.11.26 14980
22 AutoHotKey [ahk] 레지스터리 등록여부 확인 후 없으면 추가시키기 2 1 2011.02.14 14977
21 AutoHotKey [ahk]웹페이지가 띄워진 창 내용을 추출하여 로딩이 완료되었는지를 확인할 수 있는 소스 2011.02.25 14747
20 AutoHotKey 클릭해서 새창열리는 페이지에 클릭 또는 값설정 가능한가요? 2011.02.22 14723
19 컴퓨터잡담 IE 훅킹 혹은 가로채기. 강좌 2 2011.12.17 14604
18 AutoHotKey 웹페이지의 내용을 변수에 넣기 2011.02.17 14492
17 컴퓨터잡담 Ahk Standard Library Collection, 2010 Sep (+Gui) ~ Libs: 100 3 2011.10.11 14189
16 컴퓨터잡담 [AHK] COM Standard Library 1 1 2011.07.28 13588
15 컴퓨터잡담 [AHK] AutoHotkey_N, AutoHotkey.dll 1 2011.07.28 13562
14 컴퓨터잡담 AHK & my Address of Pointer and my Offset 2011.10.11 13183
13 AutoHotKey 부팅완료 메시지 프로그램 file 2011.12.17 12719
12 AutoHotKey ahk) autohotkey controlgettext 이름을 마우스커서에 졸졸 따라다니게 하기 file 2014.04.01 12182
11 AutoHotKey Ahk) ip할당 진단프로그램 file 2011.12.26 12119
10 컴퓨터잡담 autohotkey - 변수리스트(Variables and Expressions) 모음 2011.09.30 11830
9 [Docs]스프레드시트 스프레드시트 autohotkey html gmail 스마트폰 이용하여 핑로스 즉시 알림받기 file 2018.01.25 10578
8 컴퓨터잡담 AHK_L) SysListView321 컨트롤 내용 추출하기 2011.10.07 9893
Board Pagination Prev 1 2 3 4 5 Next
/ 5

http://urin79.com

우린친구블로그

sketchbook5, 스케치북5

sketchbook5, 스케치북5

나눔글꼴 설치 안내


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

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

설치 취소