Gamestudio Links
Zorro Links
Newest Posts
Help with plotting multiple ZigZag
by degenerate_762. 04/30/24 23:23
M1 Oversampling
by 11honza11. 04/30/24 08:16
Trading Journey
by howardR. 04/28/24 09:55
Zorro Trader GPT
by TipmyPip. 04/27/24 13:50
Data from CSV not parsed correctly
by jcl. 04/26/24 11:18
AUM Magazine
Latest Screens
The Bible Game
A psychological thriller game
SHADOW (2014)
DEAD TASTE
Who's Online Now
3 registered members (dr_panther, Ayumi, 1 invisible), 877 guests, and 2 spiders.
Key: Admin, Global Mod, Mod
Newest Members
firatv, wandaluciaia, Mega_Rod, EternallyCurious, howardR
19050 Registered Users
Previous Thread
Next Thread
Print Thread
Rate Thread
auto maximize? #299442
11/24/09 02:49
11/24/09 02:49
Joined: Aug 2002
Posts: 164
Houston
Nicholas Offline OP
Member
Nicholas  Offline OP
Member

Joined: Aug 2002
Posts: 164
Houston
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


Black holes are where God divided by zero.
Re: auto maximize? [Re: Nicholas] #299443
11/24/09 02:58
11/24/09 02:58
Joined: Jul 2008
Posts: 553
Singapore
delinkx Offline
User
delinkx  Offline
User

Joined: Jul 2008
Posts: 553
Singapore
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 ?


A7 commercial Team / VC++ 2008 Pro
homepage | twitter | facebook
Re: auto maximize? [Re: delinkx] #299449
11/24/09 05:09
11/24/09 05:09
Joined: Nov 2007
Posts: 1,143
United Kingdom
DJBMASTER Offline
Serious User
DJBMASTER  Offline
Serious User

Joined: Nov 2007
Posts: 1,143
United Kingdom
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.

Re: auto maximize? [Re: DJBMASTER] #299450
11/24/09 05:13
11/24/09 05:13
Joined: Aug 2002
Posts: 164
Houston
Nicholas Offline OP
Member
Nicholas  Offline OP
Member

Joined: Aug 2002
Posts: 164
Houston
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,


Black holes are where God divided by zero.
Re: auto maximize? [Re: Nicholas] #299452
11/24/09 06:15
11/24/09 06:15
Joined: Nov 2007
Posts: 1,143
United Kingdom
DJBMASTER Offline
Serious User
DJBMASTER  Offline
Serious User

Joined: Nov 2007
Posts: 1,143
United Kingdom
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);

Last edited by DJBMASTER; 11/24/09 06:16.
Re: auto maximize? [Re: DJBMASTER] #299453
11/24/09 06:30
11/24/09 06:30
Joined: Aug 2002
Posts: 164
Houston
Nicholas Offline OP
Member
Nicholas  Offline OP
Member

Joined: Aug 2002
Posts: 164
Houston
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.


Black holes are where God divided by zero.
Re: auto maximize? [Re: Nicholas] #299554
11/24/09 21:05
11/24/09 21:05
Joined: Nov 2007
Posts: 1,143
United Kingdom
DJBMASTER Offline
Serious User
DJBMASTER  Offline
Serious User

Joined: Nov 2007
Posts: 1,143
United Kingdom
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);
}



Re: auto maximize? [Re: DJBMASTER] #300948
12/07/09 05:04
12/07/09 05:04
Joined: Aug 2002
Posts: 164
Houston
Nicholas Offline OP
Member
Nicholas  Offline OP
Member

Joined: Aug 2002
Posts: 164
Houston
Nice! Thanks for the help.
laugh


Black holes are where God divided by zero.
Re: auto maximize? [Re: Nicholas] #301192
12/08/09 21:13
12/08/09 21:13
Joined: Mar 2008
Posts: 2,247
Baden Württemberg, Germany
Espér Offline
Expert
Espér  Offline
Expert

Joined: Mar 2008
Posts: 2,247
Baden Württemberg, Germany
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.


Selling my Acknex Engine Editions (A7 Com & A8 Pro):
>> click here if you are interested <<
Re: auto maximize? [Re: Espér] #301329
12/09/09 17:00
12/09/09 17:00
Joined: Aug 2002
Posts: 164
Houston
Nicholas Offline OP
Member
Nicholas  Offline OP
Member

Joined: Aug 2002
Posts: 164
Houston
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.

Last edited by Nicholas; 12/09/09 17:02.

Black holes are where God divided by zero.

Moderated by  HeelX, Lukas, rayp, Rei_Ayanami, Superku, Tobias, TWO, VeT 

Gamestudio download | chip programmers | Zorro platform | shop | Data Protection Policy

oP group Germany GmbH | Birkenstr. 25-27 | 63549 Ronneburg / Germany | info (at) opgroup.de

Powered by UBB.threads™ PHP Forum Software 7.7.1