Jump to content

Search the Community

Showing results for tags 'titlebar'.

  • Search By Tags

    Type tags separated by commas.
  • Search By Author

Content Type


Forums

  • General
    • Announcements and Site News
    • Administration
  • AutoIt v3
    • AutoIt Help and Support
    • AutoIt Technical Discussion
    • AutoIt Example Scripts
  • Scripting and Development
    • Developer General Discussion
    • Language Specific Discussion
  • IT Administration
    • Operating System Deployment
    • Windows Client
    • Windows Server
    • Office

Categories

  • AutoIt Team
    • Beta
    • MVP
  • AutoIt
    • Automation
    • Databases and web connections
    • Data compression
    • Encryption and hash
    • Games
    • GUI Additions
    • Hardware
    • Information gathering
    • Internet protocol suite
    • Maths
    • Media
    • PDF
    • Security
    • Social Media and other Website API
    • Windows
  • Scripting and Development
  • IT Administration
    • Operating System Deployment
    • Windows Client
    • Windows Server
    • Office

Find results in...

Find results that contain...


Date Created

  • Start

    End


Last Updated

  • Start

    End


Filter by number of...

Joined

  • Start

    End


Group


Member Title


Location


WWW


Interests

Found 2 results

  1. I've been searching far and wide for a way to get the title bar size of any active window. What I'm trying to accomplish is moving the mouse to the top left corner of the window (so as to find true window position, relative to screen origin), the corner position where the window borders meet. I'm able to do this for some windows, but other windows do not have the title bar within the client area. So I have to find the title bar size in order to position the mouse where I want it. I've seen suggestions to use _WinAPI_GetSystemMetrics() but it returns a constant, and some windows have a different size title bar than what is returned. Here is a script to work with that outputs to the console what is happening: #include <WinAPISysWin.au3> HotKeySet( "{ESC}", "abort") HotKeySet( "{PAUSE}", "_GetWindowCorner") While 1 Sleep( 1000) WEnd Func _GetWindowCorner() Local $aAbsWinPos[2] Local $aDiff[2] ;~ Preserve mouse position. $aMousePos = MouseGetPos() ;~ Get the coordinate of the window. ConsoleWrite( "Window title: " & WinGetTitle( "[ACTIVE]") & @CRLF) $aWinPos = WinGetPos( "[ACTIVE]") ; Get position of active window. ConsoleWrite( "$aWinPos[0]: " & $aWinPos[0] & @CRLF) ConsoleWrite( "$aWinPos[1]: " & $aWinPos[1] & @CRLF) ;~ Record the absolute position of the window. AutoItSetOption( "MouseCoordMode", 2) ; Make mouse coordinate relative to active window client area origin. MouseMove( 0, 0, 0) ; Move mouse to client area origin. Sleep ( 3000) ; Pause to show where the mouse is for troubleshooting. AutoItSetOption( "MouseCoordMode", 1) ; Make mouse positioning relative to screen origin again. $aAbsWinPos = MouseGetPos() ; Record client area origin relative to screen origin. ;~ Get the difference between window client origin and screen origin. ConsoleWrite( "$aAbsWinPos[0]: " & $aAbsWinPos[0] & @CRLF) ConsoleWrite( "$aAbsWinPos[1]: " & $aAbsWinPos[1] & @CRLF) $aDiff[0] = $aWinPos[0] - $aAbsWinPos[0] $aDiff[1] = $aWinPos[1] - $aAbsWinPos[1] ConsoleWrite( "Difference X: " & $aDiff[0] & @CRLF) ConsoleWrite( "Difference Y: " & $aDiff[1] & @CRLF) If Abs($aDiff[0]) > 0 Then $aAbsWinPos[0] -= 1 ; Account for x axis difference, if any. Any difference will be 1, therefore subtract 1. ;If Abs($aDiff[1]) > 0 Then $aAbsWinPos[1] -= _TitleBarSize() ; Account for y axis difference, if any. Difference will be variable, therefore subtract variable. ConsoleWrite( "True Win X: " & $aAbsWinPos[0] & @CRLF) ConsoleWrite( "True Win Y: " & $aAbsWinPos[1] & @CRLF & @CRLF) ;~ Restore mouse position. MouseMove( $aMousePos[0], $aMousePos[1], 0) EndFunc ;===> _GetWindowCorner Func abort() Exit EndFunc ;===> abort As you can see, on line 36, the code is commented out. That is the code that I need to complete, accounting for the title bar size. I can't use it unless I find a way to get the variable title bar size, which is different per window. A good example to see that difference would be to use the window of the autoit script itself, and a notepad window. The notepad's title bar is included in the client area, whereas the Autoit window's title bar is excluded. Func _TitleBarSize() ;~ Code to get variable title bar size... help :c Return $Size EndFunc ;===> _TitleBarSize I need some help making a function to get the title bar size, I appreciate any help or guidance I can get here, I've been at it for a while now :c It helps me to have the window at screen position (0, 0), the code works on notepad because it accounts for the x axis difference as it is always only 1 coordinate point off (I may be wrong). But when it comes to a window like WinRAR or AutoIT, the title bar changes things, and is not always a set value. An example of this discrepancy can be demonstrated by the code when toggled on an AutoIT script, and on the AutoIT compiler program. The compiler has a smaller title bar, excluded from the client area. Thanks in advance!
  2. I wrote this application over the last couple of days because a friend was complaining that Windows needed a Roll-up button that minimizes a window to it's titlebar, aside from regular minimize. (Note: you must actually activate a window to see the button.) More than that - this button can be right-clicked to display and change information about a window quickly. The information includes the basics like HWnd, Title, State(using state values, not flags), Transparency, Position, Dimensions and Processname/PID. Note: You can find the Exit option by right-clicking the button as well. ***Grabby Movement*** To change the horizontal placement you can click the "grabby" button and move the mouse until the buttons are placed where you want them and then click the grabby button again to set them there. Current Script Version - 16 RollupPro_16.zip Function Credits: _ReduceMemory - w0uterWinGetTrans* - Valik_ProcessGetName - Process.au3 UDF (Erifash?, Wouter?)_ProcessGetPriority - Process.au3 UDF_Win_TBHeight - Zedna - (v12 and lower - Prog@ndy, WinAPI.au3, Structures.au3)_ProcessSuspend/Resume - The Kandie Man_WinAPI_GetAncestor - PaulIA - WinAPI.au3_WinAPI_GetClassName - PaulIA - WinAPI.au3_WinAPI_PtInRect - PaulIA - WinAPI.au3_WinAPI_GetWindowRect* - PaulIA - WinAPI.au3* notes a function was modified in operation slightly. 5-5-13 Edit: fixed posted images.
×
×
  • Create New...