SpSetDlgItemText

From EDM2
Jump to: navigation, search

This function sets a text string in a dialog item. Afterwards the text string of the dialog item is queried and returned.

Syntax: txt = spSetDlgItemText ( hwnd , id , text )

Parameters:

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

Returns:

True (1) - Successful completion.
False (0) - Error occurred.

Example Code:

/* findinf.cmd (spUtils Example Code) */
/* Starts PMSEEK to find all *.INF files on the boot drive containing */
/* the String passed as argument and sets VIEW.EXE as editor. */
 
CALL RXFUNCADD 'spLoadFuncs','spUtils','spLoadFuncs'
CALL spLoadFuncs

PARSE ARG searchstr
filemask=spGetBootdrive()||'*.INF'

CALL spSetAutoSleep 1000

'START PMSEEK 'filemask' 'searchstr

DO i=1 TO 2
     IF \spFindWindowHandles('hwnd',,,X2D('FA'),,,) THEN ITERATE
     DO j=1 TO hwnd.0
           hwndInput=spWindowFromId(hwnd.j,X2D('64'))
           IF hwndInput=0 THEN ITERATE
           IF spQueryWindowText(hwndInput)=filemask THEN DO
                 CALL spSetDlgItemText hwnd.j,X2D('6E'),'VIEW.EXE'
                 RETURN
           END
     END
END
SAY 'PMSEEK window not found'