| 1 | /* $Id: msgbox.cpp,v 1.4 1999-10-10 08:59:40 sandervl Exp $ */
|
|---|
| 2 | /*
|
|---|
| 3 | * Win32 message box function for OS/2
|
|---|
| 4 | *
|
|---|
| 5 | * Copyright 1999 Sander van Leeuwen
|
|---|
| 6 | *
|
|---|
| 7 | *
|
|---|
| 8 | * Project Odin Software License can be found in LICENSE.TXT
|
|---|
| 9 | *
|
|---|
| 10 | */
|
|---|
| 11 | #include <os2win.h>
|
|---|
| 12 | #include <misc.h>
|
|---|
| 13 | #include "win32wnd.h"
|
|---|
| 14 |
|
|---|
| 15 | /*****************************************************************************
|
|---|
| 16 | * Name : int WIN32API MessageBoxExA
|
|---|
| 17 | * Purpose : The MessageBoxEx function creates, displays, and operates a message box.
|
|---|
| 18 | * Parameters: HWND hWnd handle of owner window
|
|---|
| 19 | * LPCTSTR lpText address of text in message box
|
|---|
| 20 | * LPCTSTR lpCaption address of title of message box
|
|---|
| 21 | * UINT uType style of message box
|
|---|
| 22 | * WORD wLanguageId language identifier
|
|---|
| 23 | * Variables :
|
|---|
| 24 | * Result : If the function succeeds, the return value is a nonzero menu-item
|
|---|
| 25 | * value returned by the dialog box.
|
|---|
| 26 | * Remark :
|
|---|
| 27 | * Status : UNTESTED STUB
|
|---|
| 28 | *
|
|---|
| 29 | * Author : Patrick Haller [Thu, 1998/02/26 11:55]
|
|---|
| 30 | *****************************************************************************/
|
|---|
| 31 |
|
|---|
| 32 | int WIN32API MessageBoxExA(HWND hWnd,
|
|---|
| 33 | LPCTSTR lpText,
|
|---|
| 34 | LPCTSTR lpCaption,
|
|---|
| 35 | UINT uType,
|
|---|
| 36 | WORD wLanguageId)
|
|---|
| 37 | {
|
|---|
| 38 | dprintf(("USER32:MessageBoxExA (%08xh,%s,%s,%u,%08w) not implemented.\n",
|
|---|
| 39 | hWnd,
|
|---|
| 40 | lpText,
|
|---|
| 41 | lpCaption,
|
|---|
| 42 | uType,
|
|---|
| 43 | wLanguageId));
|
|---|
| 44 |
|
|---|
| 45 | return (MessageBoxA(hWnd,
|
|---|
| 46 | lpText,
|
|---|
| 47 | lpCaption,
|
|---|
| 48 | uType));
|
|---|
| 49 | }
|
|---|
| 50 |
|
|---|
| 51 |
|
|---|
| 52 | /*****************************************************************************
|
|---|
| 53 | * Name : int WIN32API MessageBoxExW
|
|---|
| 54 | * Purpose : The MessageBoxEx function creates, displays, and operates a message box.
|
|---|
| 55 | * Parameters: HWND hWnd handle of owner window
|
|---|
| 56 | * LPCTSTR lpText address of text in message box
|
|---|
| 57 | * LPCTSTR lpCaption address of title of message box
|
|---|
| 58 | * UINT uType style of message box
|
|---|
| 59 | * WORD wLanguageId language identifier
|
|---|
| 60 | * Variables :
|
|---|
| 61 | * Result : If the function succeeds, the return value is a nonzero menu-item
|
|---|
| 62 | * value returned by the dialog box.
|
|---|
| 63 | * Remark :
|
|---|
| 64 | * Status : UNTESTED STUB
|
|---|
| 65 | *
|
|---|
| 66 | * Author : Patrick Haller [Thu, 1998/02/26 11:55]
|
|---|
| 67 | *****************************************************************************/
|
|---|
| 68 |
|
|---|
| 69 | int WIN32API MessageBoxExW(HWND hWnd,
|
|---|
| 70 | LPCWSTR lpText,
|
|---|
| 71 | LPCWSTR lpCaption,
|
|---|
| 72 | UINT uType,
|
|---|
| 73 | WORD wLanguageId)
|
|---|
| 74 | {
|
|---|
| 75 |
|
|---|
| 76 | dprintf(("USER32:MessageBoxExW (%08xh,%x,%x,%u,%08w) not implemented.\n",
|
|---|
| 77 | hWnd,
|
|---|
| 78 | lpText,
|
|---|
| 79 | lpCaption,
|
|---|
| 80 | uType,
|
|---|
| 81 | wLanguageId));
|
|---|
| 82 |
|
|---|
| 83 | return MessageBoxW(hWnd, lpText, lpCaption, uType);
|
|---|
| 84 | }
|
|---|
| 85 |
|
|---|
| 86 |
|
|---|
| 87 | /*****************************************************************************
|
|---|
| 88 | * Name : BOOL WIN32API MessageBoxIndirectW
|
|---|
| 89 | * Purpose : The MessageBoxIndirect function creates, displays, and operates
|
|---|
| 90 | * a message box. The message box contains application-defined
|
|---|
| 91 | * message text and title, any icon, and any combination of
|
|---|
| 92 | * predefined push buttons.
|
|---|
| 93 | * Parameters:
|
|---|
| 94 | * Variables :
|
|---|
| 95 | * Result :
|
|---|
| 96 | * Remark :
|
|---|
| 97 | * Status : UNTESTED STUB
|
|---|
| 98 | *
|
|---|
| 99 | * Author : Patrick Haller [Thu, 1998/02/26 11:55]
|
|---|
| 100 | *****************************************************************************/
|
|---|
| 101 |
|
|---|
| 102 | // @@@PH Win32 BOOL's are casted to INTs
|
|---|
| 103 | INT WIN32API MessageBoxIndirectW(LPMSGBOXPARAMSW lpMsgBoxParams)
|
|---|
| 104 | {
|
|---|
| 105 | dprintf(("USER32:MessageBoxIndirectW (%08x) partially implemented.\n",
|
|---|
| 106 | lpMsgBoxParams));
|
|---|
| 107 |
|
|---|
| 108 | return (MessageBoxW(lpMsgBoxParams->hwndOwner,
|
|---|
| 109 | lpMsgBoxParams->lpszText,
|
|---|
| 110 | lpMsgBoxParams->lpszCaption,
|
|---|
| 111 | lpMsgBoxParams->dwStyle));
|
|---|
| 112 | }
|
|---|
| 113 |
|
|---|
| 114 |
|
|---|
| 115 | /*****************************************************************************
|
|---|
| 116 | * Name : BOOL WIN32API MessageBoxIndirectA
|
|---|
| 117 | * Purpose : The MessageBoxIndirect function creates, displays, and operates
|
|---|
| 118 | * a message box. The message box contains application-defined
|
|---|
| 119 | * message text and title, any icon, and any combination of
|
|---|
| 120 | * predefined push buttons.
|
|---|
| 121 | * Parameters:
|
|---|
| 122 | * Variables :
|
|---|
| 123 | * Result :
|
|---|
| 124 | * Remark :
|
|---|
| 125 | * Status : UNTESTED STUB
|
|---|
| 126 | *
|
|---|
| 127 | * Author : Patrick Haller [Thu, 1998/02/26 11:55]
|
|---|
| 128 | *****************************************************************************/
|
|---|
| 129 |
|
|---|
| 130 | // @@@PH Win32 BOOL's are casted to INTs
|
|---|
| 131 | INT WIN32API MessageBoxIndirectA(LPMSGBOXPARAMSA lpMsgBoxParams)
|
|---|
| 132 | {
|
|---|
| 133 | dprintf(("USER32:MessageBoxIndirectA (%08x) partially implemented.\n",
|
|---|
| 134 | lpMsgBoxParams));
|
|---|
| 135 |
|
|---|
| 136 | return (MessageBoxA(lpMsgBoxParams->hwndOwner,
|
|---|
| 137 | lpMsgBoxParams->lpszText,
|
|---|
| 138 | lpMsgBoxParams->lpszCaption,
|
|---|
| 139 | lpMsgBoxParams->dwStyle));
|
|---|
| 140 | }
|
|---|
| 141 | //******************************************************************************
|
|---|
| 142 | //******************************************************************************
|
|---|
| 143 | int WIN32API MessageBoxA(HWND hwndOwner, LPCTSTR lpszText, LPCTSTR lpszTitle, UINT fuStyle)
|
|---|
| 144 | {
|
|---|
| 145 | dprintf(("USER32: MessageBoxA %s %s\n", lpszText, lpszTitle));
|
|---|
| 146 | hwndOwner = Win32Window::Win32ToOS2Handle(hwndOwner);
|
|---|
| 147 | return(O32_MessageBox(hwndOwner, lpszText, lpszTitle, fuStyle));
|
|---|
| 148 | }
|
|---|
| 149 | //******************************************************************************
|
|---|
| 150 | //******************************************************************************
|
|---|
| 151 | int WIN32API MessageBoxW(HWND hwndOwner, LPCWSTR arg2, LPCWSTR arg3, UINT arg4)
|
|---|
| 152 | {
|
|---|
| 153 | char *astring1, *astring2;
|
|---|
| 154 | int rc;
|
|---|
| 155 |
|
|---|
| 156 | astring1 = UnicodeToAsciiString((LPWSTR)arg2);
|
|---|
| 157 | astring2 = UnicodeToAsciiString((LPWSTR)arg3);
|
|---|
| 158 | #ifdef DEBUG
|
|---|
| 159 | WriteLog("USER32: MessageBoxW %s %s\n", astring1, astring2);
|
|---|
| 160 | #endif
|
|---|
| 161 | hwndOwner = Win32Window::Win32ToOS2Handle(hwndOwner);
|
|---|
| 162 | rc = O32_MessageBox(hwndOwner, astring1, astring2, arg4);
|
|---|
| 163 | FreeAsciiString(astring1);
|
|---|
| 164 | FreeAsciiString(astring2);
|
|---|
| 165 | return(rc);
|
|---|
| 166 | }
|
|---|
| 167 | /*****************************************************************************
|
|---|
| 168 | * Name : BOOL WIN32API SysErrorBox
|
|---|
| 169 | * Purpose : Unknown
|
|---|
| 170 | * Parameters: Unknown
|
|---|
| 171 | * Variables :
|
|---|
| 172 | * Result :
|
|---|
| 173 | * Remark : HARDERR like ?
|
|---|
| 174 | * Status : UNTESTED UNKNOWN STUB
|
|---|
| 175 | *
|
|---|
| 176 | * Author : Patrick Haller [Wed, 1998/06/16 11:55]
|
|---|
| 177 | *****************************************************************************/
|
|---|
| 178 |
|
|---|
| 179 | BOOL WIN32API SysErrorBox(DWORD x1,
|
|---|
| 180 | DWORD x2,
|
|---|
| 181 | DWORD x3)
|
|---|
| 182 | {
|
|---|
| 183 | dprintf(("USER32: SysErrorBox(%08xh,%08xh,%08xh) not implemented.\n",
|
|---|
| 184 | x1,
|
|---|
| 185 | x2,
|
|---|
| 186 | x3));
|
|---|
| 187 |
|
|---|
| 188 | return (FALSE); /* default */
|
|---|
| 189 | }
|
|---|