3 #include <winpr/error.h>
4 #include <winpr/wtsapi.h>
5 #include <winpr/user.h>
7 #define TITLE "thats the title"
8 #define MESSAGE "thats the message"
10 int TestWtsApiExtraSendMessage(
int argc,
char* argv[])
15 HANDLE hServer = WTS_CURRENT_SERVER_HANDLE;
17 BOOL bSuccess = WTSSendMessageA(hServer, WTS_CURRENT_SESSION, TITLE, strlen(TITLE) + 1, MESSAGE,
18 strlen(MESSAGE) + 1, MB_CANCELTRYCONTINUE, 3, &result, TRUE);
22 printf(
"WTSSendMessage failed: %" PRIu32
"\n", GetLastError());
26 printf(
"WTSSendMessage got result: %" PRIu32
"\n", result);