本文整理汇总了C++中MsgBox函数的典型用法代码示例。如果您正苦于以下问题:C++ MsgBox函数的具体用法?C++ MsgBox怎么用?C++ MsgBox使用的例子?那么恭喜您, 这里精选的函数代码示例或许可以为您提供帮助。
在下文中一共展示了MsgBox函数的20个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于我们的系统推荐出更棒的C++代码示例。
示例1: ViMain
// Main process
void ViMain()
{
char tmp[MAX_PATH];
UINT ostype = GetOsInfo()->OsType;
VI_SETTING_ARCH *suitable;
TOKEN_LIST *t;
UINT i;
if (OS_IS_WINDOWS_NT(ostype) == false ||
GET_KETA(ostype, 100) <= 1)
{
// The OS is too old
MsgBox(NULL, MB_ICONEXCLAMATION, _U(IDS_BAD_OS+skip));
return;
}
Zero(&setting, sizeof(setting));
// Read the inf file
Format(tmp, sizeof(tmp), "%s\\%s", MsGetExeDirName(), VI_INF_FILENAME);
if (ViLoadInf(&setting, tmp) == false)
{
// Failure
MsgBoxEx(NULL, MB_ICONSTOP, _U(IDS_INF_LOAD_FAILED+skip), VI_INF_FILENAME);
return;
}
ViSetSkip();
// Parse the command line options
t = GetCommandLineToken();
for (i = 0;i < t->NumTokens;i++)
{
char *s = t->Token[i];
if (IsEmptyStr(s) == false)
{
if (StartWith(s, "/") || StartWith(s, "-"))
{
if (StrCmpi(&s[1], "web") == 0)
{
setting.WebMode = true;
}
}
else
{
StrCpy(setting.SettingPath, sizeof(setting.SettingPath), s);
}
}
}
FreeToken(t);
suitable = ViGetSuitableArchForCpu();
// Security check
if (setting.WebMode)
{
bool ok = true;
if (ViIsInternetFile(suitable->Path) == false)
{
ok = false;
}
if (IsEmptyStr(setting.SettingPath) == false)
{
if (ViIsInternetFile(setting.SettingPath) == false)
{
ok = false;
}
}
if (ok == false)
{
// Security breach
MsgBox(NULL, MB_ICONEXCLAMATION, _U(IDS_SECURITY_ERROR+skip));
return;
}
}
// Get the current installation state
ViLoadCurrentInstalledStates();
if (suitable->Supported == false)
{
// This CPU isn't supported
MsgBox(NULL, MB_ICONEXCLAMATION, _U(IDS_CPU_NOT_SUPPORTED+skip));
return;
}
if (suitable->CurrentInstalled && suitable->Build <= suitable->CurrentInstalledBuild)
{
// Do not download client software since it has already been installed
setting.DownloadNotRequired = true;
}
// Show the dialog
//.........这里部分代码省略.........
开发者ID:alex-docker,项目名称:CE-dockerfiles,代码行数:101,代码来源:vpninstall.c
示例2: EditPrint
extern "C" BOOL EditPrint(HWND hwnd,LPCWSTR pszDocTitle,LPCWSTR pszPageFormat)
{
// Don't print empty documents
if (SendMessage(hwnd,SCI_GETLENGTH,0,0) == 0) {
MsgBox(MBWARN,IDS_PRINT_EMPTY);
return TRUE;
}
int startPos;
int endPos;
HDC hdc;
RECT rectMargins;
RECT rectPhysMargins;
RECT rectSetup;
POINT ptPage;
POINT ptDpi;
//RECT rectSetup;
TEXTMETRIC tm;
int headerLineHeight;
HFONT fontHeader;
int footerLineHeight;
HFONT fontFooter;
WCHAR dateString[MIDSZ_BUFFER] = { L'\0' };
DOCINFO di = {sizeof(DOCINFO), nullptr, nullptr, nullptr, 0};
int lengthDoc;
int lengthDocMax;
int lengthPrinted;
struct Sci_RangeToFormat frPrint;
int pageNum;
BOOL printPage;
WCHAR pageString[32] = { L'\0' };
HPEN pen;
HPEN penOld;
PRINTDLG pdlg = { sizeof(PRINTDLG), nullptr, nullptr, nullptr, nullptr,
0, 0, 0, 0, 0, 0, nullptr, 0, nullptr, nullptr, nullptr, nullptr, nullptr, nullptr };
pdlg.hwndOwner = GetParent(hwnd);
pdlg.hInstance = g_hInstance;
pdlg.Flags = PD_USEDEVMODECOPIES | PD_ALLPAGES | PD_RETURNDC;
pdlg.nFromPage = 1;
pdlg.nToPage = 1;
pdlg.nMinPage = 1;
pdlg.nMaxPage = 0xffffU;
pdlg.nCopies = 1;
pdlg.hDC = nullptr;
pdlg.hDevMode = hDevMode;
pdlg.hDevNames = hDevNames;
startPos = (int)SendMessage(hwnd,SCI_GETSELECTIONSTART,0,0);
endPos = (int)SendMessage(hwnd,SCI_GETSELECTIONEND,0,0);
if (startPos == endPos) {
pdlg.Flags |= PD_NOSELECTION;
} else {
pdlg.Flags |= PD_SELECTION;
}
// |= 0 - Don't display dialog box, just use the default printer and options
pdlg.Flags |= (flagPrintFileAndLeave == 1) ? PD_RETURNDEFAULT : 0;
if (!PrintDlg(&pdlg)) {
return TRUE; // False means error...
}
hDevMode = pdlg.hDevMode;
hDevNames = pdlg.hDevNames;
hdc = pdlg.hDC;
// Get printer resolution
ptDpi.x = GetDeviceCaps(hdc, LOGPIXELSX); // dpi in X direction
ptDpi.y = GetDeviceCaps(hdc, LOGPIXELSY); // dpi in Y direction
// Start by getting the physical page size (in device units).
ptPage.x = GetDeviceCaps(hdc, PHYSICALWIDTH); // device units
ptPage.y = GetDeviceCaps(hdc, PHYSICALHEIGHT); // device units
// Get the dimensions of the unprintable
// part of the page (in device units).
rectPhysMargins.left = GetDeviceCaps(hdc, PHYSICALOFFSETX);
rectPhysMargins.top = GetDeviceCaps(hdc, PHYSICALOFFSETY);
// To get the right and lower unprintable area,
// we take the entire width and height of the paper and
// subtract everything else.
rectPhysMargins.right = ptPage.x // total paper width
//.........这里部分代码省略.........
开发者ID:gencer,项目名称:Notepad3,代码行数:101,代码来源:Print.cpp
示例3: ViewItems_OnCommand
VOID ViewItems_OnCommand( HWND hwnd,
INT id,
HWND hwndCtrl,
UINT codeNotify )
{
INT i, j, n;
CHAR szBuf[128];
HWND hwndList;
LRESULT lResult;
switch(id)
{
case IDC_ITEM_LIST:
if ( codeNotify == LBN_SELCHANGE )
{
ViewItems_ItemChanged( hwnd );
}
break;
case IDC_ITEM_RESOURCES:
if ( codeNotify == LBN_SELCHANGE )
{
lResult = ListBox_GetCurSel( hwndCtrl );
if ( lResult != LB_ERR )
{
ListBox_GetText( hwndCtrl, lResult, szBuf );
for( j = 0; j < po->nBitmaps; ++j )
{
if ( !_fstricmp( szBuf, po->pBitmapData[j].bitmap_name ) )
{
break;
}
}
if ( j < po->nBitmaps )
{
PreviewBitmap( hwnd,
IDC_ITEM_BITMAP_PREVIEW,
IDC_ITEM_BITMAP_SIZE,
&po->pBitmapData[j],
po->pPalette );
}
else
{
PreviewBitmap( hwnd,
IDC_ITEM_BITMAP_PREVIEW,
IDC_ITEM_BITMAP_SIZE,
NULL,
NULL );
}
}
}
break;
case IDC_ITEM_PIXEL_SIZE:
if ( codeNotify == EN_CHANGE )
{
lResult = ListBox_GetCurSel( GetDlgItem( hwnd, IDC_ITEM_LIST ) );
if ( lResult >= 0 && lResult < po->nItems )
{
i = (INT)lResult;
SendMessage( hwndCtrl,
WM_GETTEXT,
(WPARAM)sizeof(szBuf),
(LPARAM)((LPSTR)szBuf) );
po->pItemData[i].pixel_size = (float)atof( szBuf );
bChange = TRUE;
}
}
break;
case IDC_ITEM_NEW:
i = po->nItems;
if (i == MAX_ITEMS)
{
MsgBox( hwnd,
MB_ICONEXCLAMATION,
"The limit of %d items has been reached.",
MAX_ITEMS );
break;
}
_fmemset( szNewItemName, 0, sizeof(szNewItemName) );
_fmemset( nNewIndex, 0, sizeof(nNewIndex) );
nNewItemType = -1;
dNewPixelSize = 15.62;
for(j = 0; j < MAX_ELEMENTS; ++j)
//.........这里部分代码省略.........
开发者ID:CireG,项目名称:Alien-Cabal-VEdit,代码行数:101,代码来源:ITEMDLG.C
示例4: Configure_Flow_KB120F
static void Configure_Flow_KB120F( void )
{
// for kb120f, kb6120, kb6120b
static struct uMenu const menu[] =
{
{ 0x0201u, "设置粉尘流量" },
{ 0x0C00u, "流 量" },
{ 0x1400u, "限 压" }
};
uint8_t item = 0u;
BOOL changed = FALSE;
BOOL need_redraw = TRUE;
do
{
if ( need_redraw )
{
cls();
Menu_Redraw( menu );
need_redraw = FALSE;
}
ShowI16U( 0x0C11u, Configure.SetFlow[PP_TSP], 0x0501u, " L/m" );
if ( Configure.TSP_Pr_Portect != 0u )
{
ShowI16U( 0x1411u, Configure.TSP_Pr_Portect , 0x0502u, " kPa" );
}
else
{
Lputs( 0x1411, " [停用] " );
}
item = Menu_Select( menu, item + 1u, NULL );
switch( item )
{
case 0:
if ( changed )
{
need_redraw = TRUE;
switch( MsgBox( "保存修改结果 ?", vbYesNoCancel + vbDefaultButton3 ))
{
case vbYes:
ConfigureSave();
break;
case vbNo:
ConfigureLoad();
break;
case vbCancel:
item = 1u;
break;
default:
break;
}
}
break;
case 1:
if( EditI16U( 0x0C11u, & Configure.SetFlow[PP_TSP ], 0x0501u ))
{
if ( Configure.SetFlow[PP_TSP ] > 1400u )
{
Configure.SetFlow[PP_TSP ] = 1400u;
}
if ( Configure.SetFlow[PP_TSP ] < 600u )
{
Configure.SetFlow[PP_TSP ] = 600u;
}
changed = TRUE;
}
break;
case 2:
ShowI16U( 0x1411u, Configure.TSP_Pr_Portect , 0x0502u, " kPa" );
if( EditI16U( 0x1411u, & Configure.TSP_Pr_Portect , 0x0502u ))
{
if ( Configure.TSP_Pr_Portect > 2000u )
{
Configure.TSP_Pr_Portect = 2000u;
}
changed = TRUE;
}
break;
default:
break;
}
}
while( enumSelectESC != item );
}
开发者ID:github188,项目名称:JSD-KB6120E_V2.x,代码行数:87,代码来源:Configure.c
示例5: SetUnhandledExceptionFilter
//.........这里部分代码省略.........
LOG_INFO(_T("Initializing resource manager..."));
ictranslate::CResourceManager& rResManager = ictranslate::CResourceManager::Acquire();
// set current language
TCHAR szPath[_MAX_PATH];
rResManager.Init(AfxGetInstanceHandle());
rResManager.SetCallback(ResManCallback);
rConfig.get_string(PP_PLANGUAGE, szPath, _MAX_PATH);
TRACE(_T("Help path=%s\n"), szPath);
if(!rResManager.SetLanguage(ExpandPath(szPath)))
{
TCHAR szData[2048];
_sntprintf(szData, 2048, _T("Couldn't find the language file specified in configuration file:\n%s\nPlease correct this path to point the language file to use.\nProgram will now exit."), szPath);
LOG_ERROR(szData);
AfxMessageBox(szData, MB_ICONSTOP | MB_OK);
return FALSE;
}
UpdateHelpPaths();
// for dialogs
ictranslate::CLanguageDialog::SetResManager(&rResManager);
EnableHtmlHelp();
// ================================= Checking for running instances of CH ========================================
// check instance - return false if it's the second one
LOG_INFO(_T("Checking for other running instances of Copy Handler"));
if(!IsFirstInstance())
{
LOG_WARNING(_T("Other instance of Copy Handler is already running. Exiting."));
MsgBox(IDS_ONECOPY_STRING);
return FALSE;
}
// ================================= Common controls ========================================
LOG_INFO(_T("Initializing GUI common controls"));
// InitCommonControlsEx() is required on Windows XP if an application
// manifest specifies use of ComCtl32.dll version 6 or later to enable
// visual styles. Otherwise, any window creation will fail.
INITCOMMONCONTROLSEX InitCtrls;
InitCtrls.dwSize = sizeof(InitCtrls);
// Set this to include all the common control classes you want to use
// in your application.
InitCtrls.dwICC = ICC_WIN95_CLASSES;
InitCommonControlsEx(&InitCtrls);
// ================================= Shell extension ========================================
LOG_INFO(_T("Initializing shared memory for communication with shell extension"));
m_hMapObject = CreateFileMapping(INVALID_HANDLE_VALUE, NULL, PAGE_READWRITE, 0, sizeof(CSharedConfigStruct), _T("CHLMFile"));
if (m_hMapObject == NULL)
return FALSE;
// Get a pointer to the file-mapped shared memory.
g_pscsShared=(CSharedConfigStruct*)MapViewOfFile(m_hMapObject, FILE_MAP_READ | FILE_MAP_WRITE, 0, 0, 0);
if (g_pscsShared == NULL)
return FALSE;
LOG_INFO(_T("Checking shell extension compatibility"));
// calculate ch version
long lCHVersion = PRODUCT_VERSION1 << 24 | PRODUCT_VERSION2 << 16 | PRODUCT_VERSION3 << 8 | PRODUCT_VERSION4;
开发者ID:alphaonex86,项目名称:Copy-handler,代码行数:67,代码来源:ch.cpp
示例6: Configure_HCBox
/********************************** 功能说明 ***********************************
* 系统配置 -> 恒温箱
*******************************************************************************/
static void Configure_HCBox( void )
{
static CHAR const MDS[][6] =
{
{ "S关闭" }, { "H加热" }, { "C制冷" } , { "A自动" }
};
static struct uMenu const menu[] =
{
{ 0x0201u, "配置恒温箱" },
{ 0x0C00u, "控制方式" },
{ 0x1400u, "设置温度" },
};
uint8_t item = 1u;
uint8_t SetMode = Configure.HCBox_SetMode;
uint16_t SetTemp = Configure.HCBox_SetTemp;
BOOL changed = FALSE;
BOOL need_redraw = TRUE;
do
{
if ( need_redraw )
{
cls();
Menu_Redraw( menu );
need_redraw = FALSE;
}
Lputs( 0x0C16U, MDS[SetMode] );
ShowI16U( 0x1416U, SetTemp, 0x0501U, "℃" );
item = Menu_Select( menu, item, NULL );
switch( item )
{
case 1u: /* EditBoxMode */
SetMode = ( SetMode + 1u) % 4u;
changed = TRUE;
break;
case 2u:
/* 注意: 因为恒温箱的设置温度范围是正数, 所以才可以使用无符号数编辑程序进行编辑 */
if ( EditI16U( 0x1416U, &SetTemp, 0x0501U ))
{
if ( SetTemp < 150u )
{
SetTemp = 150u;
beep();
}
if ( SetTemp > 300u )
{
SetTemp = 300u;
beep();
}
changed = TRUE;
}
break;
case 0u:
if ( changed )
{
need_redraw = TRUE;
switch ( MsgBox( "保存配置数据 ?", vbYesNoCancel + vbDefaultButton3 ))
{
case vbYes:
Configure.HCBox_SetMode = SetMode;
Configure.HCBox_SetTemp = SetTemp;
ConfigureSave();
set_HCBoxTemp( Configure.HCBox_SetTemp * 0.1f, Configure.HCBox_SetMode );
break;
case vbNo:
ConfigureLoad();
break;
case vbCancel:
item = 1u;
break;
default:
break;
}
}
break;
default:
break;
}
}
while ( enumSelectESC != item );
}
开发者ID:github188,项目名称:JSD-KB6120E_V2.x,代码行数:90,代码来源:Configure.c
示例7: Configure_Flow_KB1000
/********************************** 功能说明 ***********************************
* 系统配置 -> 采样流量
* 用户正常使用过程中不需要修改,原则上修改完采样流量后需要重新标定。
* 时均采样流量在采样前由用户设置,不在此处设置,对应的需要分段标定。
* 有这样有几种可能的组合:
粉尘 1.05m3(KB-1000)
粉尘 100L(KB-120F,KB6120A,KB6120B)
粉尘 100L + 0.2L 两路(KB-6120C)
日均 0.2L 两路(恒温恒流系列)
*******************************************************************************/
static void Configure_Flow_KB1000( void )
{
MsgBox( "TODO KB-1000", vbOKOnly );
}
开发者ID:github188,项目名称:JSD-KB6120E_V2.x,代码行数:15,代码来源:Configure.c
示例8: EditNoise_OnCommand
VOID EditNoise_OnCommand( HWND hwnd,
INT id,
HWND hwndCtrl,
UINT codeNotify )
{
CHAR szBuf[128];
LRESULT lResult;
switch(id)
{
case IDC_EDIT_NOISE_LIST:
if (codeNotify == LBN_SELCHANGE)
{
lResult = ListBox_GetCurSel(hwndCtrl);
if ( lResult >= 0 && lResult < po->nSounds )
{
nNewSoundIndex = (INT)lResult;
}
}
break;
case IDC_EDIT_NOISE_NAME:
if (codeNotify == EN_CHANGE)
{
SendMessage( hwndCtrl,
WM_GETTEXT,
(WPARAM)sizeof(szNewNoiseName),
(LPARAM)((LPSTR)szNewNoiseName) );
}
break;
case IDC_EDIT_NOISE_RADIUS:
if (codeNotify == EN_CHANGE)
{
SendMessage( hwndCtrl,
WM_GETTEXT,
(WPARAM)sizeof(szBuf),
(LPARAM)((LPSTR)szBuf) );
dNewRadius = atof( szBuf );
}
break;
case IDC_EDIT_NOISE_HEIGHT:
if (codeNotify == EN_CHANGE)
{
SendMessage( hwndCtrl,
WM_GETTEXT,
(WPARAM)sizeof(szBuf),
(LPARAM)((LPSTR)szBuf) );
dNewHeight = atof(szBuf);
}
break;
case IDC_EDIT_NOISE_DELAY:
if (codeNotify == EN_CHANGE)
{
SendMessage( hwndCtrl,
WM_GETTEXT,
(WPARAM)sizeof(szBuf),
(LPARAM)((LPSTR)szBuf) );
nNewDelay = atoi(szBuf);
}
break;
case IDOK:
if (!szNewNoiseName[0])
{
MsgBox( hwnd,
MB_ICONEXCLAMATION,
"The noise must be given a name." );
break;
}
if (nNewSoundIndex == -1)
{
MsgBox( hwnd,
MB_ICONEXCLAMATION,
"No sound assigned" );
break;
}
EndDialog(hwnd, id);
break;
case IDCANCEL:
EndDialog(hwnd, id);
break;
//.........这里部分代码省略.........
开发者ID:CireG,项目名称:Alien-Cabal-VEdit,代码行数:101,代码来源:NOISEDLG.C
示例9: Configure_Pr_Protect
void Configure_Pr_Protect( void )
{
static struct uMenu const menu[] =
{
{ 0x0101u, "设置压力保护" },
{ 0x0300u, "限 压" }
};
uint8_t item = 0u;
BOOL changed = FALSE;
BOOL need_redraw = TRUE;
do {
if ( need_redraw )
{
cls();
Menu_Redraw( menu );
need_redraw = FALSE;
}
if ( Configure.TSP_Pr_Portect != 0u )
{
ShowI16U( 0x0307u, Configure.TSP_Pr_Portect , 0x0502u, " kPa" );
}
else
{
Lputs( 0x0307, " [停用] " );
}
item = Menu_Select( menu, item + 1u );
switch( item )
{
case 0:
if ( changed )
{
need_redraw = TRUE;
switch( MsgBox( "保存修改结果 ?", vbYesNoCancel + vbDefaultButton3 ))
{
case vbYes:
ConfigureSave();
break;
case vbNo:
ConfigureLoad();
break;
case vbCancel:
item = 1u;
break;
default:
break;
}
}
break;
case 1:
ShowI16U( 0x0307u, Configure.TSP_Pr_Portect , 0x0502u, " kPa" );
if( EditI16U( 0x0307u, & Configure.TSP_Pr_Portect , 0x0502u ))
{
if ( Configure.TSP_Pr_Portect > 2000u )
{
Configure.TSP_Pr_Portect = 2000u;
}
changed = TRUE;
}
break;
default:
break;
}
}
while( enumSelectESC != item );
}
开发者ID:kaiserShao,项目名称:JSD-KB6120E_V1.x,代码行数:69,代码来源:Configure.c
示例10: UM_USER_CONTROLS
INT_PTR CRecreateDlg::RecreateDlgProc(HWND hDlg, UINT messg, WPARAM wParam, LPARAM lParam)
{
#define UM_USER_CONTROLS (WM_USER+121)
#define UM_FILL_CMDLIST (WM_USER+122)
CRecreateDlg* pDlg = NULL;
if (messg == WM_INITDIALOG)
{
pDlg = (CRecreateDlg*)lParam;
pDlg->mh_Dlg = hDlg;
SetWindowLongPtr(hDlg, DWLP_USER, lParam);
}
else
{
pDlg = (CRecreateDlg*)GetWindowLongPtr(hDlg, DWLP_USER);
}
if (!pDlg)
{
return FALSE;
}
PatchMsgBoxIcon(hDlg, messg, wParam, lParam);
switch (messg)
{
case WM_INITDIALOG:
{
LRESULT lbRc = FALSE;
// Visual
SendMessage(hDlg, WM_SETICON, ICON_BIG, (LPARAM)hClassIcon);
SendMessage(hDlg, WM_SETICON, ICON_SMALL, (LPARAM)hClassIconSm);
// Set password style (avoid "bars" on some OS)
SendDlgItemMessage(hDlg, tRunAsPassword, WM_SETFONT, (LPARAM)(HFONT)GetStockObject(DEFAULT_GUI_FONT), 0);
// Add menu items
HMENU hSysMenu = GetSystemMenu(hDlg, FALSE);
InsertMenu(hSysMenu, 0, MF_BYPOSITION, MF_SEPARATOR, 0);
InsertMenu(hSysMenu, 0, MF_BYPOSITION | MF_STRING | MF_ENABLED,
ID_RESETCMDHISTORY, L"Clear history...");
InsertMenu(hSysMenu, 0, MF_BYPOSITION | MF_STRING | MF_ENABLED
| (gpSet->isSaveCmdHistory ? MF_CHECKED : 0),
ID_STORECMDHISTORY, L"Store history");
//#ifdef _DEBUG
//SetWindowPos(ghOpWnd, HWND_NOTOPMOST, 0,0,0,0, SWP_NOSIZE|SWP_NOMOVE);
//#endif
RConStartArgs* pArgs = pDlg->mp_Args;
_ASSERTE(pArgs);
// Fill command and task drop down
SendMessage(hDlg, UM_FILL_CMDLIST, TRUE, 0);
// Set text in command and folder fields
SetDlgItemText(hDlg, IDC_RESTART_CMD, pDlg->mpsz_DefCmd ? pDlg->mpsz_DefCmd : pArgs->pszSpecialCmd ? pArgs->pszSpecialCmd : L"");
SetDlgItemText(hDlg, IDC_STARTUP_DIR, pDlg->mpsz_DefDir ? pDlg->mpsz_DefDir : pArgs->pszStartupDir ? pArgs->pszStartupDir : gpConEmu->WorkDir());
// Split controls
if (pArgs->aRecreate == cra_RecreateTab)
{
// Hide Split's
ShowWindow(GetDlgItem(hDlg, gbRecreateSplit), SW_HIDE);
ShowWindow(GetDlgItem(hDlg, rbRecreateSplitNone), SW_HIDE);
ShowWindow(GetDlgItem(hDlg, rbRecreateSplit2Right), SW_HIDE);
ShowWindow(GetDlgItem(hDlg, rbRecreateSplit2Bottom), SW_HIDE);
ShowWindow(GetDlgItem(hDlg, stRecreateSplit), SW_HIDE);
ShowWindow(GetDlgItem(hDlg, tRecreateSplit), SW_HIDE);
}
else
{
// Fill splits
SetDlgItemInt(hDlg, tRecreateSplit, (1000-pArgs->nSplitValue)/10, FALSE);
CheckRadioButton(hDlg, rbRecreateSplitNone, rbRecreateSplit2Bottom, rbRecreateSplitNone+pArgs->eSplit);
EnableWindow(GetDlgItem(hDlg, tRecreateSplit), (pArgs->eSplit != pArgs->eSplitNone));
EnableWindow(GetDlgItem(hDlg, stRecreateSplit), (pArgs->eSplit != pArgs->eSplitNone));
}
// Спрятать флажок "New window"
bool bRunInNewWindow_Hidden = (pArgs->aRecreate == cra_EditTab || pArgs->aRecreate == cra_RecreateTab);
ShowWindow(GetDlgItem(hDlg, cbRunInNewWindow), bRunInNewWindow_Hidden ? SW_HIDE : SW_SHOWNORMAL);
const wchar_t *pszUser = pArgs->pszUserName;
const wchar_t *pszDomain = pArgs->pszDomain;
bool bResticted = (pArgs->RunAsRestricted == crb_On);
int nChecked = rbCurrentUser;
DWORD nUserNameLen = countof(pDlg->ms_CurUser);
if (!GetUserName(pDlg->ms_CurUser, &nUserNameLen)) pDlg->ms_CurUser[0] = 0;
wchar_t szRbCaption[MAX_PATH*3];
lstrcpy(szRbCaption, L"Run as current &user: "); lstrcat(szRbCaption, pDlg->ms_CurUser);
SetDlgItemText(hDlg, rbCurrentUser, szRbCaption);
//.........这里部分代码省略.........
开发者ID:rheostat2718,项目名称:conemu-maximus5,代码行数:101,代码来源:Recreate.cpp
示例11: ViewNoises_OnCommand
VOID ViewNoises_OnCommand( HWND hwnd,
INT id,
HWND hwndCtrl,
UINT codeNotify )
{
INT i, j;
HWND hwndList;
LRESULT lResult;
switch(id)
{
case IDC_NOISE_LIST:
if (codeNotify == LBN_SELCHANGE)
{
ViewNoises_NoiseChanged(hwnd);
}
break;
case IDC_NOISE_NEW:
i = po->nNoises;
if (i == MAX_NOISES)
{
MsgBox( hwnd,
MB_ICONEXCLAMATION,
"The limit of %d noises has been reached.",
MAX_NOISES );
break;
}
_fmemset(szNewNoiseName, 0, sizeof(szNewNoiseName));
wNewFlags = 0;
nNewSoundIndex = -1;
dNewRadius = 1000.0;
dNewHeight = 3000.0;
nNewDelay = 0;
if (EditNoiseDialog(hwnd) == IDCANCEL)
{
break;
}
hwndList = GetDlgItem(hwnd, IDC_NOISE_LIST);
ListBox_AddString(hwndList, szNewNoiseName);
_fmemset(&po->pNoiseData[i], 0, sizeof(NOISE_DATA));
_fstrcpy(po->pNoiseData[i].noise_name, szNewNoiseName);
po->pNoiseData[i].flags = wNewFlags;
po->pNoiseData[i].sound_index = nNewSoundIndex;
po->pNoiseData[i].radius = (float)dNewRadius;
po->pNoiseData[i].height = (float)dNewHeight;
po->pNoiseData[i].delay = nNewDelay;
++po->nNoises;
ListBox_SetCurSel(hwndList, i);
ViewNoises_NoiseChanged(hwnd);
bChange = TRUE;
break;
case IDC_NOISE_DELETE:
hwndList = GetDlgItem(hwnd, IDC_NOISE_LIST);
lResult = ListBox_GetCurSel(hwndList);
if (lResult >= 0 && lResult < po->nNoises)
{
i = (INT)lResult;
Object_DeleteNoise(po, i);
ListBox_DeleteString(hwndList, i);
if (i == 0)
ListBox_SetCurSel(hwndList, 0);
else
ListBox_SetCurSel(hwndList, i - 1);
ViewNoises_NoiseChanged(hwnd);
bChange = TRUE;
}
break;
case IDC_NOISE_EDIT:
hwndList = GetDlgItem(hwnd, IDC_NOISE_LIST);
lResult = ListBox_GetCurSel(hwndList);
if (lResult >= 0 && lResult < po->nNoises)
//.........这里部分代码省略.........
开发者ID:CireG,项目名称:Alien-Cabal-VEdit,代码行数:101,代码来源:NOISEDLG.C
示例12: MsgBox
void CMonsterAttr::LoadAttr(char* filename)
{
int Token; int n;
if ( fopen_s(&SMDFile,filename, "r") != 0 )
{
MsgBox("load error %s", filename);
return;
}
n= 0;
while ( true )
{
Token = GetToken();
if ( Token == END )
break;
if ( Token == 1 )
{
this->m_MonsterAttr[n].m_Index = (int)TokenNumber;
Token = GetToken(); this->m_MonsterAttr[n].m_Rate = (int)TokenNumber;
Token = GetToken(); strcpy_s(this->m_MonsterAttr[n].m_Name, sizeof(this->m_MonsterAttr[n].m_Name), TokenString);
Token = GetToken(); this->m_MonsterAttr[n].m_Level = (int)TokenNumber;
Token = GetToken(); this->m_MonsterAttr[n].m_Hp = (int)TokenNumber;
Token = GetToken(); this->m_MonsterAttr[n].m_Mp = (int)TokenNumber;
Token = GetToken(); this->m_MonsterAttr[n].m_DamageMin = (int)TokenNumber;
Token = GetToken(); this->m_MonsterAttr[n].m_DamageMax = (int)TokenNumber;
Token = GetToken(); this->m_MonsterAttr[n].m_Defense = (int)TokenNumber;
Token = GetToken(); this->m_MonsterAttr[n].m_MagicDefense = (int)TokenNumber;
Token = GetToken(); this->m_MonsterAttr[n].m_AttackRating = (int)TokenNumber;
Token = GetToken(); this->m_MonsterAttr[n].m_Successfulblocking = (int)TokenNumber;
Token = GetToken(); this->m_MonsterAttr[n].m_MoveRange = (int)TokenNumber;
Token = GetToken(); this->m_MonsterAttr[n].m_AttackType = (int)TokenNumber;
Token = GetToken(); this->m_MonsterAttr[n].m_AttackRange = (int)TokenNumber;
Token = GetToken(); this->m_MonsterAttr[n].m_ViewRange = (int)TokenNumber;
Token = GetToken(); this->m_MonsterAttr[n].m_MoveSpeed = (int)TokenNumber;
Token = GetToken(); this->m_MonsterAttr[n].m_AttackSpeed = (int)TokenNumber;
Token = GetToken(); this->m_MonsterAttr[n].m_RegenTime = (int)TokenNumber;
Token = GetToken(); this->m_MonsterAttr[n].m_Attribute = (int)TokenNumber;
Token = GetToken(); this->m_MonsterAttr[n].m_ItemRate = (int)TokenNumber;
Token = GetToken(); this->m_MonsterAttr[n].m_MoneyRate = (int)TokenNumber;
Token = GetToken(); this->m_MonsterAttr[n].m_MaxItemLevel = (int)TokenNumber;
Token = GetToken(); this->m_MonsterAttr[n].m_MonsterSkill = (DWORD)TokenNumber;
Token = GetToken(); this->m_MonsterAttr[n].m_Resistance[R_ICE] = (BYTE)TokenNumber;
Token = GetToken(); this->m_MonsterAttr[n].m_Resistance[R_POISON] = (BYTE)TokenNumber;
Token = GetToken(); this->m_MonsterAttr[n].m_Resistance[R_LIGHTNING] = (BYTE)TokenNumber;
Token = GetToken(); this->m_MonsterAttr[n].m_Resistance[R_FIRE] = (BYTE)TokenNumber;
this->m_MonsterAttr[n].m_Hp = this->m_MonsterAttr[n].m_Hp - (INT)(this->m_MonsterAttr[n].m_Hp / 100.0f * gMonsterHp);
this->m_MonsterAttr[n].m_iScriptHP = this->m_MonsterAttr[n].m_Hp;
if ( this->m_MonsterAttr[n].m_Level <= 24 && this->m_MonsterAttr[n].m_Index < 50)
{
if ( this->m_MonsterAttr[n].m_Level == 13 ||
this->m_MonsterAttr[n].m_Level == 14 ||
this->m_MonsterAttr[n].m_Level == 17 ||
this->m_MonsterAttr[n].m_Level == 18 ||
this->m_MonsterAttr[n].m_Level == 19 ||
this->m_MonsterAttr[n].m_Level == 24 )
{
int modiryvalue = this->m_MonsterAttr[n].m_Hp*20/100;
modiryvalue-= modiryvalue*gMonsterHPAdjust/100;
this->m_MonsterAttr[n].m_Hp -= modiryvalue;
}
else if ( this->m_MonsterAttr[n].m_Level == 20 ||
this->m_MonsterAttr[n].m_Level == 22 )
{
int modiryvalue = this->m_MonsterAttr[n].m_Hp*30/100;
modiryvalue-= modiryvalue*gMonsterHPAdjust/100;
this->m_MonsterAttr[n].m_Hp -= modiryvalue;
}
else
{
int modiryvalue = this->m_MonsterAttr[n].m_Hp/2;
modiryvalue-= modiryvalue*gMonsterHPAdjust/100;
this->m_MonsterAttr[n].m_Hp -= modiryvalue;
}
}
if ( this->m_MonsterAttr[n].m_Level <= 19 && this->m_MonsterAttr[n].m_Index < 50 )
{
if ( this->m_MonsterAttr[n].m_Level == 13 ||
this->m_MonsterAttr[n].m_Level == 14 ||
this->m_MonsterAttr[n].m_Level == 17 ||
this->m_MonsterAttr[n].m_Level == 18 ||
this->m_MonsterAttr[n].m_Level == 19 )
{
int modiryvaluemin = this->m_MonsterAttr[n].m_DamageMin*30/100;
int modiryvaluemax = this->m_MonsterAttr[n].m_DamageMax*30/100;
modiryvaluemin -= modiryvaluemin*gMonsterHPAdjust/100;
modiryvaluemax -= modiryvaluemax*gMonsterHPAdjust/100;
this->m_MonsterAttr[n].m_DamageMin -= modiryvaluemin;
this->m_MonsterAttr[n].m_DamageMax -= modiryvaluemax;
}
else
{
int modiryvaluemin = this->m_MonsterAttr[n].m_DamageMin/2;
int modiryvaluemax = this->m_MonsterAttr[n].m_DamageMax/2;
//.........这里部分代码省略.........
开发者ID:Hagaib,项目名称:p4f-free-emu,代码行数:101,代码来源:MonsterAttr.cpp
示例13: MsgBox
BOOL TMonsterAIMovePath::LoadData(LPSTR lpszFileName)
{
this->m_bDataLoad = FALSE;
if ( !lpszFileName || !strcmp(lpszFileName, ""))
{
MsgBox("[Monster AI MovePath] - File load error : File Name Error");
return FALSE;
}
try
{
SMDToken Token;
SMDFile = fopen(lpszFileName, "r"); //ok
if ( SMDFile == NULL )
{
MsgBox("[Monster AI MovePath] - Can't Open %s ", lpszFileName);
return FALSE;
}
this->DelAllAIMonsterMovePath();
int iType = -1;
while ( true )
{
Token = GetToken();
if ( Token == END )
break;
iType = TokenNumber;
while ( true )
{
if ( iType == 2 )
{
int iSpotType = -1;
int iMapNumber = -1;
int iX = -1;
int iY = -1;
Token = GetToken();
if ( !strcmp("end", TokenString))
break;
iSpotType = TokenNumber;
Token = GetToken();
iMapNumber = TokenNumber;
Token = GetToken();
iX = TokenNumber;
Token = GetToken();
iY = TokenNumber;
this->m_MovePathInfo[this->m_iMovePathSpotCount].m_iType = iSpotType;
this->m_MovePathInfo[this->m_iMovePathSpotCount].m_iMapNumber = iMapNumber;
this->m_MovePathInfo[this->m_iMovePathSpotCount].m_iPathX = iX;
this->m_MovePathInfo[this->m_iMovePathSpotCount].m_iPathY = iY;
this->m_iMovePathSpotCount++;
if ( this->m_iMovePathSpotCount > MAX_MONSTER_AI_MOVE_PATH )
{
MsgBox("[Monster AI MovePath] Exceed Max Move Path-Spot ");
this->DelAllAIMonsterMovePath();
return FALSE;
}
}
}
}
fclose(SMDFile);
LogAddC(2, "[Monster AI MovePath ] - %s file is Loaded", lpszFileName);
this->m_bDataLoad = TRUE;
}
catch(DWORD)
{
MsgBox("[Monster AI MovePath] - Loading Exception Error (%s) File. ", lpszFileName);
}
return FALSE;
}
开发者ID:331515194,项目名称:zTeamS6.3,代码行数:89,代码来源:TMonsterAIMovePath.cpp
示例14: ViInstallProcessStart
// Start the installation process
void ViInstallProcessStart(HWND hWnd, VI_INSTALL_DLG *d)
{
wchar_t *exew;
bool ok;
char instdir[MAX_PATH];
char hamcore[MAX_PATH];
// Validate arguments
if (hWnd == NULL || d == NULL)
{
return;
}
ViGenerateVpnSMgrTempDirName(instdir, sizeof(instdir), ViGetSuitableArchForCpu()->Build);
ConbinePath(hamcore, sizeof(hamcore), instdir, "hamcore.se2");
exew = setting.DownloadedInstallerPathW;
d->NoClose = true;
Hide(hWnd, IDCANCEL);
SetPos(hWnd, P_PROGRESS, 100);
Hide(hWnd, P_PROGRESS);
Hide(hWnd, S_SIZEINFO);
SetText(hWnd, S_STATUS, _U(IDS_INSTALLSTART+skip));
ok = true;
if (setting.DownloadNotRequired == false)
{
if (setting.WebMode && ViCheckExeSign(hWnd, exew) == false)
{
// The digital signature is not reliable
ok = false;
}
else
{
// Installation
HANDLE hProcess;
SHELLEXECUTEINFOW info;
// Run
Zero(&info, sizeof(info));
info.cbSize = sizeof(info);
info.lpVerb = L"open";
info.lpFile = exew;
info.fMask = SEE_MASK_NOCLOSEPROCESS;
info.lpParameters = L"/HIDESTARTCOMMAND:1 /DISABLEAUTOIMPORT:1 /ISWEBINSTALLER:1";
info.nShow = SW_SHOWNORMAL;
if (ShellExecuteExW(&info) == false)
{
MsgBox(hWnd, MB_ICONSTOP, _U(IDS_INSTALLSTART_ERROR+skip));
ok = false;
}
else
{
hProcess = info.hProcess;
// Wait for the install process to complete
while (true)
{
if (WaitForSingleObject(hProcess, 50) != WAIT_TIMEOUT)
{
break;
}
DoEvents(hWnd);
}
CloseHandle(hProcess);
}
}
}
if (ok && d->WindowsShutdowning == false)
{
VI_SETTING_ARCH *a = ViGetSuitableArchForCpu();
wchar_t arg[MAX_PATH];
wchar_t exe[MAX_PATH];
char *arg1 = "/easy";
// Hide the screen
Hide(hWnd, 0);
if (setting.NormalMode)
{
arg1 = "/normal";
}
// (Just in case) start the VPN Client service
if (MsIsServiceRunning("vpnclient") == false)
{
MsStartService("vpnclient");
}
// Wait for that the service becomes available
SwWaitForVpnClientPortReady(0);
if (UniIsEmptyStr(setting.DownloadedSettingPathW) == false)
{
// Start a connection by importing the configuration file into the VPN Client
UniFormat(arg, sizeof(arg), L"%S \"%s\"", arg1, setting.DownloadedSettingPathW);
}
//.........这里部分代码省略.........
开发者ID:alex-docker,项目名称:CE-dockerfiles,代码行数:101,代码来源:vpninstall.c
示例15: DoMainLoop
extern bool DoMainLoop( dlg_state * state )
/*****************************************/
{
const char *diag_list[MAX_DIAGS + 1];
const char *diags;
const char *dstdir;
int dstlen;
bool got_disk_sizes = FALSE;
int i;
char newdst[_MAX_PATH];
char *next;
bool ret = FALSE;
SetupTitle();
// display initial dialog
diags = GetVariableStrVal( "DialogOrder" );
if( stricmp( diags, "" ) == 0 ) {
diags = "Welcome";
}
i = 0;
for( ;; ) {
diag_list[i] = diags;
next = strchr( diags, ',' );
if( next == NULL ) break;
*next = '\0';
diags = next + 1;
++i;
}
diag_list[i + 1] = NULL;
/* process installation dialogs */
i = 0;
for( ;; ) {
if( i < 0 ) break;
if( diag_list[i] == NULL ) {
if( GetVariableIntVal( "DoCopyFiles" ) == 1 ) {
if( !CheckDrive( TRUE ) ) {
i = 0;
}
}
if( GetVariableByName( "SetupPath" ) != NO_VAR ) {
ret = TRUE;
break;
}
if( diag_list[i] == NULL ) {
StatusShow( TRUE );
ret = SetupOperations();
StatusShow( FALSE );
if( ret ) DoDialog( "Finished" );
break;
}
}
if( stricmp( diag_list[i], "GetDiskSizesHere" ) == 0 ) {
if( *state == DLG_NEXT ) {
dstdir = GetVariableStrVal( "DstDir" );
dstlen = strlen( dstdir );
if( dstlen != 0 &&
(dstdir[dstlen - 1] == '\\' || dstdir[dstlen - 1] == '/') ) {
strcpy( newdst, dstdir );
if( dstlen == 3 && dstdir[1] == ':' ) {
newdst[dstlen] = '.';
newdst[dstlen + 1] = '\0';
} else {
newdst[dstlen - 1] = '\0';
}
SetVariableByName( "DstDir", newdst );
}
SimSetNeedGetDiskSizes();
ResetDiskInfo();
got_disk_sizes = TRUE;
}
} else {
*state = DoDialog( diag_list[i] );
GUIWndDirty( NULL );
StatusCancelled();
}
if( *state == DLG_CAN ) {
if( MsgBox( NULL, "IDS_QUERYABORT", GUI_YES_NO ) == GUI_RET_YES ) {
CancelSetup = TRUE;
break;
}
} else if( *state == DLG_DONE ) {
CancelSetup = TRUE;
break;
}
if( got_disk_sizes ) {
if( !CheckDrive( FALSE ) ) {
break;
}
}
if( *state == DLG_SAME ) {
/* nothing */
} else if( *state == DLG_NEXT || *state == DLG_SKIP ) {
if( SkipDialogs ) {
++i;
} else {
for( ;; ) {
//.........这里部分代码省略.........
开发者ID:Ukusbobra,项目名称:open-watcom-v2,代码行数:101,代码来源:setup.c
示例16: PSPProcContactProfile
//.........这里部分代码省略.........
TCHAR szText[MAX_PATH];
PSGetBoldFont(hDlg, hBold);
hFont = (HFONT)SelectObject(cd->nmcd.hdc, hBold);
SetTextColor(cd->nmcd.hdc, GetSysColor(COLOR_3DSHADOW));
ProfileList_GetItemText(cd->nmcd.hdr.hwndFrom, cd->nmcd.dwItemSpec, 0, szText, MAX_PATH);
rc.left += 6;
DrawText(cd->nmcd.hdc, TranslateTS(szText), -1, &rc, DT_NOCLIP|DT_NOPREFIX|DT_SINGLELINE|DT_VCENTER);
rc.bottom -= 2;
rc.top = rc.bottom - 1;
rc.left -= 6;
DrawEdge(cd->nmcd.hdc, &rc, BDR_SUNKENOUTER, BF_RECT);
SelectObject(cd->nmcd.hdc, hFont);
SetWindowLongPtr(hDlg, DWLP_MSGRESULT, CDRF_SKIPDEFAULT);
return TRUE;
}
// draw selected item
if ((cd->nmcd.uItemState & CDIS_SELECTED) || (pList->labelEdit.iItem == cd->nmcd.dwItemSpec)) {
SetTextColor(cd->nmcd.hdc, GetSysColor(COLOR_HIGHLIGHTTEXT));
FillRect(cd->nmcd.hdc, &rc, GetSysColorBrush(COLOR_HIGHLIGHT));
}
// draw background of unselected item
else {
SetTextColor(cd->nmcd.hdc,
(pItem->wFlags & CTRLF_CHANGED)
? clrChanged : (pItem->wFlags & CTRLF_HASMETA)
? clrMeta : ((pItem->wFlags & (CTRLF_HASCUSTOM)) && (pItem->wFlags & CTRLF_HASPROTO))
? clrBoth : (pItem->wFlags & CTRLF_HASCUSTOM)
? clrCustom : clrNormal);
FillRect(cd->nmcd.hdc, &rc, GetSysColorBrush(COLOR_WINDOW));
}
SetWindowLongPtr(hDlg, DWLP_MSGRESULT, CDRF_NEWFONT|CDRF_NOTIFYSUBITEMDRAW);
return TRUE;
case CDDS_SUBITEM|CDDS_ITEMPREPAINT:
{
HFONT hoFont = (HFONT)SelectObject(cd->nmcd.hdc, pList->hFont);
ListView_GetSubItemRect(cd->nmcd.hdr.hwndFrom, cd->nmcd.dwItemSpec, cd->iSubItem, LVIR_BOUNDS, &rc);
if (cd->iSubItem == 0) {
RECT rc2;
ListView_GetSubItemRect(cd->nmcd.hdr.hwndFrom, cd->nmcd.dwItemSpec, 1, LVIR_BOUNDS, &rc2);
rc.right = rc2.left;
}
rc.left += 3;
DrawText(cd->nmcd.hdc,
pItem->pszText[cd->iSubItem]
? pItem->pszText[cd->iSubItem]
: (cd->iSubItem == 0 && pItem->idstrList && pItem->iListItem > 0 && pItem->iListItem < pItem->idstrListCount)
? pItem->idstrList[pItem->iListItem].ptszTranslated
: TranslateT("<empty>"),
-1, &rc, DT_END_ELLIPSIS|DT_NOCLIP|DT_NOPREFIX|DT_SINGLELINE|DT_VCENTER);
SetWindowLongPtr(hDlg, DWLP_MSGRESULT, CDRF_SKIPDEFAULT);
return TRUE;
}
} /* switch (cd->nmcd.dwDrawStage) */
break;
} /* case NM_CUSTOMDRAW: */
} /* (((LPNMHDR)lParam)->code) */
break;
}
}
break; /* case WM_NOTIFY: */
case WM_COMMAND:
{
switch (LOWORD(wParam)) {
case BTN_ADD_intEREST:
return ProfileList_AddNewItem(hDlg, (LPLISTCTRL)GetUserData(hList), &pFmt[2]);
case BTN_ADD_AFFLIATION:
return ProfileList_AddNewItem(hDlg, (LPLISTCTRL)GetUserData(hList), &pFmt[1]);
case BTN_ADD_PAST:
return ProfileList_AddNewItem(hDlg, (LPLISTCTRL)GetUserData(hList), &pFmt[0]);
case BTN_EDIT_CAT:
ProfileList_BeginLabelEdit(hList, ListView_GetSelectionMark(hList), 0);
break;
case BTN_EDIT_VAL:
ProfileList_BeginLabelEdit(hList, ListView_GetSelectionMark(hList), 1);
break;
case BTN_DEL:
if (IDYES == MsgBox(hDlg, MB_YESNO|MB_ICON_QUESTION, LPGENT("Question"), LPGENT("Delete an entry"), LPGENT("Do you really want to delete this entry?"))) {
INT iItem = ListView_GetSelectionMark(hList);
LPLISTCTRL pList = (LPLISTCTRL)GetUserData(hList);
ProfileList_DeleteItem(hList, iItem);
if (PtrIsValid(p
|
请发表评论