当前位置: 首页>>代码示例>>C++>>正文


C++ PluginStartupInfo::Message方法代码示例

本文整理汇总了C++中PluginStartupInfo::Message方法的典型用法代码示例。如果您正苦于以下问题:C++ PluginStartupInfo::Message方法的具体用法?C++ PluginStartupInfo::Message怎么用?C++ PluginStartupInfo::Message使用的例子?那么, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在PluginStartupInfo的用法示例。


在下文中一共展示了PluginStartupInfo::Message方法的3个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的C++代码示例。

示例1: FarErrorHandler

static void FarErrorHandler(const wchar_t* s)
{
	const wchar_t* items[]={ L"Framework Error", s, L"OK", L"Debug" };
	if (Info.Message(&MainGuid, &MainGuid, FMSG_WARNING, NULL, items, 4, 2) == 1) {
		DebugBreak();
	}
}
开发者ID:starcat13,项目名称:FileCopyEx,代码行数:7,代码来源:FileCopyEx.cpp

示例2: settings

static intptr_t WINAPI MainDialogProc(HANDLE hDlg,intptr_t Msg,intptr_t Param1,void* Param2)
{
  BoardParams* DlgParams=(BoardParams*)Info.SendDlgMessage(hDlg,DM_GETDLGDATA,0,0);
  //if(Msg==DN_KEY&&Param2==KEY_ENTER) return TRUE;
  switch(Msg)
  {
    case DN_INITDIALOG:
      Info.SendDlgMessage(hDlg,DM_RESETBOARD,0,0);
      SetFocus(true);
      break;
    case DN_CONTROLINPUT:
      {
        const INPUT_RECORD* record=(const INPUT_RECORD*)Param2;
        if(record->EventType==KEY_EVENT&&record->Event.KeyEvent.bKeyDown)
        {
          KillFocus();
          if(IsNone(record))
          {
            switch(record->Event.KeyEvent.wVirtualKeyCode)
            {
              case VK_UP:
                DlgParams->curr_col--;
                break;
              case VK_DOWN:
                DlgParams->curr_col++;
                break;
              case VK_LEFT:
                DlgParams->curr_row--;
                break;
              case VK_RIGHT:
                DlgParams->curr_row++;
                break;
              case VK_HOME:
                DlgParams->curr_row=0;
                break;
              case VK_END:
                DlgParams->curr_row=DlgParams->width-1;
                break;
              case VK_PRIOR:
                DlgParams->curr_col=0;
                break;
              case VK_NEXT:
                DlgParams->curr_col=DlgParams->height-1;
                break;
              case L' ':
                {
                  Info.SendDlgMessage(hDlg,DM_ENABLEREDRAW,FALSE,0);
                  if(!DlgParams->finished)
                  {
                    if(!DlgParams->started) Info.SendDlgMessage(hDlg,DM_START_GAME,0,0);
                    OpenPlace(hDlg,DlgParams,DlgParams->curr_row,DlgParams->curr_col,COP_CHECK_ALL);
                  }
                  Info.SendDlgMessage(hDlg,DM_ENABLEREDRAW,TRUE,0);
                }
                break;
              case VK_DELETE:
                {
                  Info.SendDlgMessage(hDlg,DM_ENABLEREDRAW,FALSE,0);
                  if(!DlgParams->finished)
                  {
                    FarDialogItem DialogItem;
                    Info.SendDlgMessage(hDlg,DM_GETDLGITEMSHORT,DlgParams->width*DlgParams->curr_col+DlgParams->curr_row,&DialogItem);
                    switch(GET_DATA_1(DialogItem))
                    {
                      case STATE_CLOSE:
                        SET_DATA_1(DialogItem,STATE_MARKED);
                        DlgParams->curr_mines++;
                        break;
                      case STATE_OPEN:
                        break;
                      case STATE_MARKED:
                        SET_DATA_1(DialogItem,STATE_CLOSE);
                        DlgParams->curr_mines--;
                        break;
                    }
                    Info.SendDlgMessage(hDlg,DM_SETDLGITEMSHORT,DlgParams->width*DlgParams->curr_col+DlgParams->curr_row,&DialogItem);
                    Info.SendDlgMessage(hDlg,DM_SHOWTIME,0,0);
                  }
                  Info.SendDlgMessage(hDlg,DM_ENABLEREDRAW,TRUE,0);
                }
                break;
              case VK_F2:
                DlgParams->started=false;
                DlgParams->finished=FINISH_NO;
                Info.SendDlgMessage(hDlg,DM_SETTEXTPTR,DlgParams->width*DlgParams->height,const_cast<wchar_t*>(GetMsg(mStart)));
                Info.SendDlgMessage(hDlg,DM_RESETBOARD,0,0);
                break;
              case VK_F3:
                {
                  wchar_t ScoreKeyName[1024],PlayerKeyName[1024];
                  FSF.sprintf(ScoreKeyName,L"Score_%d_%d_%d",DlgParams->width,DlgParams->height,DlgParams->mines);
                  FSF.sprintf(PlayerKeyName,L"Player_%d_%d_%d",DlgParams->width,DlgParams->height,DlgParams->mines);
                  CFarSettings settings(MainGuid);
                  __int64 Score; wchar_t Name[512];
                  Score=settings.Get(ScoreKeyName,-1);
                  if(!settings.Get(PlayerKeyName,Name,sizeofa(Name))) Name[0]=0;
                  if(Score>=0&&Name[0])
                  {
                    wchar_t buffer[1024];
                    FSF.sprintf(buffer,GetMsg(mHighscoreFormat),Name,(long)Score);
//.........这里部分代码省略.........
开发者ID:Maximus5,项目名称:evil-programmers,代码行数:101,代码来源:farmine.cpp

示例3: if

HANDLE	WINAPI	EXP_NAME(OpenPlugin)(int OpenFrom, INT_PTR Item) {
//	Options.Read();

	AutoUTF	cline;
	if (OpenFrom == OPEN_PLUGINSMENU) {
		FarPnl	pi(PANEL_ACTIVE);
		if (pi.IsOK()) {
			AutoUTF	buf(MAX_PATH_LEN, L'\0');
			fsf.GetCurrentDirectory(buf.capacity(), (PWSTR)buf.c_str());
			if (!buf.empty())
				::PathAddBackslash((PWSTR)buf.c_str());

			PluginPanelItem &PPI = pi[pi.CurrentItem()];
			buf += PPI.FindData.lpwszFileName;
			cline = buf;
		}
	} else if (OpenFrom == OPEN_COMMANDLINE) {
		cline = (PCWSTR)Item;
	}
	FarList	users;
	if (InitUsers(users)) {
		enum {
			HEIGHT = 14,
			WIDTH = 48,
		};
		InitDialogItemF	Items[] = {
			{DI_DOUBLEBOX, 3, 1, WIDTH - 4, HEIGHT - 2, 0, (PCWSTR)DlgTitle},
			{DI_TEXT,      5, 2, 0,  0,  0, (PCWSTR)MUsername},
			{DI_COMBOBOX,  5, 3, 42, 0,  DIF_SELECTONENTRY, L""},
			{DI_TEXT,      5, 4, 0,  0,  0, (PCWSTR)MPasword},
			{DI_PSWEDIT,   5, 5, 42, 0,  0, L""},
			{DI_CHECKBOX , 5, 6, 42, 0,  0, (PCWSTR)MRestricted},
			{DI_TEXT,      0, 7, 0,  0,  DIF_SEPARATOR, L""},
			{DI_TEXT,      5, 8, 0,  0,  0, (PCWSTR)MCommandLine},
			{DI_EDIT,      5, 9, 42, 0,  DIF_HISTORY, cline.c_str()},
			{DI_TEXT,      0,  HEIGHT - 4, 0,  0,  DIF_SEPARATOR,   L""},
			{DI_BUTTON,    0,  HEIGHT - 3, 0,  0,  DIF_CENTERGROUP, (PCWSTR)txtBtnOk},
			{DI_BUTTON,    0,  HEIGHT - 3, 0,  0,  DIF_CENTERGROUP, (PCWSTR)txtBtnCancel},
		};
		size_t	size = sizeofa(Items);
		FarDialogItem FarItems[size];
		InitDialogItemsF(Items, FarItems, size);
		FarItems[size - 2].DefaultButton = 1;
		FarItems[2].ListItems = &users;
		FarItems[8].History = L"runas.comline";

		FarDlg hDlg;
		if (hDlg.Init(psi.ModuleNumber, -1, -1, WIDTH, HEIGHT, L"Contents", FarItems, size)) {
			HRESULT	err = NO_ERROR;
			while (true) {
				int		ret = hDlg.Run();
				if (ret > 0 && Items[ret].Data == (PCWSTR)txtBtnOk) {
					AutoUTF	cmd(hDlg.Str(8));
					if (hDlg.Check(5)) {
						err = ExecRestricted(cmd.c_str());
					} else {
						AutoUTF	user(hDlg.Str(2));
						AutoUTF	pass(hDlg.Str(4));
						err = ExecAsUser(cmd.c_str(), user.c_str(), pass.c_str());
					}
					if (err == NO_ERROR) {
						break;
					} else {
						PCWSTR Msg[] = {GetMsg(MError), cmd.c_str(), L"", GetMsg(txtBtnOk), };
						::SetLastError(err);
						psi.Message(psi.ModuleNumber, FMSG_WARNING | FMSG_ERRORTYPE,
									L"Contents", Msg, sizeofa(Msg), 1);
					}
				} else {
					break;
				}
			}
		}
		FreeUsers(users);
	}
	return	INVALID_HANDLE_VALUE;
}
开发者ID:IDA-RE-things,项目名称:andrew-grechkin,代码行数:77,代码来源:main.cpp


注:本文中的PluginStartupInfo::Message方法示例由纯净天空整理自Github/MSDocs等开源代码及文档管理平台,相关代码片段筛选自各路编程大神贡献的开源项目,源码版权归原作者所有,传播和使用请参考对应项目的License;未经允许,请勿转载。