Jump to content

Curious about absent Maximize application function.


enablerbr
 Share

Recommended Posts

The blitzmax graphics window creation method doesn't add this since this feature is OS specific. But you can easily add it yourself once you have the handle to le's window using:

SetWindowLong(m_hWnd, GWL_STYLE, GetWindowLong(m_hWnd,GWL_STYLE)|WS_MINIMIZEBOX|WS_MAXIMIZEBOX); 

(This also adds a minimize button, m_hWnd is the handle to LE's window which you can get using, for example, FindWindow)

Link to comment
Share on other sites

The commands Masterxilo illustrated (FindWindow and SetWindowLong) are Windows API commands and not language specific so you just need to call these from C#.

Intel Core i5 2.66 GHz, Asus P7P55D, 8Gb DDR3 RAM, GTX460 1Gb DDR5, Windows 7 (x64), LE Editor, GMax, 3DWS, UU3D Pro, Texture Maker Pro, Shader Map Pro. Development language: C/C++

Link to comment
Share on other sites

           hWnd = WindowsAPI.FindWindow("DFTester.exe", null);
           WindowsAPI.SetWindowLong(hWnd, WindowsAPI.GWL_STYLE, WindowsAPI.GetWindowLong(hWnd, WindowsAPI.GWL_STYLE) | WindowsAPI.WS_MAXIMIZEBOX);

 

as i don't understand the use of FindWindow. is that the way it shoud be used? or should "DFTester.exe" be replaced with something else?

also would i put this before Graphics() or after it?

Q6600, GTX 560Ti, 8GB DDR2, Windows 7 Home Premium 64-bit.

Link to comment
Share on other sites

After it. And you should create your window with an unique title (at least, it has to be set since you need to know it afterwards).

The syntax of find window is classname (you don't need that -> null), window title/caption (not executable file name :blink:).

 

So the process of getting the window handle is:

SetAppTitle("MY APPLICATION");
Graphics(...);
hwnd = FindWindow(NULL, "MY APPLICATION");

Link to comment
Share on other sites

It works with the default window, it's just kinda "hacky".

 

You could retrieve the size of the maximized window once it gets maximized (you'll need to hook to the windows message callbacks to find out when this happens).

You can then call Graphics() again with the new size and then maximize that new window yourself (maximizing this window won't make it's backbuffer too small, since you already gave it the correct size).

Link to comment
Share on other sites

if i call Graphics() again won't it just start a new window?

 

scratch that. i just did a test and it does just start a fresh window and without the Maximize button.

 

this has just made me realise that without the LE ability to natively resize a graphics window. everytime a user decides they need to change resolution. the app has to be restarted from fresh. which i guess is the same for changing from a window state to a fullscreen state.

Q6600, GTX 560Ti, 8GB DDR2, Windows 7 Home Premium 64-bit.

Link to comment
Share on other sites

  • 1 year later...

           hWnd = WindowsAPI.FindWindow("DFTester.exe", null);
           WindowsAPI.SetWindowLong(hWnd, WindowsAPI.GWL_STYLE, WindowsAPI.GetWindowLong(hWnd, WindowsAPI.GWL_STYLE) | WindowsAPI.WS_MAXIMIZEBOX);

 

as i don't understand the use of FindWindow. is that the way it shoud be used? or should "DFTester.exe" be replaced with something else?

also would i put this before Graphics() or after it?

 

 

Hi,

 

use this :

	HWND hwnd =FindWindow("BlitzMax GLGraphics",AppTitle);
	ShowWindow(hwnd,SW_SHOWMAXIMIZED);

 

AppTile is the name by default is "" or use SetAppTitle( AppTitle ) ; befor Graphics(..,..);

 

;-)

 

Gabriel

Link to comment
Share on other sites

? No it doesn't, you just have to call Graphics() again, no restarting/reloading required.

If you use terrain, then you have to restart the application, because changing window size makes the terrain flat. However, since you can use Sculptris 3D terrain, you can resize on the fly also.

Ryzen 9 RX 6800M ■ 16GB XF8 Windows 11 ■
Ultra ■ LE 2.53DWS 5.6  Reaper ■ C/C++ C# ■ Fortran 2008 ■ Story ■
■ Homepage: https://canardia.com ■

Link to comment
Share on other sites

If you use terrain, then you have to restart the application, because changing window size makes the terrain flat. However, since you can use Sculptris 3D terrain, you can resize on the fly also.

Mmm, built-in Sculptris terrain... That would be killer.

Link to comment
Share on other sites

Join the conversation

You can post now and register later. If you have an account, sign in now to post with your account.
Note: Your post will require moderator approval before it will be visible.

Guest
Reply to this topic...

×   Pasted as rich text.   Paste as plain text instead

  Only 75 emoji are allowed.

×   Your link has been automatically embedded.   Display as a link instead

×   Your previous content has been restored.   Clear editor

×   You cannot paste images directly. Upload or insert images from URL.

 Share

×
×
  • Create New...