IonicWind Software

IWBasic => General Questions => Topic started by: Andy on October 26, 2018, 08:49:08 pm

Title: Filerequest topmost
Post by: Andy on October 26, 2018, 08:49:08 pm
I would like to add TOPMOST to my constants program but when I add in the topmost style the filerequest screen is hidden.

Is there a way to add Topmost to filerequest?

Thanks,
Andy.
:)
Title: Re: Filerequest topmost
Post by: fasecero on October 26, 2018, 09:34:54 pm
Set the FILEREQUEST parent, second parameter, to the TOPMOST window. It will be mandatory or will you allow the user to choose if the app is TOPMOST or not?

Code Select

$INCLUDE "windowssdk.inc"

WINDOW w1
OPENWINDOW w1,0,0,600,400,@MINBOX|@MAXBOX|@SIZE,NULL,"",&w1_handler
SetWindowPos(w1.hwnd, HWND_TOPMOST, 0, 0, 0, 0,SWP_NOSIZE | SWP_NOMOVE)
GetFilename(w1)

' main loop
WAITUNTIL w1 = 0
END

' window procedure
SUB w1_handler(), INT
SELECT @MESSAGE
CASE @IDCREATE
CENTERWINDOW w1

CASE @IDCLOSEWINDOW
CLOSEWINDOW w1
ENDSELECT

RETURN 0
ENDSUB

SUB GetFilename(WINDOW w), STRING
string filter = "All Files (*.*)|*.*|Text Files (*.txt)|*.txt||"
ISTRING filename[MAX_PATH] = FILEREQUEST("Select File", w, 1, filter,"txt", 0, "")
IF LEN(filename) THEN SETCAPTION w1, filename
ENDSUB
Title: Re: Filerequest topmost
Post by: LarryMc on October 26, 2018, 10:33:51 pm
if fasecero's post doesn't solve your problem then have a look Here (https://www.ionicwind.com/forums/index.php?topic=1396.msg13086#msg13086)

in the bottom sub:
create a temp WINDOW t1
t1.hwnd=  wParam
use the MODIFYEXSTYLE command to add WS_EX_TOPMOST after the _Postmessage command

should work
Title: Re: Filerequest topmost
Post by: Andy on October 27, 2018, 09:24:42 pm
Fasecero and Larry,

Thanks for the help with the topmost problem.

It did work, but ultimately I didn't use it in the final version of the constants search program as the program also opens your browser but still remains topmost.

So in the end it wasn't what I wanted, but many thanks anyway.

Andy.
:)