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

Everything else that doesn't fall into one of the other PB categories.
halo
Enthusiast
Enthusiast
Posts: 104
Joined: Mon Jan 26, 2004 2:49 am

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

Post 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.
darklordz
Enthusiast
Enthusiast
Posts: 119
Joined: Wed May 21, 2003 1:44 pm
Location: Netherlands
Contact:

Post 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
halo
Enthusiast
Enthusiast
Posts: 104
Joined: Mon Jan 26, 2004 2:49 am

Post 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.
Post Reply