mirror of
https://github.com/reactos/reactos.git
synced 2025-07-31 10:31:43 +00:00
[USER32] Code formatting/indentation fixes only.
This commit is contained in:
parent
729d6e7981
commit
5e4b3c7cf0
1 changed files with 281 additions and 270 deletions
|
@ -98,7 +98,6 @@ static const MSGBTNINFO MsgBtnInfo[] =
|
|||
DECLARE_MB_3(CANCEL, TRYAGAIN, CONTINUE)
|
||||
};
|
||||
|
||||
|
||||
typedef struct _MSGBOXINFO
|
||||
{
|
||||
MSGBOXPARAMSW; // Wine passes this too.
|
||||
|
@ -217,22 +216,25 @@ static VOID MessageBoxTextToClipboard(HWND DialogWindow)
|
|||
RtlFreeHeap(GetProcessHeap(), 0, pMessageBoxText);
|
||||
}
|
||||
|
||||
static INT_PTR CALLBACK MessageBoxProc( HWND hwnd, UINT message,
|
||||
WPARAM wParam, LPARAM lParam )
|
||||
static INT_PTR CALLBACK MessageBoxProc(
|
||||
HWND hwnd, UINT message,
|
||||
WPARAM wParam, LPARAM lParam)
|
||||
{
|
||||
int i, Alert;
|
||||
PMSGBOXINFO mbi;
|
||||
HELPINFO hi;
|
||||
HWND owner;
|
||||
|
||||
switch(message) {
|
||||
switch (message)
|
||||
{
|
||||
case WM_INITDIALOG:
|
||||
{
|
||||
mbi = (PMSGBOXINFO)lParam;
|
||||
|
||||
SetWindowLongPtrW(hwnd, GWLP_USERDATA, (LONG_PTR)mbi);
|
||||
NtUserxSetMessageBox(hwnd);
|
||||
|
||||
if(!GetPropW(hwnd, L"ROS_MSGBOX"))
|
||||
if (!GetPropW(hwnd, L"ROS_MSGBOX"))
|
||||
{
|
||||
SetPropW(hwnd, L"ROS_MSGBOX", (HANDLE)lParam);
|
||||
|
||||
|
@ -246,7 +248,7 @@ static INT_PTR CALLBACK MessageBoxProc( HWND hwnd, UINT message,
|
|||
}
|
||||
else // Setup the rest of the alerts.
|
||||
{
|
||||
switch(mbi->dwStyle & MB_ICONMASK)
|
||||
switch (mbi->dwStyle & MB_ICONMASK)
|
||||
{
|
||||
case MB_ICONWARNING:
|
||||
Alert = ALERT_SYSTEM_WARNING;
|
||||
|
@ -267,11 +269,11 @@ static INT_PTR CALLBACK MessageBoxProc( HWND hwnd, UINT message,
|
|||
|
||||
/* set control fonts */
|
||||
SendDlgItemMessageW(hwnd, MSGBOX_IDTEXT, WM_SETFONT, (WPARAM)mbi->Font, 0);
|
||||
for(i = 0; i < mbi->nButtons; i++)
|
||||
for (i = 0; i < mbi->nButtons; i++)
|
||||
{
|
||||
SendDlgItemMessageW(hwnd, mbi->Btns[i], WM_SETFONT, (WPARAM)mbi->Font, 0);
|
||||
}
|
||||
switch(mbi->dwStyle & MB_TYPEMASK)
|
||||
switch (mbi->dwStyle & MB_TYPEMASK)
|
||||
{
|
||||
case MB_ABORTRETRYIGNORE:
|
||||
case MB_YESNO:
|
||||
|
@ -279,10 +281,11 @@ static INT_PTR CALLBACK MessageBoxProc( HWND hwnd, UINT message,
|
|||
break;
|
||||
}
|
||||
SetFocus(GetDlgItem(hwnd, mbi->DefBtn));
|
||||
if(mbi->Timeout && (mbi->Timeout != (UINT)-1))
|
||||
if (mbi->Timeout && (mbi->Timeout != (UINT)-1))
|
||||
SetTimer(hwnd, 0, mbi->Timeout, NULL);
|
||||
}
|
||||
return 0;
|
||||
}
|
||||
|
||||
case WM_COMMAND:
|
||||
switch (LOWORD(wParam))
|
||||
|
@ -316,8 +319,9 @@ static INT_PTR CALLBACK MessageBoxProc( HWND hwnd, UINT message,
|
|||
return 0;
|
||||
|
||||
case WM_HELP:
|
||||
{
|
||||
mbi = (PMSGBOXINFO)GetPropW(hwnd, L"ROS_MSGBOX");
|
||||
if(!mbi)
|
||||
if (!mbi)
|
||||
return 0;
|
||||
memcpy(&hi, (void *)lParam, sizeof(hi));
|
||||
hi.dwContextId = GetWindowContextHelpId(hwnd);
|
||||
|
@ -327,16 +331,18 @@ static INT_PTR CALLBACK MessageBoxProc( HWND hwnd, UINT message,
|
|||
else
|
||||
{
|
||||
owner = GetWindow(hwnd, GW_OWNER);
|
||||
if(owner)
|
||||
if (owner)
|
||||
SendMessageW(GetWindow(hwnd, GW_OWNER), WM_HELP, 0, (LPARAM)&hi);
|
||||
}
|
||||
return 0;
|
||||
}
|
||||
|
||||
case WM_CLOSE:
|
||||
{
|
||||
mbi = (PMSGBOXINFO)GetPropW(hwnd, L"ROS_MSGBOX");
|
||||
if(!mbi)
|
||||
if (!mbi)
|
||||
return 0;
|
||||
switch(mbi->dwStyle & MB_TYPEMASK)
|
||||
switch (mbi->dwStyle & MB_TYPEMASK)
|
||||
{
|
||||
case MB_ABORTRETRYIGNORE:
|
||||
case MB_YESNO:
|
||||
|
@ -344,9 +350,10 @@ static INT_PTR CALLBACK MessageBoxProc( HWND hwnd, UINT message,
|
|||
}
|
||||
EndDialog(hwnd, IDCANCEL);
|
||||
return 1;
|
||||
}
|
||||
|
||||
case WM_TIMER:
|
||||
if(wParam == 0)
|
||||
if (wParam == 0)
|
||||
{
|
||||
EndDialog(hwnd, 32000);
|
||||
}
|
||||
|
@ -430,7 +437,7 @@ MessageBoxTimeoutIndirectW(
|
|||
Buttons.btnCnt++;
|
||||
}
|
||||
|
||||
switch(lpMsgBoxParams->dwStyle & MB_ICONMASK)
|
||||
switch (lpMsgBoxParams->dwStyle & MB_ICONMASK)
|
||||
{
|
||||
case MB_ICONEXCLAMATION:
|
||||
Icon = LoadIconW(0, IDI_EXCLAMATIONW);
|
||||
|
@ -502,7 +509,7 @@ MessageBoxTimeoutIndirectW(
|
|||
}
|
||||
|
||||
buf = RtlAllocateHeap(GetProcessHeap(), 0, bufsize);
|
||||
if(!buf)
|
||||
if (!buf)
|
||||
{
|
||||
return 0;
|
||||
}
|
||||
|
@ -516,9 +523,9 @@ MessageBoxTimeoutIndirectW(
|
|||
|
||||
tpl->style = WS_CAPTION | WS_POPUP | WS_VISIBLE | WS_CLIPSIBLINGS | WS_SYSMENU | DS_CENTER | DS_MODALFRAME | DS_NOIDLEMSG;
|
||||
tpl->dwExtendedStyle = WS_EX_DLGMODALFRAME | WS_EX_WINDOWEDGE | WS_EX_CONTROLPARENT;
|
||||
if(lpMsgBoxParams->dwStyle & MB_TOPMOST)
|
||||
if (lpMsgBoxParams->dwStyle & MB_TOPMOST)
|
||||
tpl->dwExtendedStyle |= WS_EX_TOPMOST;
|
||||
if(lpMsgBoxParams->dwStyle & MB_RIGHT)
|
||||
if (lpMsgBoxParams->dwStyle & MB_RIGHT)
|
||||
tpl->dwExtendedStyle |= WS_EX_RIGHT;
|
||||
tpl->x = 100;
|
||||
tpl->y = 100;
|
||||
|
@ -535,7 +542,7 @@ MessageBoxTimeoutIndirectW(
|
|||
dest += sizeof(WCHAR);
|
||||
|
||||
/* Create icon */
|
||||
if(Icon)
|
||||
if (Icon)
|
||||
{
|
||||
dest = (BYTE*)(((ULONG_PTR)dest + 3) & ~3);
|
||||
iico = (DLGITEMTEMPLATE *)dest;
|
||||
|
@ -560,7 +567,7 @@ MessageBoxTimeoutIndirectW(
|
|||
dest = (BYTE*)(((UINT_PTR)dest + 3) & ~3);
|
||||
itxt = (DLGITEMTEMPLATE *)dest;
|
||||
itxt->style = WS_CHILD | WS_VISIBLE | SS_NOPREFIX;
|
||||
if(lpMsgBoxParams->dwStyle & MB_RIGHT)
|
||||
if (lpMsgBoxParams->dwStyle & MB_RIGHT)
|
||||
itxt->style |= SS_RIGHT;
|
||||
else
|
||||
itxt->style |= SS_LEFT;
|
||||
|
@ -586,19 +593,21 @@ MessageBoxTimeoutIndirectW(
|
|||
btnsize.cy = BTN_CY;
|
||||
btnrect.left = btnrect.top = 0;
|
||||
|
||||
for(i = 0; i < Buttons.btnCnt; i++)
|
||||
for (i = 0; i < Buttons.btnCnt; i++)
|
||||
{
|
||||
dest = (BYTE*)(((UINT_PTR)dest + 3) & ~3);
|
||||
ibtn[i] = (DLGITEMTEMPLATE *)dest;
|
||||
ibtn[i]->style = WS_CHILD | WS_VISIBLE | WS_TABSTOP;
|
||||
if(!defbtn && (i == ((lpMsgBoxParams->dwStyle & MB_DEFMASK) >> 8)))
|
||||
if (!defbtn && (i == ((lpMsgBoxParams->dwStyle & MB_DEFMASK) >> 8)))
|
||||
{
|
||||
ibtn[i]->style |= BS_DEFPUSHBUTTON;
|
||||
mbi.DefBtn = Buttons.btnIdx[i];
|
||||
defbtn = TRUE;
|
||||
}
|
||||
else
|
||||
{
|
||||
ibtn[i]->style |= BS_PUSHBUTTON;
|
||||
}
|
||||
ibtn[i]->dwExtendedStyle = 0;
|
||||
ibtn[i]->id = Buttons.btnIdx[i];
|
||||
dest += sizeof(DLGITEMTEMPLATE);
|
||||
|
@ -620,7 +629,7 @@ MessageBoxTimeoutIndirectW(
|
|||
}
|
||||
|
||||
/* make first button the default button if no other is */
|
||||
if(!defbtn)
|
||||
if (!defbtn)
|
||||
{
|
||||
ibtn[0]->style &= ~BS_PUSHBUTTON;
|
||||
ibtn[0]->style |= BS_DEFPUSHBUTTON;
|
||||
|
@ -629,7 +638,7 @@ MessageBoxTimeoutIndirectW(
|
|||
|
||||
/* calculate position and size of controls */
|
||||
txtrect.right = GetSystemMetrics(SM_CXSCREEN) / 5 * 4;
|
||||
if(Icon)
|
||||
if (Icon)
|
||||
txtrect.right -= GetSystemMetrics(SM_CXICON) + MSGBOXEX_SPACING;
|
||||
txtrect.top = txtrect.left = txtrect.bottom = 0;
|
||||
if (textlen != 0)
|
||||
|
@ -643,14 +652,14 @@ MessageBoxTimeoutIndirectW(
|
|||
}
|
||||
txtrect.right++;
|
||||
|
||||
if(hDC)
|
||||
if (hDC)
|
||||
DeleteDC(hDC);
|
||||
|
||||
/* calculate position and size of the icon */
|
||||
rc.left = rc.bottom = rc.right = 0;
|
||||
btntop = 0;
|
||||
|
||||
if(iico)
|
||||
if (iico)
|
||||
{
|
||||
rc.right = GetSystemMetrics(SM_CXICON);
|
||||
rc.bottom = GetSystemMetrics(SM_CYICON);
|
||||
|
@ -661,7 +670,7 @@ MessageBoxTimeoutIndirectW(
|
|||
rc.top = MSGBOXEX_MARGIN;
|
||||
#endif
|
||||
btnleft = (Buttons.btnCnt * (btnsize.cx + MSGBOXEX_BUTTONSPACING)) - MSGBOXEX_BUTTONSPACING;
|
||||
if(btnleft > txtrect.right + rc.right + MSGBOXEX_SPACING)
|
||||
if (btnleft > txtrect.right + rc.right + MSGBOXEX_SPACING)
|
||||
{
|
||||
#ifdef MSGBOX_TEXTHCENTER
|
||||
lmargin = MSGBOXEX_MARGIN + ((btnleft - txtrect.right - rc.right - MSGBOXEX_SPACING) / 2);
|
||||
|
@ -686,7 +695,7 @@ MessageBoxTimeoutIndirectW(
|
|||
else
|
||||
{
|
||||
btnleft = (Buttons.btnCnt * (btnsize.cx + MSGBOXEX_BUTTONSPACING)) - MSGBOXEX_BUTTONSPACING;
|
||||
if(btnleft > txtrect.right)
|
||||
if (btnleft > txtrect.right)
|
||||
{
|
||||
#ifdef MSGBOX_TEXTHCENTER
|
||||
lmargin = MSGBOXEX_MARGIN + ((btnleft - txtrect.right) / 2);
|
||||
|
@ -707,7 +716,7 @@ MessageBoxTimeoutIndirectW(
|
|||
rc.top = max(rc.top, MSGBOXEX_MARGIN);
|
||||
/* calculate position of the buttons */
|
||||
btntop = max(rc.top + txtrect.bottom + MSGBOXEX_SPACING, btntop);
|
||||
for(i = 0; i < Buttons.btnCnt; i++)
|
||||
for (i = 0; i < Buttons.btnCnt; i++)
|
||||
{
|
||||
ibtn[i]->x = RESCALE_X(btnleft, units);
|
||||
ibtn[i]->y = RESCALE_Y(btntop, units);
|
||||
|
@ -750,7 +759,7 @@ MessageBoxTimeoutIndirectW(
|
|||
ret = DialogBoxIndirectParamW(lpMsgBoxParams->hInstance, tpl, lpMsgBoxParams->hwndOwner,
|
||||
MessageBoxProc, (LPARAM)&mbi);
|
||||
|
||||
if(hFont)
|
||||
if (hFont)
|
||||
DeleteObject(hFont);
|
||||
|
||||
RtlFreeHeap(GetProcessHeap(), 0, buf);
|
||||
|
@ -766,10 +775,10 @@ MessageBoxTimeoutIndirectW(
|
|||
int
|
||||
WINAPI
|
||||
MessageBoxA(
|
||||
HWND hWnd,
|
||||
LPCSTR lpText,
|
||||
LPCSTR lpCaption,
|
||||
UINT uType)
|
||||
IN HWND hWnd,
|
||||
IN LPCSTR lpText,
|
||||
IN LPCSTR lpCaption,
|
||||
IN UINT uType)
|
||||
{
|
||||
return MessageBoxExA(hWnd, lpText, lpCaption, uType, LANG_NEUTRAL);
|
||||
}
|
||||
|
@ -781,11 +790,11 @@ MessageBoxA(
|
|||
int
|
||||
WINAPI
|
||||
MessageBoxExA(
|
||||
HWND hWnd,
|
||||
LPCSTR lpText,
|
||||
LPCSTR lpCaption,
|
||||
UINT uType,
|
||||
WORD wLanguageId)
|
||||
IN HWND hWnd,
|
||||
IN LPCSTR lpText,
|
||||
IN LPCSTR lpCaption,
|
||||
IN UINT uType,
|
||||
IN WORD wLanguageId)
|
||||
{
|
||||
MSGBOXPARAMSA msgbox;
|
||||
|
||||
|
@ -810,11 +819,11 @@ MessageBoxExA(
|
|||
int
|
||||
WINAPI
|
||||
MessageBoxExW(
|
||||
HWND hWnd,
|
||||
LPCWSTR lpText,
|
||||
LPCWSTR lpCaption,
|
||||
UINT uType,
|
||||
WORD wLanguageId)
|
||||
IN HWND hWnd,
|
||||
IN LPCWSTR lpText,
|
||||
IN LPCWSTR lpCaption,
|
||||
IN UINT uType,
|
||||
IN WORD wLanguageId)
|
||||
{
|
||||
MSGBOXPARAMSW msgbox;
|
||||
|
||||
|
@ -839,7 +848,7 @@ MessageBoxExW(
|
|||
int
|
||||
WINAPI
|
||||
MessageBoxIndirectA(
|
||||
CONST MSGBOXPARAMSA *lpMsgBoxParams)
|
||||
IN CONST MSGBOXPARAMSA* lpMsgBoxParams)
|
||||
{
|
||||
MSGBOXPARAMSW msgboxW;
|
||||
UNICODE_STRING textW, captionW, iconW;
|
||||
|
@ -869,7 +878,7 @@ MessageBoxIndirectA(
|
|||
else
|
||||
captionW.Buffer = (LPWSTR)lpMsgBoxParams->lpszCaption;
|
||||
|
||||
if(lpMsgBoxParams->dwStyle & MB_USERICON)
|
||||
if (lpMsgBoxParams->dwStyle & MB_USERICON)
|
||||
{
|
||||
if (!IS_INTRESOURCE(lpMsgBoxParams->lpszIcon))
|
||||
{
|
||||
|
@ -918,7 +927,7 @@ MessageBoxIndirectA(
|
|||
int
|
||||
WINAPI
|
||||
MessageBoxIndirectW(
|
||||
CONST MSGBOXPARAMSW *lpMsgBoxParams)
|
||||
IN CONST MSGBOXPARAMSW* lpMsgBoxParams)
|
||||
{
|
||||
return MessageBoxTimeoutIndirectW(lpMsgBoxParams, (UINT)-1);
|
||||
}
|
||||
|
@ -930,10 +939,10 @@ MessageBoxIndirectW(
|
|||
int
|
||||
WINAPI
|
||||
MessageBoxW(
|
||||
HWND hWnd,
|
||||
LPCWSTR lpText,
|
||||
LPCWSTR lpCaption,
|
||||
UINT uType)
|
||||
IN HWND hWnd,
|
||||
IN LPCWSTR lpText,
|
||||
IN LPCWSTR lpCaption,
|
||||
IN UINT uType)
|
||||
{
|
||||
return MessageBoxExW(hWnd, lpText, lpCaption, uType, LANG_NEUTRAL);
|
||||
}
|
||||
|
@ -944,12 +953,12 @@ MessageBoxW(
|
|||
int
|
||||
WINAPI
|
||||
MessageBoxTimeoutA(
|
||||
HWND hWnd,
|
||||
LPCSTR lpText,
|
||||
LPCSTR lpCaption,
|
||||
UINT uType,
|
||||
WORD wLanguageId,
|
||||
DWORD dwTime)
|
||||
IN HWND hWnd,
|
||||
IN LPCSTR lpText,
|
||||
IN LPCSTR lpCaption,
|
||||
IN UINT uType,
|
||||
IN WORD wLanguageId,
|
||||
IN DWORD dwTime)
|
||||
{
|
||||
MSGBOXPARAMSW msgboxW;
|
||||
UNICODE_STRING textW, captionW;
|
||||
|
@ -993,12 +1002,12 @@ MessageBoxTimeoutA(
|
|||
int
|
||||
WINAPI
|
||||
MessageBoxTimeoutW(
|
||||
HWND hWnd,
|
||||
LPCWSTR lpText,
|
||||
LPCWSTR lpCaption,
|
||||
UINT uType,
|
||||
WORD wLanguageId,
|
||||
DWORD dwTime)
|
||||
IN HWND hWnd,
|
||||
IN LPCWSTR lpText,
|
||||
IN LPCWSTR lpCaption,
|
||||
IN UINT uType,
|
||||
IN WORD wLanguageId,
|
||||
IN DWORD dwTime)
|
||||
{
|
||||
MSGBOXPARAMSW msgbox;
|
||||
|
||||
|
@ -1034,7 +1043,7 @@ SoftModalMessageBox(DWORD Unknown0)
|
|||
*/
|
||||
BOOL
|
||||
WINAPI
|
||||
MessageBeep(UINT uType)
|
||||
MessageBeep(IN UINT uType)
|
||||
{
|
||||
return NtUserxMessageBeep(uType);
|
||||
}
|
||||
|
@ -1047,7 +1056,9 @@ MessageBeep(UINT uType)
|
|||
* and: http://undoc.airesoft.co.uk/user32.dll/MB_GetString.php
|
||||
* for more information.
|
||||
*/
|
||||
LPCWSTR WINAPI MB_GetString(UINT wBtn)
|
||||
LPCWSTR
|
||||
WINAPI
|
||||
MB_GetString(IN UINT wBtn)
|
||||
{
|
||||
LPCWSTR btnStr = NULL;
|
||||
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue