"Do you have to be a super genius do them?"
Nope.
You need another programming package like Delphi or Visual C++ (I don't think that you can make DBP-compatible ones with DBP).
The kind of functionality that people have made DLLs for:
- Maths functions
- Zip Tools (Open / Extract data from Zip files)
- Get DirectX version no.
Delphi & Visual C++ provide DLL templates which can be used to write DLLs very quickly.
Essentially they are just libraries of code which you can use in other programs.
Here is the code from a (no its not yet finished) DLL that I am writing in Delphi:
library menusdll;
uses
SysUtils,Classes,Windows,Menus,Dialogs,Messages;
{$R *.res}
var
menu: TMenu;
winhandle: HWND;
function CreateMenu(AppTitle: PChar):Int64;
var
menuhandle: HMenu;
submenu: TMenuItem;
begin
//ShowMessage(AppTitle);
menu := TMenu.Create(nil);
//submenu.Caption := 'Test';
//menu.Items.Add(submenu);
winhandle := FindWindow(nil,PChar(AppTitle));
//ShowMessage(inttostr(Winhandle));
SetMenu(winhandle,menu.Handle);
Result := menu.Handle;
end;
function AddMainMenuItem(ItemName:PChar):Int64;
var
newitem: TMenuItem;
begin
newitem := TMenuItem.Create(nil);
newitem.Caption := String(ItemName);
menu.Items.Add(newitem);
SetMenu(winhandle,menu.Handle);
Result := 0;
end;
procedure AddSubMenuItem(ItemPos: integer;ItemName:PChar); stdcall;
var
subitem: TMenuItem;
begin
subitem := TMenuItem.Create(nil);
subitem.Caption := String(ItemName);
menu.Items[ItemPos].Add(subitem);
SetMenu(winhandle,menu.Handle);
end;
function GetMenuItem():int64;stdcall;
var
sendmsg: tagMSG;
wincall: LongBool;
begin
wincall := Windows.GetMessage(sendmsg,winhandle,0,WM_MOUSELAST);
Result := sendmsg.message;
end;
exports
CreateMenu,
AddMainMenuItem,
AddSubMenuItem,
GetMenuItem;
end.
^^ this adds Windows menus to DBP apps.
To use DLLs in DBP:
a) Either the DLL programmer adds extra info to the DLL so that you can use it just like a normal DBPro command, eg CreateMenu("apptitlegoeshere")
or...
b) Use the DLL functions:
LOAD DLL "menusdll.dll",1
CALL DLL 1,"CreateMenu","apptitlegoeshere"
Current Project: Retro Compo. Entry.