SK.AppActivate

Previous  Next

 

result = SK.AppActivate( WinTitle AS STRING ) AS INTEGER

result = SK.AppActivate( hWnd AS HANDLE ) AS INTEGER

 


 

Activates the specified Applications Window by using either the title of the window or a window handle.  Returns 1 (TRUE) if successful otherwise 0 (FALSE).

 

See SK.SendKeys for more detailed explanation.

 

Example:

 

' Start Notepad and insert "hello world"

SK.SendKeys( "{DELAY=50}@rnotepad~hello world%ha" )

 

' Activate Window with title SendKeys

SK.AppActivate( "SendKeys" )

 

' Send Tools->Options to the Explorer Window SendKeys

SK.SendKeys( "{DELAY=50}%to{DELAY=2000}{ENTER}" )

 

' Set new default delay 100 ms

SK.SetDelay( 100 )

 

' Send Edit->Select All to Explorer Window SendKeys

SK.SendKeys( "{DELAY}%ea" )

 

' Scroll through the Keyboard LEDs 5 times

FOR i = 1 TO 5

  SK.SendKeys( "{DELAY=500}{NUMLOCK}{CAPSLOCK}{SCROLL}{SCROLL}{CAPSLOCK}{NUMLOCK}" )

ENDFOR