enablerbr Posted April 18, 2010 Share Posted April 18, 2010 I noticed there is no command to utilize the Maximize button on a graphic window. Is there any reason for this? Quote Q6600, GTX 560Ti, 8GB DDR2, Windows 7 Home Premium 64-bit. Link to comment Share on other sites More sharing options...
Masterxilo Posted April 18, 2010 Share Posted April 18, 2010 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) Quote Hurricane-Eye Entertainment - Site, blog. Link to comment Share on other sites More sharing options...
enablerbr Posted April 18, 2010 Author Share Posted April 18, 2010 i use c#. so i'll have to look into it further. thanks. Quote Q6600, GTX 560Ti, 8GB DDR2, Windows 7 Home Premium 64-bit. Link to comment Share on other sites More sharing options...
Pixel Perfect Posted April 18, 2010 Share Posted April 18, 2010 The commands Masterxilo illustrated (FindWindow and SetWindowLong) are Windows API commands and not language specific so you just need to call these from C#. Quote 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 More sharing options...
enablerbr Posted April 18, 2010 Author Share Posted April 18, 2010 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? Quote Q6600, GTX 560Ti, 8GB DDR2, Windows 7 Home Premium 64-bit. Link to comment Share on other sites More sharing options...
Masterxilo Posted April 19, 2010 Share Posted April 19, 2010 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 ). So the process of getting the window handle is: SetAppTitle("MY APPLICATION"); Graphics(...); hwnd = FindWindow(NULL, "MY APPLICATION"); Quote Hurricane-Eye Entertainment - Site, blog. Link to comment Share on other sites More sharing options...
enablerbr Posted April 19, 2010 Author Share Posted April 19, 2010 thanks Masterxilo. now it works. though as i suspected. the backbuffer doesn't change to match. guess thats why it was left out. so i can only use it with my own OpenGL context. Quote Q6600, GTX 560Ti, 8GB DDR2, Windows 7 Home Premium 64-bit. Link to comment Share on other sites More sharing options...
Masterxilo Posted April 19, 2010 Share Posted April 19, 2010 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). Quote Hurricane-Eye Entertainment - Site, blog. Link to comment Share on other sites More sharing options...
enablerbr Posted April 19, 2010 Author Share Posted April 19, 2010 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. Quote Q6600, GTX 560Ti, 8GB DDR2, Windows 7 Home Premium 64-bit. Link to comment Share on other sites More sharing options...
Masterxilo Posted April 19, 2010 Share Posted April 19, 2010 everytime a user decides they need to change resolution. the app has to be restarted from fresh ? No it doesn't, you just have to call Graphics() again, no restarting/reloading required. Quote Hurricane-Eye Entertainment - Site, blog. Link to comment Share on other sites More sharing options...
Gabriel Posted October 19, 2011 Share Posted October 19, 2011 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 Quote Link to comment Share on other sites More sharing options...
Canardia Posted October 19, 2011 Share Posted October 19, 2011 ? 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. Quote ■ Ryzen 9 ■ RX 6800M ■ 16GB ■ XF8 ■ Windows 11 ■ ■ Ultra ■ LE 2.5 ■ 3DWS 5.6 ■ Reaper ■ C/C++ ■ C# ■ Fortran 2008 ■ Story ■ ■ Homepage: https://canardia.com ■ Link to comment Share on other sites More sharing options...
L B Posted October 21, 2011 Share Posted October 21, 2011 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. Quote Link to comment Share on other sites More sharing options...
Recommended Posts
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.