Currently viewing: GipsySoft » Front Page» Articles

GSMessageBox - Absolute position

The code

GSMSGBOX msg = { 0 };
	msg.cbSize = sizeof( msg );
	msg.uFlags = GS_MSGBOX_SET_POS;
	msg.pt.x = 100;
	msg.pt.y = 100;
 	(void)GSMessageBox( NULL
			, _T("Set the absolute position of the message box")
			, _T("Caption")
			, MB_OKCANCEL
			, &msg );

Notes

All we do is declare an appropriate structure, set some values and then call the API.

  • If the point given is outside the visible display area, or part of the resulting message box would be then the position is altered to ensure the entire dialog is displayed.