1.添加头文件:#include<Windows.h>

2.添加库LIBS+=User32.LIB   

3.添加相关代码:

 

QStringClassName("YodaoWordBookClass");
QStringAppName(tr("有道单词本"));

LPCWSTRApp=reinterpret_cast<LPCWSTR>(ClassName.data());
LPCWSTRAppCaption=reinterpret_cast<LPCWSTR>(AppName.data());
//亦可不用上面两名,直接转换即可,ClassName.utf16(),AppName.utf16())
if(AppWnd=::FindWindow(App,AppCaption))
{
::ShowWindow(AppWnd,SW_SHOWNORMAL);
}
else
{
ui->youDaoTitle_lineEdit->setText(tr("单词本打开失败"));
}

 

 

 

相关文章:

  • 2021-06-18
  • 2021-08-04
  • 2021-06-30
  • 2022-12-23
  • 2022-12-23
  • 2021-08-19
  • 2022-12-23
  • 2022-01-03
猜你喜欢
  • 2021-08-22
  • 2022-12-23
  • 2022-12-23
  • 2022-12-23
  • 2021-04-05
  • 2021-10-12
相关资源
相似解决方案