HWND GetConsoleHwnd(void)
{
#define MY_BUFSIZE 1024 // Buffer size for console window titles.
HWND hwndFound; // This is what is returned to the caller.
char pszNewWindowTitle[MY_BUFSIZE]; // Contains fabricated
// WindowTitle.
char pszOldWindowTitle[MY_BUFSIZE]; // Contains original
// WindowTitle. // Fetch current window title. GetConsoleTitle(pszOldWindowTitle, MY_BUFSIZE); // Format a "unique" NewWindowTitle. wsprintf(pszNewWindowTitle,"%d/%d",
GetTickCount(),
GetCurrentProcessId()); // Change current window title. SetConsoleTitle(pszNewWindowTitle); // Ensure window title has been updated. Sleep(40); // Look for NewWindowTitle. hwndFound=FindWindow(NULL, pszNewWindowTitle); // Restore original window title. SetConsoleTitle(pszOldWindowTitle); return(hwndFound);
}

  

最新文章

  1. Python自动化之模板继承和cookie
  2. [css]我要用css画幅画(八) - Hello Kitty
  3. 关于js中的时间处理
  4. 【cpp】Vector
  5. 人生导师——如何学习C++的Windows方向
  6. 启动页面设置,icon图标设置
  7. C#文件读写常用类介绍
  8. JBPM学习(六):详解流程图
  9. linux系统中.bashrc的妙用
  10. HTTP连接池
  11. Pandas 基础(12) - Stack 和 Unstack
  12. 48-Python 安装pyautogui失败解决办法
  13. gist.github.com 被墙无法访问解决办法
  14. sqlserver数据库导出成insert语句
  15. Struts2初学 Struts2在Action获取内置对象request,session,application(即ServletContext)
  16. MySQL Binlog解析(1)
  17. March 2 2017 Week 9 Thursday
  18. win10子系统Ubuntu18.04下安装图形界面
  19. 8. sql 片段
  20. Python函数(1)

热门文章

  1. 所有依赖的jar将提取到lib目录
  2. Mysql Federated Server 示例
  3. vue开发关于微信授权登录以及路由mode模式(Hash|History)和手机平台(andriod|IOS)不得不说的故事
  4. [hdu3934] 凸包 旋转卡壳
  5. ZOJ 3953 Intervals
  6. [转]如何在 JS 代码中消灭 for 循环
  7. lambda 表达式+python内置函数
  8. (转)Ubuntu 16.04 安裝Docker(PS:本文适用amd64位的ubuntu系统)
  9. margin padding 图
  10. Scrapy学习篇(三)之创建项目