Hello,
In some Situations, I have to change some basic-settings and need to restart the Program.
The normal way : using the close/exit - button and start/activate the program again from Desktop with new Settings.
A better Solution would be :
to shutdown a program and restart it again within the program, is it possible ?
I got it working like :
====
STATIC cImage1
FUNCTION MAIN()
..
..
// only once at start
// Init Var with a value, because cImage1 = NIL
IF cImage1 = NIL
cImage1 := c_Path + "\bitmaps\Back3.jpg"
ELSE
here maybe possible, to close Window 1 ??? ( 2. call of MAIN() )
ENDIF
...
...
DEFINE IMAGE oTmp FILENAME cImage1
oBrush1 := TBrush():new( ,,,, ResizeBmp( oTmp:hBitmap, 1024, 768 - 145, .T. ) )
DEFINE WINDOW oWndMain FROM 1, 1 TO 20, 70 ;
TITLE "I am the MDI Frame" MDI BRUSH oBrush1
oTmp:End()
..
..
With the Reset Button, cImage1 is getting a new value < Back1.jpg > and isn't NIL anymore.
Calling MAIN again, the old Init-value of cImage1( Back3.jpg ) is not used and the new Background is shown.
It works as a Solution, changing the Background of the Main-window.
The problem, closing the Program, closes only the new / replaced 2. Window and still shows the 1. Window from Start.
The Start-Window must be closed, AFTER the new call of MAIN !!!
...
...
@ 240, 90 BTNBMP oBtn3 OF oWndEdit PIXEL ;
SIZE 150 , 80 PROMPT "Reset" 2007 ;
FONT oFont1 ;
TOP ;
NOBORDER ;
FILENAME c_Path + "\bitmaps\32x32\Reset.bmp" ;
ACTION ( cImage1 := c_Path + "\bitmaps\Back1.jpg", MAIN() )
...
...
ACTIVATE WINDOW oWndMain MAXIMIZED
RETURN NIL
===============
Best Regards
Uwe