auto maximize?

Posted By: Nicholas

auto maximize? - 11/24/09 02:49

I can start the program fullscreen, but I'd rather have it windowed, but maximize on startup. I can click the maximize button on the title bar, but I want it to auto do it and can't find the command. if there is on_maximize, then the engine should have a recognizable command to program into my code.
any ideas?
thanks
Posted By: delinkx

Re: auto maximize? - 11/24/09 02:58

there is on_maximize event and that is triggered when the user clicks on the maximize button. but auto maximize i don't know.. anyone ?
Posted By: DJBMASTER

Re: auto maximize? - 11/24/09 05:09

Can definitely be done using win32 with eg SetWindowLong / WS_MAXIMIZE but that's probably a little 'hard-core' if you'r new to lite-c. I don't know if there is a built-in function.
Posted By: Nicholas

Re: auto maximize? - 11/24/09 05:13

Yeah, that might need a little more info. I'm hoping there's just a few lines I can put at the beginning of my main() function,
Posted By: DJBMASTER

Re: auto maximize? - 11/24/09 06:15

Try this...

video_window(vector(0,0,0),vector(sys_metrics(0),sys_metrics(1),0),112,NULL);

or

video_window(vector(1,0,0),vector(sys_metrics(0),sys_metrics(1),0),112,NULL);
Posted By: Nicholas

Re: auto maximize? - 11/24/09 06:30

I knew how to do that since a few versions back, but unfortunately it doesn't maximmize and it also doesn't account Thanks, but I mean the actual maximize function.
Posted By: DJBMASTER

Re: auto maximize? - 11/24/09 21:05

OK, here is how you do it 'properly'
Code:
#include <acknex.h>
#include <default.c>
#include <windows.h>

#define SW_MAXIMIZE 3

void main()
{
wait(1);
ShowWindow(hWnd,SW_MAXIMIZE);
}


Posted By: Nicholas

Re: auto maximize? - 12/07/09 05:04

Nice! Thanks for the help.
laugh
Posted By: Espér

Re: auto maximize? - 12/08/09 21:13

i got a little problem with your code DJ...

When the window is maximized, the mouse_map isn´t always on the windows cursor position.
When i move the mouse to the right, the mouse_map moves much faster. when i now want to use it with a button, i need to move the cursor to the right away from the button to hit it.
Posted By: Nicholas

Re: auto maximize? - 12/09/09 17:00

add this before the main function
Code:
//////////// used to sync the mouse properly
function on_maximize_event() // adapt the engine resolution to the window size
{   RECT r;   GetClientRect(hWnd,&r);    video_set(r.right,r.bottom,0,0); }
function on_resize_event() // adapt the engine resolution to the window size
{   RECT r;   GetClientRect(hWnd,&r);    video_set(r.right,r.bottom,0,0); }



I'm also using mouse_sync in the main function after the level load and auto maximize.

if it still doesn't work, search the forum for this code and you'll find the working example. This is what I am using and it works great.
© 2024 lite-C Forums