新建一个项目,添加一个button
procedure TForm1.Button1Click(Sender: TObject);
var
hw,h1,h2,h3,h4,h5:HWND;
begin
hw:=0;
h1 :=0;
h2 :=0;
h3 :=0;
winExeC(PChar('control userpasswords2'),SW_SHOW );
hw :=findwindow(nil, '用户帐户');
if hw=0 then
exit;
h1 :=FindWindowEX(hw,0,'SysTabControl32',nil);
if h1=0 then
exit;
//sleep(1000);
SendMessage(h1,$1330, 1, 0);
h2 :=FindWindowEX(hw,0,'#32770','高级');
if h2=0 then
exit;
h3 :=FindWindowEX(h2,0,'Button','管理密码(&M)');
if h3=0 then
exit;
SendMessage(h3,BM_CLICK, 1, 0);
hw:=0;
h1 :=0;
h2 :=0;
h3 :=0;
hw :=findwindow(nil, '存储用户名和密码');
if hw=0 then
showmessage('error1');
h1 :=FindWindowEX(hw,0,'Button','添加(&A)');
if h1=0 then
showmessage('error2');
SendMessage(h1,BM_CLICK, 1, 0);
//sleep(100);
//hw :=0;
h2 :=FindWindowEX(hw,0,'#32770','登录信息属性');
//hw :=findwindow(nil, '登录信息属性');
if h2=0 then
showmessage('error3');
end;
procedure TForm1.Button1Click(Sender: TObject);
var
hw,h1,h2,h3,h4,h5:HWND;
begin
hw:=0;
h1 :=0;
h2 :=0;
h3 :=0;
winExeC(PChar('control userpasswords2'),SW_SHOW );
hw :=findwindow(nil, '用户帐户');
if hw=0 then
exit;
h1 :=FindWindowEX(hw,0,'SysTabControl32',nil);
if h1=0 then
exit;
//sleep(1000);
SendMessage(h1,$1330, 1, 0);
h2 :=FindWindowEX(hw,0,'#32770','高级');
if h2=0 then
exit;
h3 :=FindWindowEX(h2,0,'Button','管理密码(&M)');
if h3=0 then
exit;
SendMessage(h3,BM_CLICK, 1, 0);
hw:=0;
h1 :=0;
h2 :=0;
h3 :=0;
hw :=findwindow(nil, '存储用户名和密码');
if hw=0 then
showmessage('error1');
h1 :=FindWindowEX(hw,0,'Button','添加(&A)');
if h1=0 then
showmessage('error2');
SendMessage(h1,BM_CLICK, 1, 0);
//sleep(100);
//hw :=0;
h2 :=FindWindowEX(hw,0,'#32770','登录信息属性');
//hw :=findwindow(nil, '登录信息属性');
if h2=0 then
showmessage('error3');
end;
解决方案 »
- Delphi如何连接SQL Server
- Delphi 实现安全删除USB储存设备
- DX问题高手求救:在Delphi的DX编程中,为何最简单的例子,用到的控件就DXDraw及DXTimer两个,占CPU那么高?怎么降低?
- 如何向另一个程序发送字符串?
- 仓库管理系统中,如何建立数据库,数据库的结构要如何建立?要做到可以看到物料存在那个仓位.做过的介绍一下经验啊!谢了!
- 一个由VB启发到的问题,请高手赐教
- delphi制作的视频播放器,画面暂停后,被遮挡就显示黑色,这个怎么处理?
- 偶很失败
- 怎样用DELPHI实现,只删除指定文件夹内的文件,而不把文件夹一起删除?
- 在中如何独立地取得系统的时间(年,月,日),怎样转换为字符型?
- 高人指点!delphi 语句
- Form的奇怪问题
var
hw,h1,h2,h3,h4,h5:HWND;
begin
hw:=0;
hw :=findwindow(nil, '登录信息属性');
if hw=0 then
showmessage('error3');
end;
var
hw,h1,h2,h3,h4,h5:HWND;
begin
hw:=0;
h1 :=0;
h2 :=0;
h3 :=0;
winExeC(PChar('control userpasswords2'),SW_SHOW );
hw :=findwindow(nil, '用户帐户');
if hw=0 then
exit;
h1 :=FindWindowEX(hw,0,'SysTabControl32',nil);
if h1=0 then
exit;
SendMessage(h1,$1330, 1, 0);
h2 :=FindWindowEX(hw,0,'#32770','高级');
if h2=0 then
exit;
h3 :=FindWindowEX(h2,0,'Button','管理密码(&M)');
if h3=0 then
exit;
SendMessage(h3,BM_CLICK, 1, 0);
hw:=0;
h1 :=0;
h2 :=0;
h3 :=0;
hw :=findwindow(nil, '存储用户名和密码');
if hw=0 then
showmessage('error1');
h1 :=FindWindowEX(hw,0,'Button','添加(&A)');
if h1=0 then
showmessage('error2');
SendMessage(h1,BM_CLICK, 1, 0);
sleep(5000); //留5秒时间关掉sendmessage点开的对话框并自己手动点击打开新的对话框 hw :=0;
hw :=findwindow(nil, 'Form1');
if hw=0 then
showmessage('error3');
h2 :=findwindow(nil,'登录信息属性');
if h2=0 then
showmessage('error4')
else
showmessage(inttostr(h2));end;