I have implemented a new function. At the request of
marvin944. I think it is a useful function.
SetWindowPosition(posx, posy, zorder, width, height, flags)
I wrapped the Windows function SetWindowPos. [href=https://docs.microsoft.com/en-us/windows/win32/api/winuser/nf-winuser-setwindowpos]For more information about the flags and the possibilities of zorder (hWndInsertAfter) see the MS website.
[/href]
Here in the example you can see the movable window without title bar and set to Topmost.
#import_plugin FileExplore
// Project: MovingWindow
// Created: 2019-10-23
// show all errors
SetErrorMode(2)
// set window properties
SetWindowTitle( "MovingWindow" )
SetWindowSize( 1024, 768, 0 )
SetWindowAllowResize( 1 ) // allow the user to resize the window
// set display properties
SetVirtualResolution( 1024, 768 ) // doesn't have to match the window
SetOrientationAllowed( 1, 1, 1, 1 ) // allow both portrait and landscape on mobile devices
SetSyncRate( 30, 0 ) // 30fps instead of 60 to save battery
SetScissor( 0,0,0,0 ) // use the maximum available screen space, no black borders
UseNewDefaultFonts( 1 ) // since version 2.0.22 we can use nicer default fonts
winposx=(GetMaxDeviceWidth()-1024)/2
winposy=(GetMaxDeviceHeight()-768)/2
FileExplore.GetCL()
FileExplore.SetWindowStyle(0x10000000)
FileExplore.SetWindowPosition(0,0,-1,0,0,0x0001|0x0002) // -1 set topmost, 0x0001 ignore position, 0x0002 ignore size
do
mx = getrawmousex()
my = getrawmousey()
mxd = mx-lmx
myd = my-lmy
if GetRawMouseLeftState()>0
winposx = winposx+mxd
winposy = winposy+myd
mx=mx-mxd
my=my-myd
endif
SetWindowPosition(winposx, winposy)
Print("Press and hold the left mouse button and move the mouse.")
lmx=mx
lmy=my
Sync()
loop
I've changed the toolset from 140 (15) to 141 (17) so i hope there are no new problems to use this plugin. And I can't test it with AgkStudio, because I don't have this.
Download see below at the bottom of
this post.
Share your knowledge. It\'s a way to achieve immortality.
(Tenzin Gyatso)