Using Win32 functions in Visual FoxPro Image Gallery
Terminal Services
..msdn
WTSCloseServer
WTSEnumerateProcesses
WTSEnumerateServers
WTSEnumerateSessions
WTSFreeMemory
WTSOpenServer
WTSQuerySessionInformation
WTSRegisterSessionNotification
WTSSendMessage
WTSUnRegisterSessionNotification
Code examples:
WTSSendMessage
..msdn    Add comment     W32 Constants      Translate this page
Displays a message box on the client desktop of a specified Terminal Services session.
Code examples:
Declaration:
BOOL WTSSendMessage(
    HANDLE hServer,
    DWORD SessionId,
    LPTSTR pTitle,
    DWORD TitleLength,
    LPTSTR pMessage,
    DWORD MessageLength,
    DWORD Style,
    DWORD Timeout,
    DWORD* pResponse,
    BOOL bWait
);
FoxPro declaration:
DECLARE INTEGER WTSSendMessage IN WtsApi32;
    INTEGER hServer,;
    LONG SessionId,;
    STRING @pTitle,;
    LONG TitleLength,;
    STRING @pMessage,;
    LONG MessageLength,;
    LONG MsgStyle,;
    LONG MsgTimeout,;
    LONG @pResponse,;
    INTEGER bWait
Parameters:
hServer
[in] Handle to a terminal server. Specify a handle opened by the WTSOpenServer function, or specify WTS_CURRENT_SERVER_HANDLE to indicate the terminal server on which your application is running.

SessionId
[in] A Terminal Services session identifier. To indicate the current session, specify WTS_CURRENT_SESSION.

pTitle
[in] Pointer to a null-terminated string for the title bar of the message box.

TitleLength
[in] Specifies the length, in bytes, of the title bar string.

pMessage
[in] Pointer to a null-terminated string containing the message to display.

MessageLength
[in] Specifies the length, in bytes, of the message string.

Style
[in] Specifies the contents and behavior of the message box.

Timeout
[in] Specifies the time, in seconds, that the WTSSendMessage function waits for the user"s response.

pResponse
[out] Pointer to a variable that receives the user"s response.

bWait
[in] If TRUE, WTSSendMessage does not return until the user responds or the time-out interval elapses. If the Timeout parameter is zero, the function does not return until the user responds.
Return value:
If the function succeeds, the return value is a nonzero value.
My comment:
#DEFINE WTS_CURRENT_SERVER_HANDLE 0

LOCAL cTitle, cMsg, nResponse
cTitle = "Test Message"
cMsg = "This is a test message. Please do not reply."
nResponse = 0

? WTSSendMessage(hServer, 0,;
        @cTitle, LEN(cTitle),;
        @cMsg, LEN(m.cMsg), 0, 15, @nResponse, 1)
Word Index links for the WTSSendMessage :
Translate this page:
  Spanish    Portuguese    German    French    Italian  
FreeTranslation.com offers instant, free translations of text or web pages.
Created: 2007-01-05 18:47:47
Modified: 2007-01-05 18:54:53
Visited in last 7 days: 10
User Contributed Notes:
There are no notes on this subject.


Copyright 2001-2017 News2News, Inc. Before reproducing or distributing any data from this site please ask for an approval from its owner. Unless otherwise specified, this page is for your personal and non-commercial use. The information on this page is presented AS IS, meaning that you may use it at your own risk. Microsoft Visual FoxPro and Windows are trade marks of Microsoft Corp. All other trademarks are the property of their respective owners. 

Privacy policy
Credits: PHP (4.4.9), an HTML-embedded scripting language, MySQL (5.6.37), the Open Source standard SQL database, AceHTML Freeware Version 4, freeware HTML Editor of choice.   Hosted by Korax Online Inc.
Last Topics Visited (54.167.250.64)
4 sec.Function: 'SCardListCards'
8 sec.Function: 'EnumDeviceDrivers'
13 sec.Function: 'mixerSetControlDetails'
16 sec.Function: 'CeRegDeleteKey'
20 sec.Function: 'ReportEvent'
24 sec.Function: 'ws_select'
28 sec.Function: 'FindWindow'
33 sec.Function: 'LoadResource'
37 sec.Function: 'CryptBinaryToString'
41 sec.Function: 'GetDlgItem'
Google
Advertise here!