摘要:利用下面的两个函数移动windows的“开始”按钮。
uses
windows;
var
tbhwnd : hwnd;
sbhwnd : hwnd;
{ 移动“开始”按钮到你的表单上}
procedure tform1.button1click(sender: tobject);
begin
tbhwnd := findwindow(shell_traywnd, nil);
sbh......
摘要:当你辛辛苦苦用delphi做好了一个你认为十分不错的程序,你是否想把它发布出去成为共享软件呢? 做为一个共享软件,注册码肯定是少不了的,你可以通过判断程序是否注册来进行功能,时间或一些其它限制.现在就介绍一种简单的注册码制造方法.思路是这样的:程序运行时先检测注册表,如果找到注册项,则表明已经注册,如果没有找到注册项,则提示要求注册.
<注册例程>
在delphi下新建一工......
防止多个实例公用程序上一页 ...
result := 0;
if msg = messageid then 【程序编程相关:
如何在数据中能加载.JPG格式的图片
】 【推荐阅读:
使用break与continue语句和f】
case wparam of 【扩展信息:
Delphi----永不消逝的精灵
】
mi_querywindowhandle:
begin
if isiconic(application.handle) then
begin
application.mainform.windowstate := wsnormal;
application.restore;
end;
postmessage(hwnd(lparam), messageid, mi_respondwindowhandle, application.mainform.handle);
end;
mi_respondwindowhandle:
begin
setforegroundwindow(hwnd(lparam));
application.terminate;
end;
end
else
result := callwindowproc(wproc, handle, msg, wparam, lparam);
end;
procedure subclassapplication;
begin
wproc := tfnwndproc(setwindowlong(application.handle, gwl_wndproc, longint(@newwndproc)));
if wproc = nil then mierror := mierror or mi_error_failsubclass;
end;
procedure dofirstinstance;
begin
muthandle := createmutex(nil, false, uniqueappstr); ...
下一页 摘要: 有一些小的程序,需要连接数据库时,我们使用ado进行连接。但有时候,我们是否考虑到系统是否安装了相关的ado驱动程序了呢。如下函数进行这个检测:
function adoinstalled : boolean;
var
r : tregistry;
s : string;
begin
r := tregistry.create;
try
with r do
beg......