Thread Rating:
  • 0 Vote(s) - 0 Average
  • 1
  • 2
  • 3
  • 4
  • 5
Waiting for the hidden program to exit
#1
Hello everyone, I want to wait for the hidden running program to quit unexpectedly, then pop-up prompt message "mspaint Has exited", Because the window is hidden, I can only rely on the program name, but I don't know how to set the wait dialog. the following code can not run successfully

I hope someone can help me think some methods, thanks in advance


Macro Macro4
Code:
Copy      Help
run "$system$\mspaint.exe" "" "" "" 16
mes "mspaint is Hidden running"
rep
,int w=wait(0 WP win("" "" "mspaint"))
,if w=0
,,mes "mspaint Has exited"
,,ret

I used the following code to run successfully, but I still want to know the above code, how to modify it can also run successfully. Exclamation

I think the problem is here (int w=wait(0 WP win("" "" "mspaint"))), but I don't know how to modify it.



Macro Macro4
Code:
Copy      Help
__Handle h=run("$system$\mspaint.exe" "" "" "" 16)
mes "mspaint is Hidden running"
wait 0 H h
mes "mspaint Has exited"


Attached Files Image(s)
   
#2
The following waiting program code, when the program is running, the QM dialog box will lose response, when the program is finished, it will display normal. Is there any good way to keep the dialog box normal? thank you very much Heart




Macro Ghost Backup
Code:
Copy      Help
str dd=
;BEGIN DIALOG
;0 "" 0x90C80AC8 0x8 0 0 346 242 "Ghost Backup"
;3 Button 0x54032000 0x0 116 92 124 42 "Backup"
;END DIALOG
;DIALOG EDITOR: "" 0x2040700 "*" "" "" ""

if(!ShowDialog(dd &sub.DlgProc 0)) ret


#sub DlgProc
function# hDlg message wParam lParam

sel message
,case WM_INITDIALOG
,case WM_DESTROY
,case WM_COMMAND goto messages2
ret
;messages2
sel wParam
,case IDOK
,case IDCANCEL
,case 3 ;;Backup
,int exitCode1=run("$qm$\Ghost64.exe" "-clone,mode=pdump,src=1:1,dst=E:\Back.GHO -z9 -sure" "" "" 16|0x400); err
,mes "Backup is ok"
ret 1

The following two methods of waiting for the program to exit

Will make the QM dialog box unresponsive

_____________________________________________________________________

__Handle h=run("$system$\mspaint.exe" "" "" "" 16)
mes "mspaint is Hidden running"
wait 0 H h
_____________________________________________________________________

int exitCode1=run("$qm$\Ghost64.exe" "-clone,mode=pdump,src=1:1,dst=E:\Back.GHO -z9 -sure" "" "" 16|0x400); err
#3
if at all possible try and not use wait in a dialog if you must then need to add opt waitmsg 1 before wait 




Code:
Copy      Help
case 3 ;;Backup
opt waitmsg 1
,int exitCode1=run("$qm$\Ghost64.exe" "-clone,mode=pdump,src=1:1,dst=E:\Back.GHO -z9 -sure" "" "" 16|0x400); err
#4
@kevin

Thank you very much for your reply, I will test the effect right away.

The code waiting for the program, the test is successful.

I have a small problem,

I click on the title of the QM dialog on the taskbar, it can't be minimized, always displayed on the desktop, why?



Macro Ghost Backup
Code:
Copy      Help
str dd=
;BEGIN DIALOG
;0 "" 0x90C80AC8 0x8 0 0 346 242 "Ghost Backup"
;3 Button 0x54032000 0x0 116 92 124 42 "Backup"
;END DIALOG
;DIALOG EDITOR: "" 0x2040700 "*" "" "" ""

if(!ShowDialog(dd &sub.DlgProc 0)) ret


#sub DlgProc
function# hDlg message wParam lParam

sel message
,case WM_INITDIALOG
,case WM_DESTROY
,case WM_COMMAND goto messages2
ret
;messages2
sel wParam
,case IDOK
,case IDCANCEL
,case 3 ;;Backup
,opt waitmsg 1
,int exitCode1=run("$qm$\Ghost64.exe" "-clone,mode=pdump,src=1:1,dst=E:\Back.GHO -z9 -sure" "" "" 16|0x400); err
,mes "Backup is ok"
ret 1
#5
you forgot to add the minimize button to the title bar
open the dialog editor  make sure the title bar is selected 
click the styles icon 
on the styles window click
click WS_MINIMIZEBOX
the click ok on that window
then click save on the dialog editor window then close dialog editor and run dialog will be able to minimize then
#6
Thank you for your reminder,  Heart


Forum Jump:


Users browsing this thread: 1 Guest(s)