摘要:
Delphi常用技巧 3 **********************************判断程序是否运行if FindWindow(主程序窗体类,主程序窗体标题) = 0 then //找到这个程序begin ShowMessage('主程序没有运行') ;Application.Terminate ;end;*******************************得到鼠标位置上的类procedure TForm1.Timer1Timer(Sender: TObject);varClassName: PChar;atCursor: TPoint;hWndMouseO 阅读全文
摘要:
问:如何使程序在执行过程中暂停一段时间?答:要使在运行中的程序暂停一段时间可以使用sleep这个关键词,下面是一个例子procedure TForm1.Button1Click(Sender: TObject);varh,m,s,ms:word;beginEdit1.text:=DateTimeToStr(now);sleep(2000);//2000就表示2个微秒edit2.text:=DateTimeToStr(now);DecodeTime(strtodatetime(edit2.text)-strtodatetime(edit1.text),h,m,s,ms);showmessage( 阅读全文
摘要:
Delphi常用技巧 1问:如何让del+CTRL+ALT看不见程序运行?答:为了让程序用ALT+DEL+CTRL看不见,在implementation后添加声明:function RegisterServiceProcess(dwProcessID, dwType: Integer): Integer; stdcall; external 'KERNEL32.DLL';再在上面的窗口Create事件加上一句:RegisterServiceProcess(GetCurrentProcessID, 1);//隐藏也可以使用下面的函数:function My_SelfHide: B 阅读全文