Real Software Forums

The forum for Real Studio and other Real Software products.
[ REAL Software Website | Board Index ]
It is currently Tue Oct 17, 2017 2:57 am
xojo

All times are UTC - 5 hours




Post new topic Reply to topic  [ 1 post ] 
Author Message
 Post subject: Window - Bring To Front
PostPosted: Sat Sep 08, 2012 7:42 am 
Offline
User avatar

Joined: Sat May 27, 2006 3:27 pm
Posts: 480
hello
Here is lil code from WFS to make your window stay on top of other windows centered !

hope this helps

1. I your App make a method Called BringToCenter

Sub BringToCenter( w as Window, assigns set as Boolean )
#if TargetWin32
Const SWP_NOSIZE = &H1
Const SWP_NOMOVE = &H2
Const HWND_TOPMOST = -1
Const HWND_NOTOPMOST = -2

Declare Function SetWindowPos Lib "user32" (hwnd as Integer, hWndInstertAfter as Integer, _
x as Integer, y as Integer, cx as Integer, cy as Integer, flags as Integer) as Integer

dim after as Integer
if set then
after = HWND_TOPMOST
else
after = HWND_NOTOPMOST
end
Call SetWindowPos( w.handle, after, 0, 0, 0, 0, SWP_NOMOVE + SWP_NOSIZE )

w.Left=(Screen(0).AvailableWidth -w.Width)/2
w.Top=(Screen(0).AvailableHeight -w.Height)/2
#endif


2. Call it like this in windows open event

App.BringTOCenter( Self ) = True


Top
 Profile  
Reply with quote  
Display posts from previous:  Sort by  
Post new topic Reply to topic  [ 1 post ] 

All times are UTC - 5 hours


You cannot post new topics in this forum
You cannot reply to topics in this forum
You cannot edit your posts in this forum
You cannot delete your posts in this forum

Search for:
Jump to:  
Powered by phpBB © 2000, 2002, 2005, 2007 phpBB Group