How to keep a appl. on top of the dlg on resize ? (solved)

How to keep a appl. on top of the dlg on resize ? (solved)

Postby ukoenig » Fri Jul 31, 2015 5:33 pm

Hello,

I have 2 questions :

The situation : from inside the RGB-tool I call the colorpicker ( exe )

1. how to close the colorpicker as well, using the exit button from the RGB-tool ?
2. how to keep the colorpicker on top after minimize / maximize the RGB-tool ?

Added : calling the Colorpicker ( standalone exe ) from inside the RGB-tool

Image

best regards
Uwe :?:
Last edited by ukoenig on Sat Aug 01, 2015 1:07 pm, edited 1 time in total.
Since 1995 ( the first release of FW 1.9 )
i work with FW.
If you have any questions about special functions, maybe i can help.
User avatar
ukoenig
 
Posts: 4043
Joined: Wed Dec 19, 2007 6:40 pm
Location: Germany

Re: How to keep a appl. on top of the dialog on resize ?

Postby cnavarro » Fri Jul 31, 2015 9:09 pm

ukoenig wrote:Hello,

I have 2 questions :

The situation : from inside the RGB-tool I call the colorpicker ( exe )

1. how to close the colorpicker as well, using the exit button from the RGB-tool ?
2. how to keep the colorpicker on top after minimize / maximize the RGB-tool ?

Added : calling the Colorpicker ( standalone exe ) from inside the RGB-tool

best regards
Uwe :?:


Try
To close external application:
Code: Select all  Expand view  RUN

SendMessage( FindWindow( 0, "ColorPicker" ), WM_CLOSE )
 
Cristobal Navarro
Hay dos tipos de personas: las que te hacen perder el tiempo y las que te hacen perder la noción del tiempo
El secreto de la felicidad no está en hacer lo que te gusta, sino en que te guste lo que haces
User avatar
cnavarro
 
Posts: 6549
Joined: Wed Feb 15, 2012 8:25 pm
Location: España

Re: How to keep a appl. on top of the dialog on resize ?

Postby ukoenig » Sat Aug 01, 2015 7:17 am

Thank You very much for the response

the defined EXE-names
RGB.exe
Colorpick.exe

The following lines are included in RGB.prg the time I added the Colorpick-button, but doesn't work
..
DEFINE DIALOG oDlg RESOURCE "RGB" PIXEL ;
FONT oFont TITLE "RGB-colors and Gradients => Release 4.3 / 10.02.2015" OF oDlg
..

exit button in RGB.prg

REDEFINE BTNBMP oSBtn[16] OF oDlg ;
ID 580 PIXEL 2007 ;
NOBORDER ;
PROMPT "&Exit RGB-colors" ;
FILENAME c_path1 + "Exit.Bmp" ;
ACTION ( SendMessage( FindWindow( 0, "COLORPICK" ), WM_CLOSE ), oDlg:End() ) ;
FONT oFont1 ;
LEFT


the defined Line in RGB.prg, to keep the colorpicker on top using minimize / maximize of RGB.exe

oDlg:bResized := {|| ON_TOP() }

ACTIVATE DIALOG oDlg CENTERED
..
..
RETURN NIL

// ----

FUNCTION ON_TOP()
CFILENAME := "COLORPICK.exe"
IF ISEXERUNNING( CFILENAME( HB_ARGV( 0 ) ) )
SHOWWINDOW( FINDWINDOW( 0, "COLORPICK" ), 9 )
SETFOREGROUNDWINDOW( FINDWINDOW( 0, "COLORPICK" ) )
ENDIF
RETURN NIL


both are not working

The main-lines from Colorpick.prg


..
..
DEFINE WINDOW oWnd FROM 10, 10 TO 270, 290 PIXEL TITLE "COLOR-PICKER 1.1"
..
..
DEFINE TIMER oTimer OF oWnd ;
INTERVAL 70 ACTION ( nRGB := GetColor(), ;
nRed := nRGBRed( nRGB ), ;
nGreen := nRGBGreen( nRGB ), ;
nBlue := nRGBBlue( nRGB ), ;
cRGB := "nRGB( " + ALLTRIM(STR(nRed)) + ", " + ;
ALLTRIM(STR(nGreen)) + ", " + ;
ALLTRIM(STR(nBlue)) + " )", ;
oSay2:Refresh(), oSay3:Refresh() )

oTimer:Activate()
oWnd:bKeyDown := {|nKey| IF(nKey = nWKey, SAVE_COLOR(), ) }

ACTIVATE WINDOW oWnd CENTER

oTimer:DeActivate()

RETURN NIL


I tested including the Colorpick-source, but I noticed some problems ( maybe the timer )
I think a extra EXE-file is the better solution.

best regards
Uwe :?:
Last edited by ukoenig on Sat Aug 01, 2015 11:29 am, edited 2 times in total.
Since 1995 ( the first release of FW 1.9 )
i work with FW.
If you have any questions about special functions, maybe i can help.
User avatar
ukoenig
 
Posts: 4043
Joined: Wed Dec 19, 2007 6:40 pm
Location: Germany

Re: How to keep a appl. on top of the dialog on resize ?

Postby Antonio Linares » Sat Aug 01, 2015 8:08 am

Uwe,

Great work as usual! :-)
regards, saludos

Antonio Linares
www.fivetechsoft.com
User avatar
Antonio Linares
Site Admin
 
Posts: 42127
Joined: Thu Oct 06, 2005 5:47 pm
Location: Spain

Re: How to keep a appl. on top of the dialog on resize ?

Postby ukoenig » Sat Aug 01, 2015 8:56 am

Antonio,

thank You very much. I hope it is useful

here is a little test, what I'm trying to do from inside the RGB-tool to make it complete.
The test includes the 2 buttons of the RGB-main-dialog and the Colorpicker.

< Daniel Cuatecatl Leon > got the download-link of the colorpicker-source.
Tested and worked fine for him ( worked as well with older FWH-releases ).


Download :
http://www.pflegeplus.com/DOWNLOADS/TestPick1.zip

Image

best regards
Uwe :?:
Since 1995 ( the first release of FW 1.9 )
i work with FW.
If you have any questions about special functions, maybe i can help.
User avatar
ukoenig
 
Posts: 4043
Joined: Wed Dec 19, 2007 6:40 pm
Location: Germany

Re: How to keep a appl. on top of the dialog on resize ?

Postby ukoenig » Sat Aug 01, 2015 1:03 pm

Both needed solutions are working fine now using FUNCTION TOP_CLOSE(nType) !!!

bring on top nType = 1
close nType = 2


Download :
http://www.pflegeplus.com/DOWNLOADS/TestPick2.zip

#define GW_CHILD 5
#define GW_HWNDNEXT 2
#define SW_RESTORE 9
,,,
,,,
FUNCTION TOP_CLOSE(nType)

hWnd := FindWnd( "COLOR-PICKER 1.1" ) // Title !!!
IF hWnd != NIL
IF ISICONIC( hWnd )
SHOWWINDOW( hWnd, SW_RESTORE )
ENDIF
IF nType = 1
SETFOREGROUNDWINDOW( hWnd )
ENDIF
IF nType = 2
SENDMESSAGE( hWnd, WM_CLOSE )
ENDIF
ELSE
MsgAlert( "COLORPICKER is not running !", "Attention" )
ENDIF

RETURN NIL

// ----------

FUNCTION FINDWND( cTitle )
local hWnd := GetWindow( GetDesktopWindow(), GW_CHILD )

WHILE hWnd != 0
IF Upper( cTitle ) $ Upper( GetWindowText( hWnd ) )
RETURN hWnd
ENDIF
hWnd = GetWindow( hWnd, GW_HWNDNEXT )
END

RETURN NIL


best regards
Uwe :D
Since 1995 ( the first release of FW 1.9 )
i work with FW.
If you have any questions about special functions, maybe i can help.
User avatar
ukoenig
 
Posts: 4043
Joined: Wed Dec 19, 2007 6:40 pm
Location: Germany


Return to FiveWin for Harbour/xHarbour

Who is online

Users browsing this forum: Google [Bot] and 40 guests