Ok,
#include "globstruct.h"
GlobStruct* Core = 0;
__declspec(dllexport) void ReceiveCoreDataPtr ( LPVOID Core_ )
{
Core=(GlobStruct*)Core_;
}
DBPro will call this function automatically when it loads your DLL. Then you can access the hWnd & hInstance like this:
HWND MyHwnd = Core->hWnd;
HINSTANCE MyHinstance = Core->hInstance;
[EDIT]Forgot to tell you ... you can get the globstruct.h file from C:\Program Files\Dark Basic Software\Dark Basic Professional\Help\documents\Files\Third Party Commands\TESTCOMMANDS2
... or the equivalent location if you installed DBPro somewhere else.