I commonly use the following code to disable to the current program and dialog while calling another program to look something up and return a value to the calling program.
Problem is that most computers will dutifully cause the calling program to receive full focus while others do not whether or not some other program is running on the desktop.
Not shown is the attempt to use SetForeGroundWindow api function with the handle of the dialog. I've also tried SetFocus hdlg where hdlg is the window handle of the dialog that needs to be fully focused. The taskbar item seems to actually have the focus even though the program is the only one on the screen.
Any help with forcing the program I want to always have the foreground focus would be helpful.
BOB MECHLER
Problem is that most computers will dutifully cause the calling program to receive full focus while others do not whether or not some other program is running on the desktop.
Not shown is the attempt to use SetForeGroundWindow api function with the handle of the dialog. I've also tried SetFocus hdlg where hdlg is the window handle of the dialog that needs to be fully focused. The taskbar item seems to actually have the focus even though the program is the only one on the screen.
Any help with forcing the program I want to always have the foreground focus would be helpful.
Code:
' 'Call party lookup program ' LSET C.INQ = "": SPARE$ = CPROGID$: LSET C.SPARE = SPARE$: C.LSPARE = LEN(SPARE$)': @pC = C PU_PROG$ = CPROGID$: LSET C.PU_PROG = PU_PROG$: @pC = C IF FNSP(CUST_DIR$) THEN SHELLPROG$ = "PUPARTY.EXE " ELSE SHELLPROG$ = $STDEXE + "PUPARTY.EXE " END IF DIALOG DISABLE hdlg Yinstance& = SHELL(SHELLPROG$ + COMMONLINK$) SLEEP 1000 Zprocessid& = OpenProcess(%PROCESS_QUERY_INFORMATION + %PROCESS_TERMINATE,%False,Yinstance&) DO DIALOG DOEVENTS I& = GetExitCodeProcess(BYVAL Zprocessid&,lpExitCode&) LOOP WHILE lpExitCode& = %STILL_ACTIVE DIALOG ENABLE hdlg DIALOG SHOW STATE hdlg,%SW_SHOWNORMAL stat = GetCommon(C) INQPARTY$ = RTRIM$(INQ$) VKEY = 0 RETURN
Comment