Old 28th April 2018, 20:11   #1
r2du-soft
Senior Member
 
r2du-soft's Avatar
 
Join Date: Nov 2013
Location: Iran
Posts: 272
Question how can check process full load OR user interface is open?

1) when open some apps It takes a little time to load the user interface (gui) _ Like Photoshop..
2) some apps process is load and see user interface. when close user interface,app load in system try but dont see user interface (gui).... _ like internet download manager (idm).

now how can check a process is full load?
or how can check user interface (gui) is load and shown?
r2du-soft is offline   Reply With Quote
Old 29th April 2018, 02:34   #2
Anders
Moderator
 
Anders's Avatar
 
Join Date: Jun 2002
Location: ${NSISDIR}
Posts: 4,888
There is a Windows function called WaitForInputIdle but depending on the app, it might not work correctly if it has a splashscreen etc.

IntOp $PostCount $PostCount + 1
Anders is offline   Reply With Quote
Old 29th April 2018, 10:36   #3
r2du-soft
Senior Member
 
r2du-soft's Avatar
 
Join Date: Nov 2013
Location: Iran
Posts: 272
not problem,i want test that but i do not know how use from WaitForInputIdle
first i want test that on internet download manager (idm) for example
when IDM open in system tray when use this codes:

HTML Code:
FindWindow $0 "" "Internet Download Manager 6.30"
MessageBox MB_OK "$0"
variable $0 value is 66248 and Internet Download Manager found! but user interface is not visible!
i want when user interface is visible and shown message idm user interface Is displayed
i dont how can use WaitForInputIdle for do it work mr Anders
HTML Code:
    System::Call 'USER32::WaitForInputIdle(ir1,2000)i'
r2du-soft is offline   Reply With Quote
Old 29th April 2018, 13:49   #4
Anders
Moderator
 
Anders's Avatar
 
Join Date: Jun 2002
Location: ${NSISDIR}
Posts: 4,888
WaitForInputIdle is for application startup. After FindWindow you should probably check if the window is visible.

IntOp $PostCount $PostCount + 1
Anders is offline   Reply With Quote
Old 29th April 2018, 15:19   #5
r2du-soft
Senior Member
 
r2du-soft's Avatar
 
Join Date: Nov 2013
Location: Iran
Posts: 272
Question

Quote:
Originally Posted by Anders View Post
WaitForInputIdle is for application startup. After FindWindow you should probably check if the window is visible.
HTML Code:
FindWindow $1 "" "Internet Download Manager 6.30"
System::Call 'USER32::WaitForInputIdle(ir1,2000)i.r2'
its true?
r2du-soft is offline   Reply With Quote
Old 29th April 2018, 20:52   #6
Anders
Moderator
 
Anders's Avatar
 
Join Date: Jun 2002
Location: ${NSISDIR}
Posts: 4,888
No, don't use WaitForInputIdle if the application is a tray application. You need to check if the window is visible and/or positioned on screen.

IntOp $PostCount $PostCount + 1
Anders is offline   Reply With Quote
Old 30th April 2018, 10:24   #7
r2du-soft
Senior Member
 
r2du-soft's Avatar
 
Join Date: Nov 2013
Location: Iran
Posts: 272
thanks Mr Anders


Check IDM User Interface Visible or not Visible:
HTML Code:
FindWindow $1 "" "Internet Download Manager 6.30"
${If} $1 S!= "0"
		System::Call "user32::IsWindowVisible(i $1)i.r0"
		${If} $0 S== "1" 
			MessageBox MB_OK "User Interface In Visible(Shown)"
		${Else}
			MessageBox MB_OK "User Interface In Not Visible(Not Shown)"
		${EndIf}
${Else}
		MessageBox MB_OK "Internet Download Manager Not Found,Process Is Not Open."
${EndIf}


Check NOTEPAD User Interface Visible or not Visible:
HTML Code:
FindWindow $1 "Notepad" ""
${If} $1 S!= "0"
		System::Call "user32::IsWindowVisible(i $1)i.r0"
		${If} $0 S== "1" 
			MessageBox MB_OK "User Interface In Visible(Shown)"
		${Else}
			MessageBox MB_OK "User Interface In Not Visible(Not Shown)"
		${EndIf}
${Else}
		MessageBox MB_OK "Notepad Not Found,Process Is Not Open."
${EndIf}
r2du-soft is offline   Reply With Quote
Old 30th April 2018, 10:46   #8
Anders
Moderator
 
Anders's Avatar
 
Join Date: Jun 2002
Location: ${NSISDIR}
Posts: 4,888
A window handle is not a string, use <> and = when comparing with 0.

IntOp $PostCount $PostCount + 1
Anders is offline   Reply With Quote
Reply
Go Back   Winamp & SHOUTcast Forums > Developer Center > NSIS Discussion

Thread Tools Search this Thread
Search this Thread:

Advanced Search
Display Modes

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is On
HTML code is Off

Forum Jump