F_CALL_CALCULATOR_AND_SENDKEYS

// Function Name : f_call_calculator_and_sendkeys
// Argument Name : (None)
// Return Type :       (None)

Integer li_connect
OleObject ole_wsh

ole_wsh = Create OleObject

li_connect = ole_wsh.ConnectToNewObject("WScript.Shell")

ole_wsh.Run("calc")
ole_wsh.AppActivate("Calculator", 100)
Sleep(1000)
ole_wsh.SendKeys("3{-}")
Sleep(1000)
ole_wsh.SendKeys("1")
Sleep(1000)
ole_wsh.SendKeys("=")
Sleep(1000)
ole_wsh.SendKeys("*4")
Sleep(1000)
ole_wsh.SendKeys("=")
// 3 - 1 = 2 Then * 4 = 8

1 comments:

Prashant Nirgun said...

i run programe through powerbuilder 9 it get haulted when i try to close calculator

Post a Comment