Level Extreme platform
Subscription
Corporate profile
Products & Services
Support
Legal
Français
Programmatically keep a session from idling
Message
From
23/01/2008 23:35:51
Suhas Hegde
Dental Surgeon
Sirsi, India
 
General information
Forum:
Visual FoxPro
Category:
Coding, syntax & commands
Miscellaneous
Thread ID:
01284395
Message ID:
01284846
Views:
20
>I have a terminal server in which the idle session timeout is set to 2 hours. I want it this way with one exception. I have one terminal that runs an automated process every 5 minutes. I do not want this to run on the console. It is a Fox Pro form with a timer and every 5 minutes it connects to a remote server and retrieves some information from another Sql Server. Currently a user has to move the mouse every so often to keep it from timing out. Is there a Fox Pro command, or some way within a FoxPro form to keep a terminal services session from going idle? I have tried the KEYBOARD command, and have also used ...
>
>DECLARE integer SetCursorPos in WIN32API integer, integer
>=SetCursorPos(600,400)
>CLEAR DLLS
>
>to move the mouse around and it still goes idle. Any ideas are greatly appreciated.


Try to Feed a char to form programatically like the user typed
#define KEYEVENTF_KEYUP  2
#define KEYEVENTF_EXTENDEDKEY  1 
#define Akey  0x41
#define Bkey  0x42
#define Ckey  0x43
#define Dkey  0x44
#define Ekey  0x45
#define Fkey  0x46
#define Gkey  0x47
#define Hkey  0x48
#define Ikey  0x49
#define Jkey  0x4A
#define Kkey  0x4B
#define Lkey  0x4C
#define Mkey  0x4D
#define Nkey  0x4E
#define Okey  0x4F
#define Pkey  0x50
#define Qkey  0x51
#define Rkey  0x52
#define Skey  0x53
#define Tkey  0x54
#define Ukey  0x55
#define Vkey  0x56
#define Wkey  0x57
#define Xkey  0x58
#define Ykey  0x59
#define Zkey  0x5a

DECLARE INTEGER keybd_event IN Win32API ;
      INTEGER, INTEGER, INTEGER, INTEGER
      
keybd_event( FKEY,    0, KEYEVENTF_EXTENDEDKEY , 0 ) && F key down
keybd_event( FKEY,    0, KEYEVENTF_EXTENDEDKEY+KEYEVENTF_KEYUP, 0 ) && F key up
Suhashegde
Previous
Reply
Map
View

Click here to load this message in the networking platform