Page 1 of 1

How to maximize my program's window at start ?

Posted: Tue Jan 06, 2004 12:59 pm
by JoJo
Hey Guys,

I know how to get the clientarea of the screen and my program automatically uses that information when opened, but it still isn't the same when I press afterwards maximise.

How can I get my window to automatically maximise at startup ? without having to press the button in the right top corner.

Thanks for your ideas.

Posted: Tue Jan 06, 2004 1:07 pm
by Pupil
try something like:

Code: Select all

ShowWindow_(WindowID(), #SW_MAXIMIZE)

Thanks for the quick reply

Posted: Tue Jan 06, 2004 1:12 pm
by JoJo
I think this api call should be also on the FAQ, which I checked out before writing my request here.

Re: Thanks for the quick reply

Posted: Tue Jan 06, 2004 1:16 pm
by Berikco
JoJo wrote:I think this api call should be also on the FAQ, which I checked out before writing my request here.
of course not...
And the 20000 other API calls also? :)
This is not a PureBasic command, there are tons of API resources available on the internet.

Posted: Tue Jan 06, 2004 1:36 pm
by GedB
JoJo,

Heres a full example:

Code: Select all

If OpenWindow(0, 234, 140, 600, 300,  #PB_Window_SystemMenu | #PB_Window_SizeGadget | #PB_Window_TitleBar | #PB_Window_MinimizeGadget | #PB_Window_MaximizeGadget | #PB_Window_Invisible, "New window ( 0 )")
  ShowWindow_(WindowID(),#SW_Maximize)

  Repeat
    Event = WaitWindowEvent()
  Until Event = #PB_Event_CloseWindow
EndIf
What you really need is the AllAPI guide http://www.mentalis.org/agnet/apiguide.shtml

Posted: Tue Jan 06, 2004 5:04 pm
by Edwin Knoppert
Normally a Winmain provides the window showcmd.
Imagne a shortcut with a modified setting.

GetProcessInfo() is required in pb i guess to obtain this value again..
??