Sign in to follow this  
Followers 0
golfinhu

how to add a button next to the minimize button?

11 posts in this topic

#1 ·  Posted (edited)

how to i add on button equal in the image:

Posted Image

I just want to add window in firefox, is this possible?

thanks!

Edited by golfinhu

Share this post


Link to post
Share on other sites



golfinhu,

Just to give you the idea, this adds a button to your SciTE GUI when you run it: :>

#include <GUIConstantsEx.au3>
#include <WindowsConstants.au3>

Global $sMain_Title = "[CLASS:SciTEWindow]"
Global $hSciTE_Wnd = WinGetHandle($sMain_Title)
Global $hScite_Dir_Wnd = WinGetHandle("DirectorExtension")

Global $iSciTE_Last_X, $iSciTE_Last_Y, $hButtonGUI, $hButton

_Button_Create()
_Button_Follow()

While 1

    ; Check SciTE is running
    If ProcessExists("SciTE.exe") Then
        ; Move button as required
        _Button_Follow()
    Else
        Exit
    EndIf

    If GUIGetMsg() = $hButton Then
        MsgBox(0, "Hi!", "Added button clicked")
    EndIf

WEnd

Func _Button_Create()

    ; Locate SciTE window
    Local $aSciTE_Pos = WinGetPos($hSciTE_Wnd)
    Local $iX = $aSciTE_Pos[0] + $aSciTE_Pos[2] - 130
    Local $iY = $aSciTE_Pos[1] + 10

    ; Create button GUI
    $hButtonGUI = GUICreate("SciTE Button", 30, 16, $iX, $iY, $WS_POPUP, $WS_EX_TOOLWINDOW, $hSciTE_Wnd)

    ; Set button GUI in z-order just above SciTE
    DllCall("user32.dll", "bool", "SetWindowPos", "hwnd", $hButtonGUI, "hwnd", $hSciTE_Wnd, "int", $iX, "int", $iY, "int", 30, "int", 16, "uint", 0x0010) ; $SWP_NOACTIVATE

    ; Create button
    $hButton = GUICtrlCreateButton("+", 0, 0, 30, 16)
    GUICtrlSetFont(-1, 18)

    GUISetState(@SW_SHOW, $hButtonGUI)

    ; Reset SciTE window focus
    WinActivate($hSciTE_Wnd)

EndFunc   ;==>_Button_Create

Func _Button_Follow()

    ; Check if SciTE exists
    Local $aSciTE_Pos = WinGetPos($hSciTE_Wnd)
    If @error Then Return
    ; Check SciTE position
    If $aSciTE_Pos[0] <> $iSciTE_Last_X Or $aSciTE_Pos[1] <> $iSciTE_Last_Y Then
        $iSciTE_Last_X = $aSciTE_Pos[0]
        $iSciTE_Last_Y = $aSciTE_Pos[1]
        ; Move button to follow
        WinMove($hButtonGUI, '', $aSciTE_Pos[0] + $aSciTE_Pos[2] - 130, $aSciTE_Pos[1] + 10)
    EndIf

EndFunc   ;==>_Button_Follow

You may need to adjust the position a bit depending on the style you use for your GUIs. You will see that the button disappears and reappears when SciTE is minimzed and restored and that the script exits when SciTE closes. ;)

Please ask if you have any questions. :unsure:

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

#3 ·  Posted (edited)

That's a good example Melba23. I didn't realize that setting the z order that way kept the relative z order of the 2 windows. Thanks.(Struck out - see post 10)

BTW I think you need to have

Func _Button_Follow()

    ; Check if SciTE exists
    Local $aSciTE_Pos = WinGetPos($hSciTE_Wnd)
    If @error Then Return
    ; Check SciTE position
    If $aSciTE_Pos[0]  + $aSciTE_Pos[2] <> $iSciTE_Last_X Or $aSciTE_Pos[1] <> $iSciTE_Last_Y Then
        $iSciTE_Last_X = $aSciTE_Pos[0] + $aSciTE_Pos[2]
        $iSciTE_Last_Y = $aSciTE_Pos[1]
        ; Move button to follow
        WinMove($hButtonGUI, '', $aSciTE_Pos[0] + $aSciTE_Pos[2] - 130, $aSciTE_Pos[1] + 10)
    EndIf

EndFunc   ;==>_Button_Follow
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 agree with Martin. Shame this can't be done with _WinAPI Commands, but all in all a great alternative :unsure:


_AdapterConnections()_AlwaysRun()_AppMon()_AppMonEx()_BinaryBin()_CheckMsgBox()_CmdLineRaw()_ContextMenu()_ConvertLHWebColor()/_ConvertSHWebColor()_DesktopDimensions()_DisplayPassword()_DotNet_Load()/_DotNet_Unload()_Fibonacci()_FileCompare()_FileCompareContents()_FileNameByHandle()_FilePrefix/SRE()_FindInFile()_GetBackgroundColor()/_SetBackgroundColor()_GetConrolID()_GetCtrlClass()_GetDirectoryFormat()_GetDriveMediaType()_GetFilename()/_GetFilenameExt()_GetHardwareID()_GetIP()_GetIP_Country()_GetOSLanguage()_GetSavedSource()_GetStringSize()_GetSystemPaths()_GetURLImage()_GIFImage()_GoogleWeather()_GUICtrlCreateGroup()_GUICtrlListBox_CreateArray()_GUICtrlListView_CreateArray()_GUICtrlListView_SaveCSV()_GUICtrlListView_SaveHTML()_GUICtrlListView_SaveTxt()_GUICtrlListView_SaveXML()_GUICtrlMenu_Recent()_GUICtrlMenu_SetItemImage()_GUICtrlTreeView_CreateArray()_GUIDisable()_GUIImageList_SetIconFromHandle()_GUIRegisterMsg()_GUISetIcon()_Icon_Clear()/_Icon_Set()_IdleTime()_InetGet()_InetGetGUI()_InetGetProgress()_IPDetails()_IsFileOlder()_IsGUID()_IsHex()_IsPalindrome()_IsRegKey()_IsStringRegExp()_IsSystemDrive()_IsUPX()_IsValidType()_IsWebColor()_Language()_Log()_MicrosoftInternetConnectivity()_MSDNDataType()_PathFull/GetRelative/Split()_PathSplitEx()_PrintFromArray()_ProgressSetMarquee()_ReDim()_RockPaperScissors()/_RockPaperScissorsLizardSpock()_ScrollingCredits_SelfDelete()_SelfRename()_SelfUpdate()_SendTo()_ShellAll()_ShellFile()_ShellFolder()_SingletonHWID()_SingletonPID()_Startup()_StringCompact()_StringIsValid()_StringRegExpMetaCharacters()_StringReplaceWholeWord()_StringStripChars()_Temperature()_TrialPeriod()_UKToUSDate()/_USToUKDate()_WinAPI_Create_CTL_CODE()_WinAPI_CreateGUID()_WMIDateStringToDate()/_DateToWMIDateString()Au3 script parsingAutoIt SearchAutoIt3 PortableAutoIt3WrapperToPragmaAutoItWinGetTitle()/AutoItWinSetTitle()CodingDirToHTML5FileInstallrFileReadLastChars()GeoIP databaseGUI - Only Close ButtonGUI ExamplesGUICtrlDeleteImage()GUICtrlGetBkColor()GUICtrlGetStyle()GUIEventsGUIGetBkColor()Int_Parse() & Int_TryParse()IsISBN()LockFile()Mapping CtrlIDsOOP in AutoItParseHeadersToSciTE()PasswordValidPasteBinPosts Per DayPreExpandProtect GlobalsQueue()Resource UpdateResourcesExSciTE JumpSettings INISHELLHOOKShunting-YardSignature CreatorStack()Stopwatch()StringAddLF()/StringStripLF()StringEOLToCRLF()VSCROLLWM_COPYDATAMore Examples...

Updated: 04/09/2015

Share this post


Link to post
Share on other sites

#5 ·  Posted (edited)

martin,

As long as you use the same value for both instances:

If $aSciTE_Pos[0] + $aSciTE_Pos[2] <> $iSciTE_Last_X Or $aSciTE_Pos[1] <> $iSciTE_Last_Y Then

$iSciTE_Last_X = $aSciTE_Pos[0] + $aSciTE_Pos[2]

I do not think it matters whether you use $aSciTE_Pos[0] or $aSciTE_Pos[0] + $aSciTE_Pos[2] - all you are looking for is a change in the position of a point of the SciTE GUI.

You are quite correct - thanks for pointing it out. :unsure:

guinness,

I will take that as agreement with the "good example" rather than "BTW I think you need"! ;)

M23

Edit: Pretty obvious! :>

Edited by Melba23

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

golfinhu,

Just to give you the idea, this adds a button to your SciTE GUI when you run it: :>

#include <GUIConstantsEx.au3>
#include <WindowsConstants.au3>

Global $sMain_Title = "[CLASS:SciTEWindow]"
Global $hSciTE_Wnd = WinGetHandle($sMain_Title)
Global $hScite_Dir_Wnd = WinGetHandle("DirectorExtension")

Global $iSciTE_Last_X, $iSciTE_Last_Y, $hButtonGUI, $hButton

_Button_Create()
_Button_Follow()

While 1

    ; Check SciTE is running
    If ProcessExists("SciTE.exe") Then
        ; Move button as required
        _Button_Follow()
    Else
        Exit
    EndIf

    If GUIGetMsg() = $hButton Then
        MsgBox(0, "Hi!", "Added button clicked")
    EndIf

WEnd

Func _Button_Create()

    ; Locate SciTE window
    Local $aSciTE_Pos = WinGetPos($hSciTE_Wnd)
    Local $iX = $aSciTE_Pos[0] + $aSciTE_Pos[2] - 130
    Local $iY = $aSciTE_Pos[1] + 10

    ; Create button GUI
    $hButtonGUI = GUICreate("SciTE Button", 30, 16, $iX, $iY, $WS_POPUP, $WS_EX_TOOLWINDOW, $hSciTE_Wnd)

    ; Set button GUI in z-order just above SciTE
    DllCall("user32.dll", "bool", "SetWindowPos", "hwnd", $hButtonGUI, "hwnd", $hSciTE_Wnd, "int", $iX, "int", $iY, "int", 30, "int", 16, "uint", 0x0010) ; $SWP_NOACTIVATE

    ; Create button
    $hButton = GUICtrlCreateButton("+", 0, 0, 30, 16)
    GUICtrlSetFont(-1, 18)

    GUISetState(@SW_SHOW, $hButtonGUI)

    ; Reset SciTE window focus
    WinActivate($hSciTE_Wnd)

EndFunc   ;==>_Button_Create

Func _Button_Follow()

    ; Check if SciTE exists
    Local $aSciTE_Pos = WinGetPos($hSciTE_Wnd)
    If @error Then Return
    ; Check SciTE position
    If $aSciTE_Pos[0] <> $iSciTE_Last_X Or $aSciTE_Pos[1] <> $iSciTE_Last_Y Then
        $iSciTE_Last_X = $aSciTE_Pos[0]
        $iSciTE_Last_Y = $aSciTE_Pos[1]
        ; Move button to follow
        WinMove($hButtonGUI, '', $aSciTE_Pos[0] + $aSciTE_Pos[2] - 130, $aSciTE_Pos[1] + 10)
    EndIf

EndFunc   ;==>_Button_Follow

You may need to adjust the position a bit depending on the style you use for your GUIs. You will see that the button disappears and reappears when SciTE is minimzed and restored and that the script exits when SciTE closes. ;)

Please ask if you have any questions. :unsure:

M23

yeah, good logic, I broke my head too but I could not think of anything!

but it worked perfectly!

thanks for the code, and thanks for helping me again!

Share this post


Link to post
Share on other sites

golfinhu,

Glad I could help. :unsure:

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

I will take that as agreement with the "good example" rather than "BTW I think you need"!

It did come across as the classic "It's great but.....it good be better" sentence :unsure: But of course I was being genuine and honest!

_AdapterConnections()_AlwaysRun()_AppMon()_AppMonEx()_BinaryBin()_CheckMsgBox()_CmdLineRaw()_ContextMenu()_ConvertLHWebColor()/_ConvertSHWebColor()_DesktopDimensions()_DisplayPassword()_DotNet_Load()/_DotNet_Unload()_Fibonacci()_FileCompare()_FileCompareContents()_FileNameByHandle()_FilePrefix/SRE()_FindInFile()_GetBackgroundColor()/_SetBackgroundColor()_GetConrolID()_GetCtrlClass()_GetDirectoryFormat()_GetDriveMediaType()_GetFilename()/_GetFilenameExt()_GetHardwareID()_GetIP()_GetIP_Country()_GetOSLanguage()_GetSavedSource()_GetStringSize()_GetSystemPaths()_GetURLImage()_GIFImage()_GoogleWeather()_GUICtrlCreateGroup()_GUICtrlListBox_CreateArray()_GUICtrlListView_CreateArray()_GUICtrlListView_SaveCSV()_GUICtrlListView_SaveHTML()_GUICtrlListView_SaveTxt()_GUICtrlListView_SaveXML()_GUICtrlMenu_Recent()_GUICtrlMenu_SetItemImage()_GUICtrlTreeView_CreateArray()_GUIDisable()_GUIImageList_SetIconFromHandle()_GUIRegisterMsg()_GUISetIcon()_Icon_Clear()/_Icon_Set()_IdleTime()_InetGet()_InetGetGUI()_InetGetProgress()_IPDetails()_IsFileOlder()_IsGUID()_IsHex()_IsPalindrome()_IsRegKey()_IsStringRegExp()_IsSystemDrive()_IsUPX()_IsValidType()_IsWebColor()_Language()_Log()_MicrosoftInternetConnectivity()_MSDNDataType()_PathFull/GetRelative/Split()_PathSplitEx()_PrintFromArray()_ProgressSetMarquee()_ReDim()_RockPaperScissors()/_RockPaperScissorsLizardSpock()_ScrollingCredits_SelfDelete()_SelfRename()_SelfUpdate()_SendTo()_ShellAll()_ShellFile()_ShellFolder()_SingletonHWID()_SingletonPID()_Startup()_StringCompact()_StringIsValid()_StringRegExpMetaCharacters()_StringReplaceWholeWord()_StringStripChars()_Temperature()_TrialPeriod()_UKToUSDate()/_USToUKDate()_WinAPI_Create_CTL_CODE()_WinAPI_CreateGUID()_WMIDateStringToDate()/_DateToWMIDateString()Au3 script parsingAutoIt SearchAutoIt3 PortableAutoIt3WrapperToPragmaAutoItWinGetTitle()/AutoItWinSetTitle()CodingDirToHTML5FileInstallrFileReadLastChars()GeoIP databaseGUI - Only Close ButtonGUI ExamplesGUICtrlDeleteImage()GUICtrlGetBkColor()GUICtrlGetStyle()GUIEventsGUIGetBkColor()Int_Parse() & Int_TryParse()IsISBN()LockFile()Mapping CtrlIDsOOP in AutoItParseHeadersToSciTE()PasswordValidPasteBinPosts Per DayPreExpandProtect GlobalsQueue()Resource UpdateResourcesExSciTE JumpSettings INISHELLHOOKShunting-YardSignature CreatorStack()Stopwatch()StringAddLF()/StringStripLF()StringEOLToCRLF()VSCROLLWM_COPYDATAMore Examples...

Updated: 04/09/2015

Share this post


Link to post
Share on other sites

Sorry Melba23! Decided to have a little play around with your code and came up with this alternative >>

The button positions are adjusted to work in Windows 7, it will also move relatively according to if the Window is maximised or not. I also made the GUI transparent. I also couldn't work out why you used "SetWindowPos" >> _WinAPI_SetWindowPos(), because the code works without this Function. :unsure:

#AutoIt3Wrapper_Au3Check_Parameters=-d -w 1 -w 2 -w 3 -w 4 -w 5 -w 6
#AutoIt3Wrapper_UseX64=N

#include <WindowsConstants.au3>
#include <WinAPI.au3>

Global $Global_ButtonGUI, $Global_Button ; Required.

_Main()

Func _Main()
    Local $sTitle = "[CLASS:Notepad]", $sProcess = "Notepad.exe" ; Notepad Window
;~  Local $sTitle = "[CLASS:SciTEWindow]", $sProcess = "SciTE.exe" ; SciTE Window

    If ProcessExists($sProcess) = 0 Then
        Run($sProcess)
        Sleep(100)
    EndIf

    _Button_Create($sTitle, "_Button_Create()")

    While 1
        If ProcessExists($sProcess) Then
            _Button_Follow($sTitle) ; Move Button
        Else
            Exit
        EndIf

        If GUIGetMsg() = $Global_Button Then
            MsgBox(0, "_Button_Follow()", "Button Clicked.")
        EndIf
    WEnd
EndFunc   ;==>_Main

Func _Button_Create($sTitle, $sText)
    Local $hHandle = WinGetHandle($sTitle)
    Local $aWinGetPos = WinGetPos($sTitle)
    Local $iWidth = 16, $iHeight = 16, $iYOffset

    If BitAND(WinGetState($hHandle), 32) Then
        $iYOffset = 10
    Else
        $iYOffset = 5
    EndIf

    Local $iXPos = $aWinGetPos[0] + $aWinGetPos[2] - 140
    Local $iYPos = $aWinGetPos[1] + $iYOffset

    $Global_ButtonGUI = GUICreate($sText, $iWidth, $iHeight, $iXPos, $iYPos, $WS_POPUP, $WS_EX_LAYERED, $hHandle)
    GUISetBkColor(0xABCDEF)
    _WinAPI_SetLayeredWindowAttributes($Global_ButtonGUI, 0xABCDEF)
;~  _WinAPI_SetWindowPos($Global_ButtonGUI, $hHandle, $iXPos, $iYPos, $iWidth, $iHeight, 0x0010) ; <<<<< Couldn't work out what this was needed for?!
    $Global_Button = GUICtrlCreateButton("+", 0, 0, $iWidth, $iHeight)
    GUICtrlSetFont(-1, 18)

    GUISetState(@SW_SHOW, $Global_ButtonGUI)
    WinActivate($hHandle)
    _Button_Follow($sTitle)
    Return $hHandle
EndFunc   ;==>_Button_Create

Func _Button_Follow($sTitle)
    Local $aWinGetPos = WinGetPos($sTitle), $iYOffset
    If @error Then
        Return 0
    EndIf
    If IsDeclared("Global_XPos") = 0 Then
        Global $Global_XPos
    EndIf
    If IsDeclared("Global_YPos") = 0 Then
        Global $Global_YPos
    EndIf

    If BitAND(WinGetState($sTitle), 32) Then
        $iYOffset = 10
    Else
        $iYOffset = 5
    EndIf

    If $aWinGetPos[0] + $aWinGetPos[2] <> $Global_XPos Or $aWinGetPos[1] <> $Global_YPos Then
        $Global_XPos = $aWinGetPos[0] + $aWinGetPos[2]
        $Global_YPos = $aWinGetPos[1]
        WinMove($Global_ButtonGUI, '', $aWinGetPos[0] + $aWinGetPos[2] - 140, $aWinGetPos[1] + $iYOffset)
    EndIf
EndFunc   ;==>_Button_Follow

_AdapterConnections()_AlwaysRun()_AppMon()_AppMonEx()_BinaryBin()_CheckMsgBox()_CmdLineRaw()_ContextMenu()_ConvertLHWebColor()/_ConvertSHWebColor()_DesktopDimensions()_DisplayPassword()_DotNet_Load()/_DotNet_Unload()_Fibonacci()_FileCompare()_FileCompareContents()_FileNameByHandle()_FilePrefix/SRE()_FindInFile()_GetBackgroundColor()/_SetBackgroundColor()_GetConrolID()_GetCtrlClass()_GetDirectoryFormat()_GetDriveMediaType()_GetFilename()/_GetFilenameExt()_GetHardwareID()_GetIP()_GetIP_Country()_GetOSLanguage()_GetSavedSource()_GetStringSize()_GetSystemPaths()_GetURLImage()_GIFImage()_GoogleWeather()_GUICtrlCreateGroup()_GUICtrlListBox_CreateArray()_GUICtrlListView_CreateArray()_GUICtrlListView_SaveCSV()_GUICtrlListView_SaveHTML()_GUICtrlListView_SaveTxt()_GUICtrlListView_SaveXML()_GUICtrlMenu_Recent()_GUICtrlMenu_SetItemImage()_GUICtrlTreeView_CreateArray()_GUIDisable()_GUIImageList_SetIconFromHandle()_GUIRegisterMsg()_GUISetIcon()_Icon_Clear()/_Icon_Set()_IdleTime()_InetGet()_InetGetGUI()_InetGetProgress()_IPDetails()_IsFileOlder()_IsGUID()_IsHex()_IsPalindrome()_IsRegKey()_IsStringRegExp()_IsSystemDrive()_IsUPX()_IsValidType()_IsWebColor()_Language()_Log()_MicrosoftInternetConnectivity()_MSDNDataType()_PathFull/GetRelative/Split()_PathSplitEx()_PrintFromArray()_ProgressSetMarquee()_ReDim()_RockPaperScissors()/_RockPaperScissorsLizardSpock()_ScrollingCredits_SelfDelete()_SelfRename()_SelfUpdate()_SendTo()_ShellAll()_ShellFile()_ShellFolder()_SingletonHWID()_SingletonPID()_Startup()_StringCompact()_StringIsValid()_StringRegExpMetaCharacters()_StringReplaceWholeWord()_StringStripChars()_Temperature()_TrialPeriod()_UKToUSDate()/_USToUKDate()_WinAPI_Create_CTL_CODE()_WinAPI_CreateGUID()_WMIDateStringToDate()/_DateToWMIDateString()Au3 script parsingAutoIt SearchAutoIt3 PortableAutoIt3WrapperToPragmaAutoItWinGetTitle()/AutoItWinSetTitle()CodingDirToHTML5FileInstallrFileReadLastChars()GeoIP databaseGUI - Only Close ButtonGUI ExamplesGUICtrlDeleteImage()GUICtrlGetBkColor()GUICtrlGetStyle()GUIEventsGUIGetBkColor()Int_Parse() & Int_TryParse()IsISBN()LockFile()Mapping CtrlIDsOOP in AutoItParseHeadersToSciTE()PasswordValidPasteBinPosts Per DayPreExpandProtect GlobalsQueue()Resource UpdateResourcesExSciTE JumpSettings INISHELLHOOKShunting-YardSignature CreatorStack()Stopwatch()StringAddLF()/StringStripLF()StringEOLToCRLF()VSCROLLWM_COPYDATAMore Examples...

Updated: 04/09/2015

Share this post


Link to post
Share on other sites

#10 ·  Posted (edited)

martin,

As long as you use the same value for both instances:

If $aSciTE_Pos[0] + $aSciTE_Pos[2] <> $iSciTE_Last_X Or $aSciTE_Pos[1] <> $iSciTE_Last_Y Then

$iSciTE_Last_X = $aSciTE_Pos[0] + $aSciTE_Pos[2]

I do not think it matters whether you use $aSciTE_Pos[0] or $aSciTE_Pos[0] + $aSciTE_Pos[2] - all you are looking for is a change in the position of a point of the SciTE GUI.

M23

if you resize the window by making it less wide then the button is left out in space if you don't use the right-hand edge of the scite window so I thought it mattered.

EDit: I see I misunderstood how the button kept it's z order. It wasn't the WInSetPos it was because you had made it a child of the Scite window. Silly me.

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

martin,

Now you explain it like that I can see that you are quite right - the code from which I developed that script referred to a toolbar linked to the left hand edge of a GUI so I was only interested in the left hand corner.

My apologies. :unsure:

guinness,

The SetWindowPos line sets the GUI containing the new button immediately above the target GUI in the z-order - so it always appears above the GUI regardless of where the GUI itself is in the z-order. I imagine that the SetLayeredWindowAttributes call places the button within the target GUI and so makes the z-order placement redundant. Perhaps someone with more knowledge of this area can confirm - or more likely give the correct explanation. :>

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

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