惯性聚合 高效追踪和阅读你感兴趣的博客、新闻、科技资讯
阅读原文 在惯性聚合中打开

推荐订阅源

freeCodeCamp Programming Tutorials: Python, JavaScript, Git & More
腾讯CDC
cs.AI updates on arXiv.org
cs.AI updates on arXiv.org
L
LINUX DO - 热门话题
D
Darknet – Hacking Tools, Hacker News & Cyber Security
Project Zero
Project Zero
V
Vulnerabilities – Threatpost
Cisco Talos Blog
Cisco Talos Blog
P
Palo Alto Networks Blog
C
Cisco Blogs
A
Arctic Wolf
月光博客
月光博客
The GitHub Blog
The GitHub Blog
T
The Blog of Author Tim Ferriss
量子位
小众软件
小众软件
Latest news
Latest news
OSCHINA 社区最新新闻
OSCHINA 社区最新新闻
Microsoft Security Blog
Microsoft Security Blog
T
The Exploit Database - CXSecurity.com
Security Latest
Security Latest
N
Netflix TechBlog - Medium
K
Kaspersky official blog
人人都是产品经理
人人都是产品经理
Cyber Security Advisories - MS-ISAC
Cyber Security Advisories - MS-ISAC
博客园_首页
Y
Y Combinator Blog
P
Proofpoint News Feed
H
Hackread – Cybersecurity News, Data Breaches, AI and More
M
MIT News - Artificial intelligence
T
Threat Research - Cisco Blogs
S
Schneier on Security
D
Docker
Scott Helme
Scott Helme
MyScale Blog
MyScale Blog
Spread Privacy
Spread Privacy
cs.CL updates on arXiv.org
cs.CL updates on arXiv.org
Threat Intelligence Blog | Flashpoint
Threat Intelligence Blog | Flashpoint
GbyAI
GbyAI
有赞技术团队
有赞技术团队
Google DeepMind News
Google DeepMind News
The Hacker News
The Hacker News
H
Help Net Security
Simon Willison's Weblog
Simon Willison's Weblog
J
Java Code Geeks
C
Cyber Attacks, Cyber Crime and Cyber Security
T
Tenable Blog
B
Blog
Know Your Adversary
Know Your Adversary
IT之家
IT之家

博客园 - max chan

企业管理软件开发XP iframe 高度自动调节,最简单解决 被逼上 Visual Studio 2008 被逼上 visual studio 2005 FLL - C++与VFP 双向混合编程 C++ 松花江上 函数glDefinePopup(),动态定义多级的popup菜单 复习 树-递归 全面自定义 - 代码挂接 设计原则 聪明与代价 VFP程序,全面自定义之表单/类 VFP通用代码(vcx/scx/prg)混淆器,可以下载了 备份策略 死里逃生 先舍后得 VFP -> dot net 过渡 -- foxpro toolkit for dot net VFP与DOT NET之间的过渡 - SEDNA
超级gnFindWindow
max chan · 2007-10-16 · via 博客园 - max chan

gnFindWindow(String caption, integer nParentHwnd)

功能:递归式查找所有的窗口,包括多层的子窗口,以找到标题为包含<参数1>的窗口句柄。

这样可以找到报表窗口了。
一般情况下,在VFP里处理不到报表窗口,用这函数取得它句柄后,就可以随心所欲的处置它了。

参数1 :窗口标题的一部分文本。
参数2(选项):父窗口句柄 hwnd,用来限定搜索的范围。不指定的话,以windows desktop 作范围,即在windows所有窗口及子窗口中查找。

返回:窗口句柄。

例子:gnFindWindow('Report Designer', _vfp.hwnd) 

{"gnFindWindow", (FPFI) gnFindWindow, 2,"C,.I"}

HWND FindWindowByCaption(HWND hParentWin, char * caption)
// hParentWin为0,则取desktop
    HWND hChild,hNext,hResult=0;
    
char cTmp[100] ;
    
string pattern =  caption  ;if(hParentWin==0)
        hParentWin
=GetDesktopWindow();     
    
    
//(0) 每次的处理:比较窗口标题 
    GetWindowText(hParentWin,cTmp,100);
    
string s = cTmp;
    
    
//(1) 退出条件:找到 包含caption的窗口
    if( s.find(pattern,0!= 0xffffffff ) 
        
return hParentWin;
    
    
//(2) 退出条件: 无子窗口 
    if( (hChild=GetWindow(hParentWin,GW_CHILD) )==0 )
        
return hResult; //(3) 进入方法:列举本窗口下的所有子窗口 
    hNext = hChild ; 
    
while( hNext !=0 )
    {
        
if( (hResult=FindWindowByCaption(hNext,caption))!=0 )
            
return hResult; 

        hNext 

= GetWindow(hNext,GW_HWNDNEXT);
    }
    
return hResult;
}
void gnFindWindow(ParamBlk FAR *parm)
// char cCaption, int hParent
    HWND hParent = parm->pCount==1 ? 0:(HWND) parm->p[1].val.ev_long  ;

    NullTerminate(

&parm->p[0].val);
    
char * cCaption = (char*) _HandToPtr(parm->p[0].val.ev_handle);

    _RetInt( (

long) FindWindowByCaption(hParent, cCaption), 30);
}

写C++,真是不容易呵,过后再看C#,小菜一碟