LB Booster
« Minimize or Maximize from within the program »

Welcome Guest. Please Login or Register.
Sep 23rd, 2017, 11:24pm


Speed up Liberty BASIC programs by up to ten times!
Compile Liberty BASIC programs to compact, standalone executables!
Overcome many of Liberty BASIC's bugs and limitations!
LB Booster Resources
LB Booster documentation
LB Booster Home Page
LB Booster technical Wiki
Just BASIC forum
LB Umbrella forum
Liberty BASIC forum (the original)

« Previous Topic | Next Topic »
Pages: 1  Notify Send Topic Print
 thread  Author  Topic: Minimize or Maximize from within the program  (Read 111 times)
flotulopex
Junior Member
ImageImage


member is offline

Avatar




Homepage PM

Gender: Male
Posts: 88
xx Minimize or Maximize from within the program
« Thread started on: Sep 10th, 2017, 7:45pm »

Hey there,

I'd like to know if there is a way to Minimize or Maximize the program's window from within the program itself.

I've made a program using a remote sending serial information.

I would like my remote to be able to Minimize or Maximize the program's window.

Is this feasible?
User IP Logged

Roger
Richard Russell
Administrator
ImageImageImageImageImage


member is offline

Avatar




Homepage PM


Posts: 1269
xx Re: Minimize or Maximize from within the program
« Reply #1 on: Sep 10th, 2017, 9:09pm »

on Sep 10th, 2017, 7:45pm, flotulopex wrote:
I'd like to know if there is a way to Minimize or Maximize the program's window from within the program itself.

Which window? Programs typically have multiple windows.

If it's a GUI window (such as a graphics window or a text window) then of course it's just a case of calling the ShowWindow API function with the appropriate parameter: _SW_MINIMIZE or _SW_MAXIMIZE respectively. LBB is no different from LB 4 in this respect and you can use code such as that documented at the Liberty BASIC Programmer's Encyclopedia.

On the other hand if you are referring to the mainwin somewhat different considerations apply. Maximizing the mainwin is straightforward but minimizing it is most easily achieved using code which is LBB-specific.

So which window are you referring to?

Richard.
« Last Edit: Sep 10th, 2017, 9:11pm by Richard Russell » User IP Logged

flotulopex
Junior Member
ImageImage


member is offline

Avatar




Homepage PM

Gender: Male
Posts: 88
xx Re: Minimize or Maximize from within the program
« Reply #2 on: Sep 18th, 2017, 6:40pm »

Hi,

Sorry for my late reply - I was on travel.

Okay, my question is some kind of fuzzy.

My program's main window doesn't have the title bar appearing so I cannot click on the "minimize" button to get the Window's desktop. Nevertheless, I'd like to minimize the window like I would use the keys "Windows+Down".

Either I could create a button "Minimize" or, since my program is remotely controlled, I would use a received command to minimize the window. But what would the command look like?

Forget about the "maximize" question - this one is completely s****d grin
User IP Logged

Roger
RobM
Junior Member
ImageImage


member is offline

Avatar




PM


Posts: 87
xx Re: Minimize or Maximize from within the program
« Reply #3 on: Sep 19th, 2017, 09:51am »

on Sep 18th, 2017, 6:40pm, flotulopex wrote:
I would use a received command to minimize the window. But what would the command look like?


https://msdn.microsoft.com/en-us/library/windows/desktop/ms633548(v=vs.85).aspx

Code:
nCmdShow=_SW_MINIMIZE
calldll #user32, "ShowWindow",_
h as ulong,_
nCmdShow as long,_
result As boolean 
User IP Logged

Richard Russell
Administrator
ImageImageImageImageImage


member is offline

Avatar




Homepage PM


Posts: 1269
xx Re: Minimize or Maximize from within the program
« Reply #4 on: Sep 19th, 2017, 11:27am »

on Sep 18th, 2017, 6:40pm, flotulopex wrote:
But what would the command look like?

I linked to suitable code at LBPE in my reply.

Richard.

User IP Logged

flotulopex
Junior Member
ImageImage


member is offline

Avatar




Homepage PM

Gender: Male
Posts: 88
xx Re: Minimize or Maximize from within the program
« Reply #5 on: Sep 20th, 2017, 06:40am »

Thanks Richard,

I'll give it a try this evening.

I see, I have to get used to use those APIs....
User IP Logged

Roger
flotulopex
Junior Member
ImageImage


member is offline

Avatar




Homepage PM

Gender: Male
Posts: 88
xx Re: Minimize or Maximize from within the program
« Reply #6 on: Sep 21st, 2017, 3:03pm »

Thanks Richard,

As always, you provide the needed help ;)

So this is the code I added to my code.

Code:
[MINIMIZE_WINDOW]
   hMain = hwnd(#Main)
   CallDLL #user32, "ShowWindow",_
   hMain as uLong,_        'handle of window
   _SW_MINIMIZE As Long,_  'message to minimize window
   r As Long
   WAIT
 
User IP Logged

Roger
Pages: 1  Notify Send Topic Print
« Previous Topic | Next Topic »

Donate $6.99 for 50,000 Ad-Free Pageviews!


This forum powered for FREE by Conforums ©
Sign up for your own Free Message Board today!
Terms of Service | Privacy Policy | Conforums Support | Parental Controls