Message boxes differ in Windows Vista and in Windows XP, although you use the same code to generate the message boxes

This article has been archived. It is offered "as is" and will no longer be updated.
Symptoms
Message boxes differ in Windows Vista and in Microsoft Windows XP, although you use the same code to generate the message boxes.

For example, when you use the following code sample to generate the same message box in Windows Vista and in Windows XP, the text in the message box wraps in Windows Vista. However, the text does not wrap in Windows XP. Also, the buttons in the message box are right justified in Windows Vista. The buttons are centered in Windows XP.
#include <windows.h>//#include <afx.h>int WINAPI WinMain(HINSTANCE hlnstance, HINSTANCE hPrevInstance,PSTR szcmdline, int iCmdShow){MessageBox(NULL, TEXT("Hello! This is a MessageBox test! Hello! This is a MessageBox test! Hello! This is a MessageBox test!"), TEXT("MessageBox test"),MB_ICONEXCLAMATION|MB_YESNO);return 0;}
Properties

Article ID: 936852 - Last Review: 01/16/2015 17:16:31 - Revision: 2.0

  • Windows Vista Ultimate
  • Windows Vista Enterprise
  • Windows Vista Business
  • Windows Vista Home Premium
  • Windows Vista Home Basic
  • Windows Vista Starter
  • Windows Vista Ultimate 64-bit Edition
  • Windows Vista Enterprise 64-bit Edition
  • Windows Vista Business 64-bit Edition
  • Windows Vista Home Premium 64-bit Edition
  • kbnosurvey kbarchive kbtshoot kbexpertiseinter KB936852
Feedback