Sign in to follow this  
Followers 0
lasaucisse

move a window out of the screen (solved)

5 posts in this topic

#1 ·  Posted (edited)

Hi,

I need to move a tool window half in outside of the screen : I want to be able to place the pixel at the center of this window exactly on any pixel of the screen, even those of the borders.

So, to move it easily, I created a picture control in background with a ws_ex_parentdrag option, It works perfectly for the left, right and bottom borders.

But if I move my window on the top of the screen so that the title bar is hidden, when I release the mouse button, the window move down automatically ! I think Windows checks if the title bar is visible or not :mellow:

If I use the classical "alt+space" shorcut, I can move it like I want (the pixel at the center exactly on the first line of the screen).

I can also move it with another window, with 4 buttons (move up, down, left, right).

But it isn't so easily and intuitive that a drag'n drop move, and future users do not necessarily know the alt+space shortcut !

Is there a way to prevent Windows to move down a window if its title bar is hidden ?

Edited by lasaucisse

[size="1"]mostly useless softwares (sorry for old VB softs ^^) & others things[/size]

Share this post


Link to post
Share on other sites



lasaucisse,

If I use the classical "alt+space" shorcut, I can move it like I want (the pixel at the center exactly on the first line of the screen).

I can also move it with another window, with 4 buttons (move up, down, left, right).

Are you sure? If I use these methods to move a ToolWindow to a position where the title bar is not visible, as soon I stop moving it Windows snaps it back to where the bottom of the title bar is again visible. :mellow:

Could you post the code you are using?

M23


Any of my own code posted anywhere on the forum is available for use by others without any restriction of any kind._______My UDFs:

Spoiler

ArrayMultiColSort ---- Sort arrays on multiple columns
ChooseFileFolder ---- Single and multiple selections from specified path treeview listing
Date_Time_Convert -- Easily convert date/time formats, including the language used
ExtMsgBox --------- A highly customisable replacement for MsgBox
GUIExtender -------- Extend and retract multiple sections within a GUI
GUIFrame ---------- Subdivide GUIs into many adjustable frames
GUIListViewEx ------- Insert, delete, move, drag, sort, edit and colour ListView items
GUITreeViewEx ------ Check/clear parent and child checkboxes in a TreeView
Marquee ----------- Scrolling tickertape GUIs
NoFocusLines ------- Remove the dotted focus lines from buttons, sliders, radios and checkboxes
Notify ------------- Small notifications on the edge of the display
Scrollbars ----------Automatically sized scrollbars with a single command
StringSize ---------- Automatically size controls to fit text
Toast -------------- Small GUIs which pop out of the notification area

 

Share this post


Link to post
Share on other sites

ooops ! :mellow:

actuallaly, no, it doesn't work neither ! sorry...

so, I'll test the "4 buttons" method... thanks.


[size="1"]mostly useless softwares (sorry for old VB softs ^^) & others things[/size]

Share this post


Link to post
Share on other sites

#4 ·  Posted (edited)

ooops ! :mellow:

actuallaly, no, it doesn't work neither ! sorry...

so, I'll test the "4 buttons" method... thanks.

Dragging doesn't work, say by using message 0xF012, but WinMove is ok.

#include <windowsconstants.au3>
#include <guiconstantsex.au3>
#include <misc.au3>


$form1 = GUICreate("Form1", 300, 300, 340, 200, BitOR($GUI_SS_DEFAULT_GUI, $WS_MAXIMIZEBOX, $WS_SIZEBOX),$WS_EX_TOOLWINDOW)
$btn = GUICtrlCreateButton("move", 20, 20, 100, 25)
GUISetState()

While 1

    $msg = GUIGetMsg()
    Switch $msg
    Case $GUI_EVENT_PRIMARYDOWN;drag window by using winmove
 $cp = mousegetpos()
 $wp = wingetpos($form1)
 while _IsPressed(1)
            $dp = mousegetpos()
            winmove($form1,"",$wp[0] + $dp[0] - $cp[0],$wp[1] + $dp[1] - $cp[1])
 WEnd

    Case $btn
    WinMove($form1, "", 0, -40)
    Case - 3
    Exit
    EndSwitch

WEnd

I don't think it's anything to do with $WS_EX_Toolwindow.

Edited by martin

Serial port communications UDF Includes functions for binary transmission and reception.printing UDF Useful for graphs, forms, labels, reports etc.Add User Call Tips to SciTE for functions in UDFs not included with AutoIt and for your own scripts.Functions with parameters in OnEvent mode and for Hot Keys One function replaces GuiSetOnEvent, GuiCtrlSetOnEvent and HotKeySet.UDF IsConnected2 for notification of status of connected state of many urls or IPs, without slowing the script.

Share this post


Link to post
Share on other sites

I'll try this ! thanks ! :mellow:


[size="1"]mostly useless softwares (sorry for old VB softs ^^) & others things[/size]

Share this post


Link to post
Share on other sites

Create an account or sign in to comment

You need to be a member in order to leave a comment

Create an account

Sign up for a new account in our community. It's easy!


Register a new account

Sign in

Already have an account? Sign in here.


Sign In Now
Sign in to follow this  
Followers 0