overlay tool
overlay tool
Hello Guys,
I want to make a little overlay tool. That means that i can draw images and the images are ALWAYS in the front. That means when i start the internet explorer , then the image is still in the front that you can see it. When i start a game then i still see the image infront of the game
Thanks for yur help.
Cheers
I want to make a little overlay tool. That means that i can draw images and the images are ALWAYS in the front. That means when i start the internet explorer , then the image is still in the front that you can see it. When i start a game then i still see the image infront of the game
Thanks for yur help.
Cheers
-
- Admin
- Posts: 14143
- Joined: Wed Apr 19, 2006 9:20 pm
- Location: Oldenburg(Oldb), Germany
- Contact:
I really don't know how to do this. If you ask for the window passing, just get the Hwnd or WindowID from that window and put it into SIrrCreationParameters.WindowID (when creating the device with createDeviceEx) or you pass that pointer in the beginScene call (there's also a windowid parameter). In both cases, the manually created window will be used for rendering.hybrid wrote:But I don't know which one
-
- Admin
- Posts: 14143
- Joined: Wed Apr 19, 2006 9:20 pm
- Location: Oldenburg(Oldb), Germany
- Contact:
There's no way to render without some kind of window. Whether it's visible at all, or infront all the time, with borders or without, is all defined upon window creation. You seem to want a window without borders which is always on top of everything else (and with some kind of alpha channel...). If you manage to create such a window, the described techniques should enable Irrlicht to render into this window.
I thought that i make something like this
And i will draw a clean window withouth any bars and then i will print the image in this mfc window.
What do u think about this idea?
Code: Select all
#include <windows.h>
#include <irrlicht.h>
using namespace irr;
using namespace core;
using namespace scene;
using namespace video;
using namespace io;
using namespace gui;
int main(){
HWND wnd = 0;
while(!wnd){
wnd = FindWindow("Notepad", NULL);
if(wnd) wnd = GetWindow(wnd, GW_CHILD);
Sleep(10);
}
SIrrlichtCreationParameters ppp;
ppp.AntiAlias = false;
ppp.Bits = 16;
ppp.DriverType = EDT_DIRECT3D9;
ppp.EventReceiver = 0;
ppp.Fullscreen = false;
ppp.HighPrecisionFPU = false;
ppp.Stencilbuffer = false;
ppp.Vsync = false;
ppp.WindowSize = dimension2d<s32>(800, 600);
ppp.WindowId = (s32)wnd;
IrrlichtDevice *device = createDeviceEx(ppp);
IVideoDriver* driver = device->getVideoDriver();
ISceneManager* smgr = device->getSceneManager();
IGUIEnvironment* guienv = device->getGUIEnvironment();
ISceneNode* node = smgr->addCubeSceneNode(10);
node->setPosition(vector3df(0, -50, 50));
ICameraSceneNode* cam = smgr->addCameraSceneNode();
cam->setTarget(vector3df(0, -50, 50));
while(device->run()){
driver->beginScene(true, true, SColor(255,100,101,140));
smgr->drawAll();
guienv->drawAll();
driver->endScene();
}
device->drop();
return 0;
}
What do u think about this idea?
to get a window always stay on top you'll need this function:
SetWindowPos(...)
if you want a window without borders you'll need to create one on your own...
for this look at tutorial 14 (Win32Window) there is a value that holds all style datas for the window:there you can specify how the window should look like when creating the window...
SetWindowPos(...)
if you want a window without borders you'll need to create one on your own...
for this look at tutorial 14 (Win32Window) there is a value that holds all style datas for the window:
Code: Select all
DWORD style = WS_SYSMENU | WS_BORDER | WS_CAPTION |
WS_CLIPCHILDREN | WS_CLIPSIBLINGS | WS_MAXIMIZEBOX | WS_MINIMIZEBOX | WS_SIZEBOX;
while(!asleep) sheep++;
IrrExtensions:
http://abusoft.g0dsoft.com
try Stendhal a MORPG written in Java
IrrExtensions:
http://abusoft.g0dsoft.com
try Stendhal a MORPG written in Java
Like Acki said, SetWindowPos with topmost flag will make a window always on top. To make parts of it transparent you use SetWindowRgn or layered windows