博客首页
注册
建议与交流
排行榜
加入友情链接
推荐
投诉
搜索:
帮助
Hello World
testdev.cublog.cn
管理博客
发表文章
留言
收藏夹
博客圈
音乐
相册
文章
· 临时文件
· GUI测试技术
· STK股票小智慧
· 桌面小工具
· 网络搞笑收集
首页
关于作者
姓名:WangYang 职业:Software Engineer 年龄:26 位置:Beijing 个性介绍:为桌面增添价值 我的主页: www.dtapp.cn
||
<<
>>
||
我的分类
文章列表 - GUI测试技术
逐行读写文本的Demo程序
<P> </P> <TABLE style="BORDER-COLLAPSE: collapse" borderColor=#999999 cellSpacing=0 cellPadding=0 width="95%" bgColor=#f1f1f1 border=1> <TBODY> <TR> <TD> <P style="MARGIN: 5px; LINE-HEIGHT: 150%"><CODE><SPAN style="COLOR: #000000"><SPAN style="COLOR: #0000cc">#</SPAN><SPAN style="COLOR: #ff0000">include</SPAN> <SPAN style="COLOR: #0000cc"><</SPAN>stdio<SPAN style="COLOR: #0000cc">.</SPAN>h<SPAN style="COLOR: #0000cc">></SPAN><BR><SPAN style="COLOR: #0000cc">#</SPAN><SPAN style="C……
查看全文
发表于:2006-10-12 ┆
阅读(1488)
┆
评论(0)
API 实现关机,注销,重启
<DIV>#include <stdio.h><BR>#include <string.h><BR>#include <windows.h><BR>/*对被调用函数ExitWindowsEx的声明*/<BR>BOOL ExitWindowsEx(UINT uFlags,DWORD dwReserved);<BR>int main(int argc,char* argv[])<BR>{<BR> HANDLE hToken;<BR> TOKEN_PRIVILEGES tkp;<BR> DWORD dwVersion;<BR> dwVersion=GetVersion(); /*取得当前操……
查看全文
发表于:2006-08-26 ┆
阅读(1454)
┆
评论(1)
自动下拉IE地址栏
void showdpopdown()<br>{<br>//查找IE地址栏<br>HWND IEFrame;<br>HWND WorkerW;<br>HWND ReBarWindow32;<br>HWND ComboBoxEx32;<br>HWND ComboBox;<br><br>IEFrame = ::FindWindow("IEFrame",NULL);<br>::SetForegroundWindow(IEFrame); //让IE在前端显示<br>WorkerW = FindWindowEx(IEFrame,NULL,"WorkerW",NULL);<br>ReBarWindow32 = FindWindowEx(WorkerW,NULL,"ReBarWindow32",NULL);<br>ComboBoxEx32 = FindWindowEx(ReBarWindow32,NULL,"ComboBoxEx32",NULL);<br>ComboBox = FindWindowEx(ComboBoxEx32,NULL,"C……
查看全文
发表于:2006-08-11 ┆
阅读(1491)
┆
评论(0)
检查checkbox是否被选中
<DIV>void checkCB()<BR>{//检查checkbox是否被选中<BR> HWND hwndCB = FindWindow(NULL,"DemoForm");<BR> hwndCB = FindWindowEx(hwndCB,NULL,NULL,"Check1");<BR> //int a = ((CButton*)GetDlgItem(hwndCB,00400000))->GetCheck();</DIV> <DIV> GetDlgItem(hwndCB,00400000);<BR> int a = (int)::SendMessage(hwndCB, BM_GETCHECK, 0, 0); <BR>}</DIV>
查看全文
发表于:2006-08-06 ┆
阅读(2165)
┆
评论(0)
自动在IE地址栏执行输入操作
<DIV>void IE_alive()<BR>{//在IE地址栏点左键</DIV> <DIV> //找到IE地址栏<BR> HWND hWnd = FindWindow("IEFrame",NULL);<BR> SetForegroundWindow(hWnd); //前端显示<BR> hWnd = FindWindowEx(hWnd,NULL,"WorkerW",NULL);<BR> hWnd = FindWindowEx(hWnd,NULL,"ReBarWindow32",NULL);<BR> hWnd = FindWindowEx(hWnd,NULL,"ComboBoxEx32",NULL);<BR> hWnd = FindWindowEx(hWnd,NULL,"ComboBox",NULL);<BR> hWnd = FindWindowEx(hWnd,NULL,"Edit",NULL);</DIV> <DIV><BR> //定位鼠标<……
查看全文
发表于:2006-08-06 ┆
阅读(1495)
┆
评论(0)
EnumChildWindows使用
<P>BOOL CALLBACK EnumChildProc(HWND hwndChild,LPARAM lParam)<BR>{<BR> TCHAR szWndTitle[1024];<BR> int nLen = GetWindowText(hwndChild,szWndTitle,1024);<BR> if(nLen)<BR> {<BR> AfxMessageBox(szWndTitle);<BR> }<BR> return TRUE;<BR>}</P> <P><BR>void test() <BR>{<BR> CString strWindwoName="DemoForm";<BR> HWND hNMMainWnd = FindWindowEx(NULL,NULL,NULL,strWindwoName);<BR> EnumChildWindows(hNMMainWnd,EnumChildProc,NULL);<BR>}<BR></P> <DIV></DIV> <……
查看全文
发表于:2006-08-05 ┆
阅读(2172)
┆
评论(0)