View previous topic :: View next topic |
Author |
Message |
MACE1 KiXforms Enthusiast


Joined: 12 Oct 2004 Posts: 130 Location: Manchester UK
|
Posted: Tue Mar 06, 2007 5:15 pm Post subject: How to hide a form while external app. has focus ! |
|
|
My code at the moment hides the mainform while the external application is running.
I am trying to find a way of modifying this such that it only hides while the application has focus. If I say minimise the application I want the main form to re-appear to allow me to 'shell' run a further instance of the original application or an alternative application. (It's a Menu System.)
Code: |
FUNCTION RUNIT($cmd)
$mainform.hide
;lots of other bits...
SHELL $cmd
$mainform.show
ENDFUNCTION
|
Anyone know a good approach ?
I have also been trying to figure out how to tell $mainform to minimize rather than hide as a possible alternative but can't see anything in the .chm
________
Buy no2 vaporizer
Last edited by MACE1 on Fri Feb 18, 2011 5:08 pm; edited 1 time in total |
|
Back to top |
|
 |
Chris S. KiXforms Enthusiast

Joined: 05 Mar 2003 Posts: 241
|
Posted: Thu Mar 08, 2007 3:29 am Post subject: |
|
|
The only way I can think of doing what you described is to add the AutoIt com component (AutoItX) to your script. |
|
Back to top |
|
 |
MACE1 KiXforms Enthusiast


Joined: 12 Oct 2004 Posts: 130 Location: Manchester UK
|
Posted: Thu Mar 08, 2007 10:53 am Post subject: |
|
|
I've had a look at AutoIT. Its good but not really the route I want to go with this. Would have to install on too many PC's.
Anyone know is there a control in kixform.dll to '.minimise' rather than '.hide'
________
HOW TO ROLL BLUNTS
Last edited by MACE1 on Sat Mar 12, 2011 5:33 pm; edited 1 time in total |
|
Back to top |
|
 |
Chris S. KiXforms Enthusiast

Joined: 05 Mar 2003 Posts: 241
|
Posted: Thu Mar 08, 2007 5:03 pm Post subject: |
|
|
WindowState Property
Description
Gets or sets the window state of the form.
Syntax
object.WindowState [ = Value ]
Property Value
One of the following values. The default is Normal.
Value Name Description
0 Normal A default sized window
1 Minimized A minimized window
2 Maximized A maximized window
I don't think it will do what you want it to do, however. You're using KiXtart shell to run the other application. The code will pause until the shelled program is no longer running. Your form will not be refreshed when you restore it from the minimized state.
You'll need to switch to KiXforms Shell or KiXtart's Run to allow the code in your KiXforms script to continue. |
|
Back to top |
|
 |
MACE1 KiXforms Enthusiast


Joined: 12 Oct 2004 Posts: 130 Location: Manchester UK
|
Posted: Mon Mar 12, 2007 8:59 am Post subject: Lave it minimised is the method I have had to employ. |
|
|
As a system window it always remains in front of everything.
If I just want a regular window, what is the syntax for kixforms?
Code: |
$system = CreateObject("Kixtart.System")
$mainform = $system.form()
$mainform.caption = "MENU[" + $cnt + "]"
$mainform.width = $wx + 110
$mainform.height = $wy + 10
$mainform.topmost = "true"
$mainform.maximizebox = "false"
$mainform.minimizebox = "true"
$mainform.center
;lots of bits
;~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
FUNCTION doit($cmd)
$mainform.WindowState=1
RUN $cmd
ENDFUNCTION
|
________
OG KUSH
Last edited by MACE1 on Fri Feb 18, 2011 5:09 pm; edited 1 time in total |
|
Back to top |
|
 |
Chris S. KiXforms Enthusiast

Joined: 05 Mar 2003 Posts: 241
|
Posted: Mon Mar 12, 2007 3:51 pm Post subject: |
|
|
Stop setting the TopMost property to "true"...
Code: |
$system = CreateObject("Kixtart.System")
$mainform = $system.form()
$mainform.caption = "MENU[" + $cnt + "]"
$mainform.width = $wx + 110
$mainform.height = $wy + 10
; $mainform.topmost = "true"
$mainform.maximizebox = "false"
$mainform.minimizebox = "true"
$mainform.center
;lots of bits
;~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
FUNCTION doit($cmd)
$mainform.WindowState=1
RUN $cmd
ENDFUNCTION
|
|
|
Back to top |
|
 |
MACE1 KiXforms Enthusiast


Joined: 12 Oct 2004 Posts: 130 Location: Manchester UK
|
Posted: Mon Mar 19, 2007 8:34 am Post subject: |
|
|
Thanks all for that.
It now minimises when the app is called, can be manually restored if wishing to call something else while existing app is running and does not insist it is ALWAYS the topmost window.
M
________
Marijuana vaporizer |
|
Back to top |
|
 |
|