Page 1 of 1

Getting the hwnd of an OpenScreen(), or other method.

Posted: Sun Mar 07, 2004 7:08 am
by halo
I want to write a function that sets the graphics mode and returns the hwnd of the screen, so that I can perform OpenGL operations on it. How can I do this?

Thanks.

Posted: Sun Mar 07, 2004 8:01 am
by darklordz
edit i realised that whai i just typed is obsolete.... nm me... sorry
to get the hwnd of the desktop window HWND GetDesktopWindow(VOID)
in pb thats : GetDesktopWindow_()

The GetDesktopWindow function returns the handle of the Windows desktop window. The desktop window covers the entire screen. The desktop window is the area on top of which all icons and other windows are painted.

to set a screen res. this might help http://delphi.about.com/library/weekly/aa011100a.htm

Posted: Mon Mar 08, 2004 4:22 am
by halo
I get the message that setuppixelformat failed when I try this code:

Code: Select all

hwnd=GetDesktopWindow()
cam=CreateCamera(hwnd,0)
CreateCube(0)
MoveEntity cam,0,0,-10

While Not KeyHit(1)
	RenderCamera cam
	FlipCamera cam
	Wend
I don't expect you to understand my 3D engine, but this should demonstrate what I am trying to do.