Hi, there is some way to detect 16bits process? for example if i open old win3x tetris, in task manager i get
ntvdm.exe
wowexec.exe
tetris.exe
if i use If ProcessExist("ntvdm.exe") works well, but sadly i realize after close a 16bits app ntvdm is still on background
If i try If ProcessExist("tetris.exe") is not working, never detect
I tried with IfWinExist, tetris works, but i preffer process, because i use a 16bits application that change the window name often (medical stuff)
My OS is XP Sp3
thanks a lot for any help
Detect 16bits process
Re: Detect 16bits process
VDMEnumProcessWOW()there is some way to detect 16bits process?
http://web.archive.org/web/20110317233038/http://support.microsoft.com/kb/182559These VDMs contain the WowExec.exe task. DOS VDMs are not enumerated. To enumerate DOS VDMs, you need to use another method. First, you could use VDMEnumProcessWOW() to make a list of all Win16 VDMs, and then enumerate all instances of NTVDM.exe using some other scheme (such as PSAPI). Any NTVDM.exe from the full enumeration that was not in the Win16 list is a DOS VDM.
http://web.archive.org/web/20210621185123/https://stackoverflow.com/questions/4121383/reliably-detect-16-bit-process
Code: Select all
if !VdmDbgDLL := DllCall("LoadLibrary", "Str", "VdmDbg.dll", "Ptr") ; might have to give it a full path, idk where its located by default
{
MsgBox failed to load VdmDbg.dll`nErrorLevel: %ErrorLevel%`nA_LastError: %A_LastError%
ExitApp
}
ProcessVDMsProc := RegisterCallback("ProcessVDMs")
DllCall("VdmDbg\VDMEnumProcessWOW", "Ptr", ProcessVDMsProc, "Ptr", 0)
ProcessVDMs(dwProcessId, dwAttrib, t) {
MsgBox % "Process ID: " dwProcessId
static ProcessTasksProc := RegisterCallback("ProcessTasks")
; Use process ID of VDM to enumerate through its tasks
DllCall("VdmDbg\VDMEnumTaskWOWEx", "UInt", dwProcessId, "Ptr", ProcessTasksProc, "Ptr", 0)
return false ; Keep enumerating
}
ProcessTasks(dwThreadId, hMod16, hTask16, pszModName, pszFileName, lParam) {
; Print task's information
str := "Thread ID: " dwThreadId
str .= "`nModule handle: " hMod16
str .= "`nTask handle: " hTask16
str .= "`nModule Name: " StrGet(pszModName) ; may be wrong
str .= "`nFile Name: " StrGet(pszFileName) ; may be wrong
MsgBox % str
return false ; Keep enumerating
}
why not use SetTitleMatchMode's RegEx option then instead? this would allow u to match changing titles(provided they follow at least some semblance of a pattern)I tried with IfWinExist, tetris works, but i preffer process, because i use a 16bits application that change the window name often (medical stuff)
Who is online
Users browsing this forum: No registered users and 302 guests