MessageBox from a service ...
-
Hi all, How to show a message box from a windows service ? Any tips, pointers, links ? Thanks in advance ~ Vimal
-
Hi all, How to show a message box from a windows service ? Any tips, pointers, links ? Thanks in advance ~ Vimal
-
Thanks. :) Though the MB_SERVICE_NOTIFICATION flag is specified in the MSDN, the complier gives an "undeclared identifier" error on my windows 2000 machine :~ . But MB_DEFAULT_DESKTOP_ONLY does the trick. ~ Vimal
-
Thanks. :) Though the MB_SERVICE_NOTIFICATION flag is specified in the MSDN, the complier gives an "undeclared identifier" error on my windows 2000 machine :~ . But MB_DEFAULT_DESKTOP_ONLY does the trick. ~ Vimal
Well, I think, that
MB_SERVICE_NOTIFICATION
have a little bit better behavior ;). Reason for "undeclared identifier" - you probably didn't set the windows version macros. Just simply put following snippet before you will include <windows.h> header (usually included in stdafx.h)// Allow use of features specific to Windows 95 and Windows NT 4 or later. #ifndef WINVER #define WINVER 0x0400 #endif // Allow use of features specific to Windows NT 4 or later. #ifndef _WIN32_WINNT #define _WIN32_WINNT 0x0400 #endif // Allow use of features specific to Windows 98 or later. #ifndef _WIN32_WINDOWS #define _WIN32_WINDOWS 0x0410 #endif // Allow use of features specific to IE 4.0 or later. #ifndef _WIN32_IE #define _WIN32_IE 0x0400 #endif
-
Well, I think, that
MB_SERVICE_NOTIFICATION
have a little bit better behavior ;). Reason for "undeclared identifier" - you probably didn't set the windows version macros. Just simply put following snippet before you will include <windows.h> header (usually included in stdafx.h)// Allow use of features specific to Windows 95 and Windows NT 4 or later. #ifndef WINVER #define WINVER 0x0400 #endif // Allow use of features specific to Windows NT 4 or later. #ifndef _WIN32_WINNT #define _WIN32_WINNT 0x0400 #endif // Allow use of features specific to Windows 98 or later. #ifndef _WIN32_WINDOWS #define _WIN32_WINDOWS 0x0410 #endif // Allow use of features specific to IE 4.0 or later. #ifndef _WIN32_IE #define _WIN32_IE 0x0400 #endif
Thanks again. True I didn't set the version macros.I compiled the code after including the _WIN32_WINNT macro and MB_SERVICE_NOTIFICATION works fine. :-D ~ Vimal
-
Hi all, How to show a message box from a windows service ? Any tips, pointers, links ? Thanks in advance ~ Vimal
You should use SERVICE_INTERACTIVE_PROCESS in dwServiceType while creating the service (In CreateService()). (You can use also do this manually by going to services window and changing to property of the service and checking "Allow service to interact with desktop" under Log On As group. Praveen