MessageBoxInstrument

  • Thread starter Thread starter XPEte
  • Start date Start date
X

XPEte

Hi-

I have an XPE runtime image on a system that is required to boot without a
CMOS battery and without user input. I want to block/acknowledge the
"Invalid System Time" window that appears during/after boot because of the
former. Right now I am using the component "Message Box Default Reply" as
other methods I have found online do not seem to work. The problem with this
default reply is that it applies to all popups, some of which I want to
address but not in the default manner. I have found the link regarding
building Win32 services
(http://msdn2.microsoft.com/en-us/library/ms940840.aspx) and this link
references an example "...MessageBoxInstrument.c and MessageBoxInstrument.h
files exists in the Samples\MBI folder of your installation media" but I can
not find this file anywhere. Does anyone know where it is or better yet, how
I can simply have my RTI block/acknowledge ONLY the "Invalid System Time"
window (or maybe only SYSTEM popups)?

Thanks
 
Since you are talking about a particular window you can simple write an app
(and launch it during the boot after you suspect the error message appears).
The app just have to search the system for the message box window by the
name (window title, use FindWindow[Ex] API, or EnumWindows API but you don't
have to use EnumWindows since it is going to be a top level window) and send
WM_CLOSE message to the found window (use SendMessageTimeout API).

Also, if you device is network connected, you can play with the Time Server
Service settings or use tm.exe utility to have the time updated even if RTC
is not there.
 
Thanks KM for your reply. Since I am a novice, I have never written an app.
The best way for me to learn is by example. Is there an example of how to do
this? (This is why I was looking for MessageBoxInstrument.c, .h as I thought
that they were exampls of how to do just what you are saying. But I can not
find these files in my XPE installation package.)

Pete


KM said:
Since you are talking about a particular window you can simple write an app
(and launch it during the boot after you suspect the error message appears).
The app just have to search the system for the message box window by the
name (window title, use FindWindow[Ex] API, or EnumWindows API but you don't
have to use EnumWindows since it is going to be a top level window) and send
WM_CLOSE message to the found window (use SendMessageTimeout API).

Also, if you device is network connected, you can play with the Time Server
Service settings or use tm.exe utility to have the time updated even if RTC
is not there.

--
=========
Regards,
KM

Hi-

I have an XPE runtime image on a system that is required to boot without
a
CMOS battery and without user input. I want to block/acknowledge the
"Invalid System Time" window that appears during/after boot because of the
former. Right now I am using the component "Message Box Default Reply" as
other methods I have found online do not seem to work. The problem with
this
default reply is that it applies to all popups, some of which I want to
address but not in the default manner. I have found the link regarding
building Win32 services
(http://msdn2.microsoft.com/en-us/library/ms940840.aspx) and this link
references an example "...MessageBoxInstrument.c and
MessageBoxInstrument.h
files exists in the Samples\MBI folder of your installation media" but I
can
not find this file anywhere. Does anyone know where it is or better yet,
how
I can simply have my RTI block/acknowledge ONLY the "Invalid System Time"
window (or maybe only SYSTEM popups)?

Thanks
 
Pete,

How about this:
HWND hWin = FindWindow(NULL, "Invalid System Time");
PostMessage(hWin, WM_CLOSE, (LPARAM)0,(WPARAM)0); // or use SendMessageTimeout API here

As I already mentioned , you can alwso implement that using EnumWindows API.

The MBI sample should be there in non-eval XPe distr.


--
=========
Regards,
KM
Thanks KM for your reply. Since I am a novice, I have never written an app.
The best way for me to learn is by example. Is there an example of how to do
this? (This is why I was looking for MessageBoxInstrument.c, .h as I thought
that they were exampls of how to do just what you are saying. But I can not
find these files in my XPE installation package.)

Pete


KM said:
Since you are talking about a particular window you can simple write an app
(and launch it during the boot after you suspect the error message appears).
The app just have to search the system for the message box window by the
name (window title, use FindWindow[Ex] API, or EnumWindows API but you don't
have to use EnumWindows since it is going to be a top level window) and send
WM_CLOSE message to the found window (use SendMessageTimeout API).

Also, if you device is network connected, you can play with the Time Server
Service settings or use tm.exe utility to have the time updated even if RTC
is not there.

--
=========
Regards,
KM

Hi-

I have an XPE runtime image on a system that is required to boot without
a
CMOS battery and without user input. I want to block/acknowledge the
"Invalid System Time" window that appears during/after boot because of the
former. Right now I am using the component "Message Box Default Reply" as
other methods I have found online do not seem to work. The problem with
this
default reply is that it applies to all popups, some of which I want to
address but not in the default manner. I have found the link regarding
building Win32 services
(http://msdn2.microsoft.com/en-us/library/ms940840.aspx) and this link
references an example "...MessageBoxInstrument.c and
MessageBoxInstrument.h
files exists in the Samples\MBI folder of your installation media" but I
can
not find this file anywhere. Does anyone know where it is or better yet,
how
I can simply have my RTI block/acknowledge ONLY the "Invalid System Time"
window (or maybe only SYSTEM popups)?

Thanks
 
OK Thanks KM, will try this out!
Cheers,
Pete

KM said:
Pete,

How about this:
HWND hWin = FindWindow(NULL, "Invalid System Time");
PostMessage(hWin, WM_CLOSE, (LPARAM)0,(WPARAM)0); // or use SendMessageTimeout API here

As I already mentioned , you can alwso implement that using EnumWindows API.

The MBI sample should be there in non-eval XPe distr.


--
=========
Regards,
KM
Thanks KM for your reply. Since I am a novice, I have never written an app.
The best way for me to learn is by example. Is there an example of how to do
this? (This is why I was looking for MessageBoxInstrument.c, .h as I thought
that they were exampls of how to do just what you are saying. But I can not
find these files in my XPE installation package.)

Pete


KM said:
Since you are talking about a particular window you can simple write an app
(and launch it during the boot after you suspect the error message appears).
The app just have to search the system for the message box window by the
name (window title, use FindWindow[Ex] API, or EnumWindows API but you don't
have to use EnumWindows since it is going to be a top level window) and send
WM_CLOSE message to the found window (use SendMessageTimeout API).

Also, if you device is network connected, you can play with the Time Server
Service settings or use tm.exe utility to have the time updated even if RTC
is not there.

--
=========
Regards,
KM


Hi-

I have an XPE runtime image on a system that is required to boot without
a
CMOS battery and without user input. I want to block/acknowledge the
"Invalid System Time" window that appears during/after boot because of the
former. Right now I am using the component "Message Box Default Reply" as
other methods I have found online do not seem to work. The problem with
this
default reply is that it applies to all popups, some of which I want to
address but not in the default manner. I have found the link regarding
building Win32 services
(http://msdn2.microsoft.com/en-us/library/ms940840.aspx) and this link
references an example "...MessageBoxInstrument.c and
MessageBoxInstrument.h
files exists in the Samples\MBI folder of your installation media" but I
can
not find this file anywhere. Does anyone know where it is or better yet,
how
I can simply have my RTI block/acknowledge ONLY the "Invalid System Time"
window (or maybe only SYSTEM popups)?

Thanks
 
Back
Top