|
Hi,
Tips about a problem with "run" function in PB10.5. When we use this function to call an external program, it runs the external program, but does not wait for the external program to end -THE FOCUS DOES NOT STAY ON THE EXTERNAL APPLICATION BUT GOES BACK TO THE CALLER APPLICATION. There is a way to make make the focus stay on the external application. The same works fine in PB7. we can use
this:
//structure $PBExportHeader$s_shellexecuteinfo.srs global type s_shellexecuteinfo from structure long l_cbSize long l_fMask long l_hwnd string s_lpVerb string s_lpFile string s_lpParameters string s_lpDirectory long l_nShow long l_hInstApp long l_lpIDList string s_lpClass long l_hkeyClass long l_dwHotKey long l_hIcon long l_hProcess end type //external functions Function boolean ShellExecuteEx(ref s_shellexecuteinfo hwnd) Library "shell32.dll" Alias for "ShellExecuteExA" Function Long WaitforSingleObject(Long hObject,ULong dwTimeout) Library 'Kernel32.dll' Alias For 'WaitForSingleObject' //code Constant ULong SEE_MASK_NOCLOSEPROCESS=64 //0x40 Constant ULong SEE_MASK_FLAG_DDEWAIT=256 //0x100 Constant ULong INFINITE=4294967295 //0xFFFFFFFF Constant ULong SW_SHOWNORMAL=1 s_shellexecuteinfo lsei_info lsei_info.l_cbsize=60 lsei_info.l_fMask=SEE_MASK_NOCLOSEPROCESS+SEE_MASK_FLAG_DDEWAIT lsei_info.l_hWnd=handle(this) lsei_info.s_lpVerb='open' lsei_info.s_lpFile=ls_name lsei_info.l_nShow=SW_SHOWNORMAL; if ShellExecuteEx(lsei_info) then WaitForSingleObject(lsei_info.l_hProcess,INFINITE) end if cheers,
untung d.s.
----- Original Message ----- __._,_.___ ----------------------------------------------- IndoPB - Indonesia PB User Group An Indonesian PowerBuilder User Group's Event 2nd PowerBuilder Update Mezzanine Floor Hotel Ibis Slipi 26/27 August 2006 To Register : http://groups.yahoo.com/group/indopb/database?method=addRecord&tbl=4
SPONSORED LINKS
YAHOO! GROUPS LINKS
|
- [indopb] Tanya close program hery purwoko
- [indopb] Tanya close program hery purwoko
- RE: [indopb] Tanya close program Adhitya
- Re: [indopb] Tanya close program hery purwoko
- Re: [indopb] Tanya close program Technetindo Utama, PT.
