msgbox.c
Upload User: xhy777
Upload Date: 2007-02-14
Package Size: 24088k
Code Size: 1k
Category:

Windows Kernel

Development Platform:

Visual C++

  1. #include "shprv.h"
  2. //
  3. //  simple form of Shell message box, does not handle param replacment
  4. //  just calls LoadString and MessageBox
  5. //
  6. int WINAPI ShellMessageBox(HINSTANCE hAppInst, HWND hWnd, LPCSTR lpcText, LPCSTR lpcTitle, UINT fuStyle)
  7. {
  8.     char    achText[256];
  9.     char    achTitle[80];
  10.     if (HIWORD(lpcText) == 0)
  11.     {
  12.         LoadString(hAppInst, LOWORD(lpcText), achText, sizeof(achText));
  13.         lpcText = (LPCSTR)achText;
  14.     }
  15.     if (HIWORD(lpcTitle) == 0)
  16.     {
  17.         if (LOWORD(lpcTitle) == 0)
  18.             GetWindowText(hWnd, achTitle, sizeof(achTitle));
  19.         else
  20.             LoadString(hAppInst, LOWORD(lpcTitle), achTitle, sizeof(achTitle));
  21.         lpcTitle = (LPCSTR)achTitle;
  22.     }
  23.     return MessageBox(hWnd, lpcText, lpcTitle, fuStyle);
  24. }