本文整理汇总了C++中PluginStartupInfo::Control方法的典型用法代码示例。如果您正苦于以下问题:C++ PluginStartupInfo::Control方法的具体用法?C++ PluginStartupInfo::Control怎么用?C++ PluginStartupInfo::Control使用的例子?那么, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类PluginStartupInfo
的用法示例。
在下文中一共展示了PluginStartupInfo::Control方法的2个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的C++代码示例。
示例1: cmd
int Panel::ProcessEvent(int Event, void *Param) {
if (Event == FE_COMMAND) {
PCWSTR cmd((PCWSTR)Param);
if (cmd) {
int argc = 0;
PWSTR *argv = ::CommandLineToArgvW(cmd, &argc);
if (argc > 1 && Eqi(argv[0], L"cd")) {
try {
psi.Control(this, FCTL_REDRAWPANEL, 0, nullptr);
ConnectingToServer(argv[1]);
winstd::shared_ptr<RemoteConnection> tmp(new RemoteConnection(argv[1]));
WinTS tts(tmp->host());
m_ts = tts;
m_conn.swap(tmp);
psi.Control(this, FCTL_SETCMDLINE, 0, (LONG_PTR)EMPTY_STR);
psi.Control(this, FCTL_UPDATEPANEL, 0, nullptr);
psi.Control(this, FCTL_REDRAWPANEL, 0, nullptr);
} catch (WinError &e) {
if (e.code() == ERROR_ACCESS_DENIED) {
AccesDeniedErrorMessage();
} else {
farebox_code(e.code(), e.where().c_str());
}
}
}
::LocalFree(argv);
return true;
}
}
return false;
}
示例2: pInfo
int Panel::ProcessKey(int Key, unsigned int ControlState) {
switch (Key) {
case VK_F3:
if (ControlState == PKF_SHIFT) {
return true;
}
break;
case VK_F4:
switch (ControlState) {
case 0:
DlgShutdown();
return true;
case PKF_SHIFT:
return true;
}
break;
case VK_F6:
switch (ControlState) {
case 0:
if (DlgConnection()) {
psi.Control(this, FCTL_UPDATEPANEL, 0, nullptr);
psi.Control(this, FCTL_REDRAWPANEL, 0, nullptr);
}
return true;
case PKF_SHIFT:
try {
m_conn->Open(nullptr);
} catch (WinError &e) {
farebox_code(e.code(), e.where().c_str());
}
psi.Control(this, FCTL_UPDATEPANEL, 0, nullptr);
psi.Control(this, FCTL_REDRAWPANEL, 0, nullptr);
return true;
}
break;
case VK_F7:
switch (ControlState) {
case 0:
AutoUTF cmd = L"mstsc.exe";
if (!Empty(m_conn->host())) {
cmd += L" /v:";
cmd += m_conn->host();
}
ExecCMD(cmd);
return true;
}
break;
}
if ((ControlState == 0 && (Key == VK_F3 || Key == VK_F5 || Key == VK_F8)) ||
(ControlState == PKF_SHIFT && (Key == VK_F7 || Key == VK_F8))) {
FarPnl pInfo(this, FCTL_GETPANELINFO);
WinTS::iterator m_cur;
if (pInfo.ItemsNumber() && pInfo.CurrentItem() &&
(m_cur = std::find(m_ts.begin(), m_ts.end(), pInfo[pInfo.CurrentItem()].FindData.nFileSize)) != m_ts.end()) {
if (ControlState == 0 && Key == VK_F3) {
AutoUTF tmp(TempFile(TempDir()));
HANDLE hfile = ::CreateFileW(tmp.c_str(), GENERIC_WRITE, 0, nullptr, CREATE_ALWAYS, FILE_ATTRIBUTE_NORMAL, nullptr);
if (hfile != INVALID_HANDLE_VALUE) {
FileWrite(hfile, Info(m_cur));
::CloseHandle(hfile);
psi.Viewer(tmp.c_str(), nullptr, 0, 0, -1, -1,
VF_DELETEONLYFILEONCLOSE | VF_ENABLE_F6 | VF_DISABLEHISTORY |
VF_NONMODAL | VF_IMMEDIATERETURN, CP_AUTODETECT);
}
return true;
} else if (ControlState == 0 && Key == VK_F5) {
DlgMessage(m_cur->id());
} else if (ControlState == PKF_SHIFT && Key == VK_F7) {
WinTSession::ConnectLocal(m_cur->id());
} else if (ControlState == 0 && Key == VK_F8) {
if (farquestion(GetMsg(txtAreYouSure), GetMsg(txtDisconnectSession)))
WinTSession::Disconnect(m_cur->id(), m_conn->host());
} else if (ControlState == PKF_SHIFT && Key == VK_F8) {
if (farquestion(GetMsg(txtAreYouSure), GetMsg(txtLogoffSession)))
WinTSession::LogOff(m_cur->id(), m_conn->host());
}
psi.Control(this, FCTL_UPDATEPANEL, 0, nullptr);
psi.Control(this, FCTL_REDRAWPANEL, 0, nullptr);
return true;
}
}
return false;
}