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 DllCall() 호출하기 5 2010.12.19 23469
26 AutoHotKey AutoHotkey COM Standard Library 2 2011.02.10 18046
25 컴퓨터잡담 autohotkey - 변수리스트(Variables and Expressions) 모음 2011.09.30 11830
24 AutoHotKey Autohotkey + mypeople(마이피플) 메시지 전송 1 2013.03.12 15431
23 AutoHotKey ahk와 ahk_l 의 웹페이지 로딩완료 체크 비교 3 2011.02.11 20324
22 AutoHotKey AHK에서 가능한 COM 인터넷 익스플로러 및 GUI 브라우저 1 2011.02.11 19502
21 AutoHotKey ahk로 만든 파일을 exe로 컴파일 한 후 실행시킬때 변수를 임의 1 1 2011.02.24 15333
20 컴퓨터잡담 AHK_L) SysListView321 컨트롤 내용 추출하기 2011.10.07 9893
19 AutoHotKey ahk_l 웹페이지 파일로 저장한 뒤 불러와 필요한 부분 추출하여 출력하기 2011.02.22 16992
18 AutoHotKey AHK_L 예제소스 1 2011.02.10 17015
17 AutoHotKey ahk_l 과 com 의 이해 2011.02.22 17485
16 AutoHotKey ahk_l 웹페이지 앞, 뒤페이지 제어 예제소스 및 설명첨부 2011.02.22 17535
15 AutoHotKey Ahk) 웹페이지 감시결과에 따라 마이피플로 글 전송하기 12 file 2013.01.06 44023
14 AutoHotKey ahk) 오토핫키 콤보박스 제어하기 file 2013.10.30 38180
13 AutoHotKey ahk) 열려진 엑셀창의 값 불러오기 1 2013.10.30 32529
12 AutoHotKey AHK) 보안프로그램 등으로 화면복사(Printscreen) 안될때 사용방법 1 12 file 2012.11.21 47165
11 AutoHotKey ahk) Send an email 메일발송하기 2018.01.17 9390
10 AutoHotKey Ahk) ip할당 진단프로그램 file 2011.12.26 12119
9 AutoHotKey AHK) AUTOKEY 웹페이지 열지않고 소스 가져오기 또는 로그인 하기 14 2012.05.12 52952
8 AutoHotKey ahk) autohotkey 엑셀(Excel)에서 행값 증가시키기 2013.10.30 37416
Board Pagination Prev 1 2 3 4 5 Next
/ 5

http://urin79.com

우린친구블로그

sketchbook5, 스케치북5

sketchbook5, 스케치북5

나눔글꼴 설치 안내


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

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

설치 취소