|
![]() |
|
Thread Tools | Search this Thread | Display Modes |
![]() |
#1 |
Senior Member
Join Date: Nov 2013
Location: Iran
Posts: 343
|
![]()
Get Windows ClassName and TitleName With Application Process.exe Name
Suppose we do not know the ClassName or TitleName for the notepad.exe for now we use from the other apps (for sample autoit) for find the applications ClassName and TitleName... this code give me ClassName and TitleName but just show class and title the windows focused on that! HTML Code:
Section Loop: Sleep 555 System::Call user32::GetForegroundWindow()i.r1 System::Call 'USER32::GetClassName(ir1,t.r2,i ${NSIS_MAX_STRLEN})' System::Call 'USER32::GetWindowText(ir1,t.r3,i ${NSIS_MAX_STRLEN})' SetDetailsPrint both DetailPrint "($1)($2)($3)" SetDetailsPrint none Goto Loop SectionEnd now i try all ways to do it,but i failed for sample i try this: HTML Code:
System::Call user32::GetForegroundWindow(notepad.exe)i.r1 System::Call 'USER32::GetClassName(ir1,t.r2,i ${NSIS_MAX_STRLEN})' System::Call 'USER32::GetWindowText(ir1,t.r3,i ${NSIS_MAX_STRLEN})' |
![]() |
![]() |
![]() |
#2 |
Moderator
Join Date: Jun 2002
Location: ${NSISDIR}
Posts: 5,356
|
GetForegroundWindow only gets the window the user is working in, you cannot pass a module name to it.
Call user32::EnumWindows to enumerate all top-level windows on the desktop. IntOp $PostCount $PostCount + 1 |
![]() |
![]() |
![]() |
#3 | |
Senior Member
Join Date: Nov 2013
Location: Iran
Posts: 343
|
Quote:
HTML Code:
!include LogicLib.nsh showinstdetails show Section System::Get "(i.r1) iss" Pop $R0 System::Call "user32::EnumWindows(k R0,i) i.s" loop: Pop $0 StrCmp $0 "callback1" 0 done ;System::Call "user32::IsWindowVisible(ir1)i.r2" ;${If} $2 <> 0 System::Call "user32::GetWindowText(ir1,t.r2,i ${NSIS_MAX_STRLEN})" System::Call "user32::GetClassName(ir1,t.r3,i ${NSIS_MAX_STRLEN})" System::Call "user32::GetWindowModuleFileName(ir1,t.r4,i ${NSIS_MAX_STRLEN})" System::Call "user32::GetWindowThreadProcessId(ir1,*i.r5)" ;----------------------------- DetailPrint "____________________________________" DetailPrint "callback1!: [$0]" DetailPrint "Num: [$1]" DetailPrint "Class Name: [$2]" DetailPrint "Title Name: [$3]" DetailPrint "ModuleFileName: [$4]" DetailPrint "Pid Number: [$5]" DetailPrint "x2: [$6]" DetailPrint "____________________________________" Push 1 # callback's return value System::Call "$R0" Pop $0 ;${EndIf} Goto loop done: System::Free $R0 ;Dumpstate::Debug SectionEnd |
|
![]() |
![]() |
![]() |
|
Thread Tools | Search this Thread |
Display Modes | |
|
|