Way to position gfx window *before* it appears?

BlitzMax Forums/BlitzMax Programming/Way to position gfx window *before* it appears?

Grey Alien(Posted 2006) [#1]
Basically if I make a BMax graphics window with Graphics a depth of 0, I can use Windows API calls to centre it. Fine except that when it first appears, it's wherever Windows puts it (normally new windows cascade form the top left), then it get's repositioned by my code. This means for a split second you see it at the naff position before it gets positioned.

Now I know the answer is probably "Use MaxGUI". But I wondered if I could suggest a module tweak so that there is a boolean flag in DXGraphics or whatever that specifies that any windows made with Graphics Depth 0 are auto-centered Before they are shown. This should be easily possible ...


TartanTangerine (was Indiepath)(Posted 2006) [#2]
My I'm being rather helpful today..

d3d7graphics.bmx : Line 79
hwnd=CreateWindowExA( 0,DX_CLASS_NAME,wndTitle,style,CW_USEDEFAULT,CW_USEDEFAULT,width,height,0,0,hinst,Null )

And the MSDN page : http://msdn.microsoft.com/library/default.asp?url=/library/en-us/winui/winui/windowsuserinterface/windowing/windows/windowreference/windowfunctions/createwindowex.asp


Grey Alien(Posted 2006) [#3]
Aha! Cubtastic. So it useds CW_USEDEFAULT.

So rather that me modifying the module and having to keep modifying after each SyncMods (if it changed), I'd really like some extra flag for Centred either tagged on the end of Graphics, or perhaps just a global flag that Graphics uses. This would be great. OR even a way to NOT show the window whe Graphics is called until you call something else.

Any chance BRL?

thanks for any replies you can offer.


Grisu(Posted 2006) [#4]
@BRl:
This issue is old. Please make this centering "default" when a new window is created! Thanks!