MCPcopy Create free account
hub / github.com/ProgerXP/Notepad2e / InfoBox

Function InfoBox

src/Dialogs.c:1768–1801  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

1766extern WCHAR szIniFile[MAX_PATH];
1767
1768INT_PTR InfoBox ( int iType, LPCWSTR lpstrSetting, int uidMessage, ... )
1769{
1770 HWND hwnd;
1771 int idDlg = IDD_INFOBOX;
1772 INFOBOX ib;
1773 WCHAR wchFormat[512];
1774 int iMode;
1775 iMode = IniGetInt ( L"Suppressed Messages", lpstrSetting, 0 );
1776 if ( lstrlen ( lpstrSetting ) > 0 && iMode == 1 ) {
1777 return ( iType == MBYESNO ) ? IDYES : IDOK;
1778 }
1779 if ( !GetString ( uidMessage, wchFormat, COUNTOF ( wchFormat ) ) ) {
1780 return ( -1 );
1781 }
1782 ib.lpstrMessage = LocalAlloc ( LPTR, 1024 * sizeof ( WCHAR ) );
1783 wvsprintf ( ib.lpstrMessage, wchFormat, ( LPVOID ) ( ( PUINT_PTR ) &uidMessage + 1 ) );
1784 ib.lpstrSetting = ( LPWSTR ) lpstrSetting;
1785 ib.bDisableCheckBox = ( lstrlen ( szIniFile ) == 0 || lstrlen ( lpstrSetting ) == 0 || iMode == 2 ) ? TRUE : FALSE;
1786 if ( iType == MBYESNO ) {
1787 idDlg = IDD_INFOBOX2;
1788 } else if ( iType == MBOKCANCEL ) {
1789 idDlg = IDD_INFOBOX3;
1790 }
1791 if ( ! ( hwnd = GetFocus() ) ) {
1792 hwnd = hwndMain;
1793 }
1794 MessageBeep ( MB_ICONEXCLAMATION );
1795 return ThemedDialogBoxParam (
1796 g_hInstance,
1797 MAKEINTRESOURCE ( idDlg ),
1798 hwnd,
1799 InfoBoxDlgProc,
1800 ( LPARAM ) &ib );
1801}
1802
1803
1804

Callers 9

EditSetNewEncodingFunction · 0.85
EditLoadFileFunction · 0.85
EditSaveFileFunction · 0.85
EditFindNextFunction · 0.85
EditFindPrevFunction · 0.85
EditReplaceFunction · 0.85
EditReplaceAllFunction · 0.85
MsgCommandFunction · 0.85

Calls 1

ThemedDialogBoxParamFunction · 0.85

Tested by

no test coverage detected