SpQueryDlgItemText

From EDM2
Revision as of 21:46, 26 February 2017 by Ak120 (Talk | contribs)

(diff) ← Older revision | Latest revision (diff) | Newer revision → (diff)
Jump to: navigation, search

This function queries a text string in a dialog item.

Syntax: text = spQueryDlgItemText ( hwnd , id )

Parameters:

 hwnd – The parent window handle. (Handle of the dialog owning the item to be queried.
 id – Identity of the child window whose text is to be queried.

Returns: The text string that is obtained from the dialog item.

Example Code:

/* findinf1.cmd (spUtils Example Code) */
/* Starts PMSEEK to find all *.INF files on the boot drive containing */
/* the String passed as argument and writes a summery of the results to */
/* stdout. */
CALL RXFUNCADD 'spLoadFuncs','spUtils','spLoadFuncs'
CALL spLoadFuncs
PARSE ARG searchstr
'START PMSEEK '||spGetBootdrive()||'*.INF '||searchstr
CALL spSleep 1000
hwnd=spFindWindowHandle(,,X2D('FA'),,,'PMSEEK.EXE')
IF hwnd=0 THEN DO
    SAY 'PMSeek window not found'
    RETURN
END
DO FOREVER
    text=spQueryDlgItemText(hwnd,X2D('3C'))
    IF LEFT(text,15)='Search Complete' THEN LEAVE
END
SAY text
SAY LEFT(,spQueryDlgItemTextLength(hwnd,X2D('3C')),'-')