본문 바로가기
VisualStudio.C++.C#/코딩팁,함수활용,단편

win32api. MessageBox

by 리치굿맨 2018. 9. 5.




int MessageBox(
  HWND    hWnd,
  LPCTSTR lpText,
  LPCTSTR lpCaption,
  UINT    uType
);



Requirements. 

Header : winuser.h (include windows.h)

Library : user32.lib 

DLL : user32.dll



example codes

 int DisplayResourceNAMessageBox()
{
    int msgboxID = MessageBox(
        NULL,
        (LPCWSTR)L"Resource not available\nDo you want to try again?",
        (LPCWSTR)L"Account Details",
        MB_ICONWARNING | MB_CANCELTRYCONTINUE | MB_DEFBUTTON2
    );

    switch (msgboxID)
    {
    case IDCANCEL:
        // TODO: add code
        break;
    case IDTRYAGAIN:
        // TODO: add code
        break;
    case IDCONTINUE:
        // TODO: add code
        break;
    }

    return msgboxID;
}






from MS : https://docs.microsoft.com/en-us/windows/desktop/api/winuser/nf-winuser-messagebox



///1846





댓글0


.    
현물 |선물 인버스 |선물 USDT     현물 | 선물 USDT |봇제작툴/카피트레이딩     현물 |선물 인버스 |선물 USDT     .