Jump to content

Search the Community

Showing results for tags 'control viewer like'.



More search options

  • 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


Location


WWW


Interests

Found 1 result

  1. I would like to choose a window from a list, gather all the controls on that window, then select a control from the resulting list and "highlight" it on the original window much like is done in either the AutoIT Info Tool or Yashied's Control Viewer. The issues that I am having are: Identifying when the ListView is clicked and what row is clickedThen highlighting the field on the original windowThe reason for this script is not just for visualizing the controls, but to help identify specific pixel positions and colors for controls that require ControlClick such as a list of CheckBoxes in a List that does not list specific control IDs for each. So far I have the code below, I have also attached the non-standard (not out of the box) UDFs I am using: ; ====================================================================================================================================================== ; = Resize A Window Script = ; ====================================================================================================================================================== #Region ; Script ChangeLog ; ====================================================================================================================================================== Dim $Script_ChangeLog[3][2] $Script_ChangeLog[1][0] = "Version" $Script_ChangeLog[1][1] = "ChangeLog" $Script_ChangeLog[2][0] = "15.10.28" $Script_ChangeLog[2][1] = "Original Script." $Script_ChangeLog[0][0] = UBound($Script_ChangeLog) - 1 $Script_ChangeLog[0][1] = "Entries" _ArraySort($Script_ChangeLog, 1, 2, 0, 0) ; ====================================================================================================================================================== #EndRegion ; Script ChangeLog ; ====================================================================================================================================================== #Region ; Necessary Options ; ====================================================================================================================================================== Opt("GUICloseOnESC", 0) ; 0=ESC Won't Close, 1=ESC Closes Opt("TrayIconHide", 1) ; 1=Hides Icon, 0=Shows Icon Opt("TrayMenuMode", 1) ; Default tray menu items (Script Paused/Exit) will not be shown. ; ================================================================================================================================================== Global $Script_Name = FileGetVersion(@ScriptFullPath, "ProductName") Global $Script_Version = FileGetVersion(@ScriptFullPath, "ScriptVersion") Global $Script_FileName = FileGetVersion(@ScriptFullPath, "OriginalFileName") ; ====================================================================================================================================================== #EndRegion ; Necessary Options ; ====================================================================================================================================================== #Region ; Necessary Includes ; ====================================================================================================================================================== $Script_Exists = ProcessList(@ScriptName) If $Script_Exists[0][0] > 1 Then ; MsgBox(64, $Script_Name & ' Warning', 'An instance of this application is already running.') If WinExists($Script_Name & " " & $Script_Version) Then WinActivate($Script_Name & " " & $Script_Version) Else Send("^!w") EndIf Exit EndIf ; ================================================================================================================================================== #Region ; JB2_SplashScreen Dependencies ; ================================================================================================================================================== Global Const $JB2_SplashScreen_AC_SRC_ALPHA = 1 #Include <Resources.au3> #Include <GUIConstantsEx.au3> #Include <StaticConstants.au3> #Include <WindowsConstants.au3> ; ================================================================================================================================================== #EndRegion ; JB2_SplashScreen Dependencies ; ================================================================================================================================================== JB2_SplashScreen("On") JB2_SplashScreen("Update", "Loading Dependencies...") #Include <Array.au3> #Include <ShowMonitorInfo.au3> #Include <TrayMenuIcons.au3> #Include <WinAPI.au3> ; ================================================================================================================================================== #Region ; GUI Includes ; ================================================================================================================================================== #Include <ButtonConstants.au3> #Include <Constants.au3> #Include <ComboConstants.au3> #Include <EditConstants.au3> #Include <GDIPlus.au3> #Include <GuiButton.au3> #Include <GuiEdit.au3> #Include <GUIExtender.au3> #Include <GuiListBox.au3> #Include <GuiListView.au3> #include <ListboxConstants.au3> #Include <ListviewConstants.au3> #Include <Misc.au3> #Include <ScrollBarConstants.au3> ; ================================================================================================================================================== #EndRegion ; GUI Includes ; ====================================================================================================================================================== #EndRegion ; Necessary Includes ; ====================================================================================================================================================== #Region ; Necessary Variables ; ====================================================================================================================================================== HotKeySet("^!p", "Pixels2Table_GUI") HotKeySet("^!q", "_OnExitWithMsg") ; ====================================================================================================================================================== If StringInStr(@OSVersion, "7") Then $Taskbar_Specs = ControlGetPos("[Class:Shell_TrayWnd]", "", "ToolbarWindow321") Else $Taskbar_Specs = ControlGetPos("[Class:Shell_TrayWnd]", "", "ToolbarWindow322") EndIf If $Taskbar_Specs[3] = "" Then $Taskbar_Specs[3] = 22 EndIf Global $Progress_Top = Number(@DesktopHeight - Number(138 + $Taskbar_Specs[3])); Progress Window Default Height Is 128 Offset By 10 For Effect & 46 For TaskBar Global $Progress_Left = Number(@DeskTopWidth - 316); Progress Window Default Width Is 306 Offset By 10 For Effect ; ====================================================================================================================================================== Global $WindowList = '' Global $RWG_GUI = 'Closed' Global $RWG_OpenWindow_List = '' Global $RWG_OpenWindow_List_Content = '' Global $RWG_OpenWindow_List_CurrentContent = '' Global $RWG_WindowTitle_Edit = '' Global $RWG_WindowStart_Edit = '' Global $RWG_WindowResolution_Edit = '' Global $RWG_WindowState_Edit = '' Global $RWG_WindowMonitor_Edit = '' Global $RWG_WindowMonitorResolution_Edit = '' Global $RWG_WindowControlVisible_CheckBox = '' Global $RWG_WindowControlVisible = True Global $RWG_WindowControl_ListView = '' ; ====================================================================================================================================================== Global $P2T_FileName = @TempDir & '\P2T_Layout.html' Global $P2T_Header = '<!DOCTYPE html>' & @CRLF & _ '<html>' & @CRLF & _ @TAB & '<head>' & @CRLF & _ @TAB & @TAB & '<title>Pixel To Table</title>' & @CRLF & _ @TAB & @TAB & '<meta charset="UTF-8">' & @CRLF & _ @TAB & @TAB & '<style>' & @CRLF & _ @TAB & @TAB & @TAB & 'td' & @CRLF & _ @TAB & @TAB & @TAB & '{' & @CRLF & _ @TAB & @TAB & @TAB & @TAB & 'position: relative;' & @CRLF & _ @TAB & @TAB & @TAB & @TAB & 'color: rgb(0,0,0);' & @CRLF & _ @TAB & @TAB & @TAB & @TAB & 'height: 35px;' & @CRLF & _ @TAB & @TAB & @TAB & @TAB & 'width: 35px;' & @CRLF & _ @TAB & @TAB & @TAB & @TAB & 'font-family: Calibri, Arial, sans-serif;' & @CRLF & _ @TAB & @TAB & @TAB & @TAB & 'font-size: xx-small;' & @CRLF & _ @TAB & @TAB & @TAB & @TAB & 'text-align: center;' & @CRLF & _ @TAB & @TAB & @TAB & @TAB & 'text-decoration: none;' & @CRLF & _ @TAB & @TAB & @TAB & @TAB & 'z-index: 20;' & @CRLF & _ @TAB & @TAB & @TAB & '}' & @CRLF & @CRLF & _ @TAB & @TAB & @TAB & 'td span.cellcontent' & @CRLF & _ @TAB & @TAB & @TAB & '{' & @CRLF & _ @TAB & @TAB & @TAB & @TAB & 'display: block;' & @CRLF & _ @TAB & @TAB & @TAB & @TAB & 'min-width: 35px;' & @CRLF & _ @TAB & @TAB & @TAB & '}' & @CRLF & @CRLF & _ @TAB & @TAB & @TAB & 'td:hover' & @CRLF & _ @TAB & @TAB & @TAB & '{' & @CRLF & _ @TAB & @TAB & @TAB & @TAB & 'z-index: 30; ' & @CRLF & _ @TAB & @TAB & @TAB & '}' & @CRLF & @CRLF & _ @TAB & @TAB & @TAB & 'td span.hoverbox' & @CRLF & _ @TAB & @TAB & @TAB & '{' & @CRLF & _ @TAB & @TAB & @TAB & @TAB & 'display: none;' & @CRLF & _ @TAB & @TAB & @TAB & '}' & @CRLF & @CRLF & _ @TAB & @TAB & @TAB & 'td:hover span.hoverbox' & @CRLF & _ @TAB & @TAB & @TAB & '{ ' & @CRLF & _ @TAB & @TAB & @TAB & @TAB & 'display: block;' & @CRLF & _ @TAB & @TAB & @TAB & @TAB & 'position: absolute;' & @CRLF & _ @TAB & @TAB & @TAB & @TAB & 'top: 30px; ' & @CRLF & _ @TAB & @TAB & @TAB & @TAB & 'left: 30px; ' & @CRLF & _ @TAB & @TAB & @TAB & @TAB & 'width: 200px; /* auto */' & @CRLF & _ @TAB & @TAB & @TAB & @TAB & 'padding: 10px;' & @CRLF & _ @TAB & @TAB & @TAB & @TAB & 'color: rgb(255,255,255);' & @CRLF & _ @TAB & @TAB & @TAB & @TAB & 'font-family: Cambria, Times New Roman, serif;' & @CRLF & _ @TAB & @TAB & @TAB & @TAB & 'font-size: 24px;' & @CRLF & _ @TAB & @TAB & @TAB & @TAB & 'font-weight: bold;' & @CRLF & _ @TAB & @TAB & @TAB & @TAB & 'text-align: left;' & @CRLF & _ @TAB & @TAB & @TAB & @TAB & 'line-height: 28px;' & @CRLF & _ @TAB & @TAB & @TAB & @TAB & 'border: 1px solid rgb(51,51,51);' & @CRLF & _ @TAB & @TAB & @TAB & @TAB & 'background-color: rgb(102,102,102);' & @CRLF & _ @TAB & @TAB & @TAB & '}' & @CRLF & @CRLF & _ @TAB & @TAB & @TAB & 'span.hoverboxbody' & @CRLF & _ @TAB & @TAB & @TAB & '{' & @CRLF & _ @TAB & @TAB & @TAB & @TAB & 'font-family: Calibri, Arial, sans-serif;' & @CRLF & _ @TAB & @TAB & @TAB & @TAB & 'font-size: 20px; ' & @CRLF & _ @TAB & @TAB & @TAB & @TAB & 'font-weight: normal;' & @CRLF & _ @TAB & @TAB & @TAB & @TAB & 'line-height: 22px;' & @CRLF & _ @TAB & @TAB & @TAB & '}' & @CRLF & @CRLF & _ @TAB & @TAB & '</style>' & @CRLF & _ @TAB & '</head>' & @CRLF & _ @TAB & '<body>' & @CRLF & _ @TAB & @TAB & '<table style="border-collapse: collapse;">' & @CRLF Global $P2T_Footer = @TAB & @TAB & '</table>' & @CRLF & _ @TAB & '</body>' & @CRLF & _ '</html>' & @CRLF & @CRLF ; ====================================================================================================================================================== #EndRegion ; Necessary Variables ; ====================================================================================================================================================== JB2_SplashScreen("Off") ; ====================================================================================================================================================== #Region ; Script Body ; ====================================================================================================================================================== $RWG_GUI = GUICreate($Script_Name & " " & $Script_Version, 780, 680, -1, -1, BitXOR($GUI_SS_DEFAULT_GUI, $WS_MINIMIZEBOX)) ; ================================================================================================================================== #Region ; Menu Section ; ================================================================================================================================== $RWG_File_Menu = GUICtrlCreateMenu('&File') $RWG_Exit_MenuItem = GUICtrlCreateMenuItem('E&xit' & @TAB & 'Ctrl+Alt+Q', $RWG_File_Menu) $RWG_View_Menu = GUICtrlCreateMenu('&View') $RWG_RefreshWindowList_MenuItem = GUICtrlCreateMenuItem('&Refresh Window List...', $RWG_View_Menu) $RWG_Help_Menu = GUICtrlCreateMenu('&Help') $RWG_ChangeLog_MenuItem = GUICtrlCreateMenuItem('View Change &Log...', $RWG_Help_Menu) GUICtrlCreateMenuItem('', $RWG_Help_Menu) $RWG_About_MenuItem = GUICtrlCreateMenuItem('&About...', $RWG_Help_Menu) ; ================================================================================================================================== #EndRegion ; Menu Section ; ================================================================================================================================== $RWG_OpenWindow_Label = GUICtrlCreateLabel("Select A Window To Resize:", 10, 10, 600, 20, $SS_CENTER) $RWG_OpenWindow_List = GUICtrlCreateList("", 10, 30, 600, 300) Refresh_WindowList(0) $RWG_WindowInfo_Label = GUICtrlCreateLabel("Window Information:", 620, 10, 150, 20, $SS_CENTER) GUICtrlCreateGroup('', 620, 23, 150, 260) $RWG_WindowMonitor_Label = GUICtrlCreateLabel("Located On:", 630, 40, 130, 20, $SS_CENTER) GUICtrlSetBkColor($RWG_WindowMonitor_Label, $GUI_BKCOLOR_TRANSPARENT) $RWG_WindowMonitor_Edit = GUICtrlCreateEdit("", 630, 60, 130, 22, BitOR($ES_READONLY, $ES_CENTER)) $RWG_WindowStart_Label = GUICtrlCreateLabel("Start Position (Left x Top):", 630, 85, 130, 20, $SS_CENTER) GUICtrlSetBkColor($RWG_WindowStart_Label, $GUI_BKCOLOR_TRANSPARENT) $RWG_WindowStart_Edit = GUICtrlCreateEdit("", 630, 105, 130, 22, BitOR($ES_READONLY, $ES_CENTER)) $RWG_WindowResolution_Label = GUICtrlCreateLabel("Current Resolution:", 630, 130, 130, 20, $SS_CENTER) GUICtrlSetBkColor($RWG_WindowResolution_Label, $GUI_BKCOLOR_TRANSPARENT) $RWG_WindowResolution_Edit = GUICtrlCreateEdit("", 630, 150, 130, 22, BitOR($ES_READONLY, $ES_CENTER)) $RWG_WindowState_Label = GUICtrlCreateLabel("Maximized Or Minimized:", 630, 180, 130, 20, $SS_CENTER) GUICtrlSetBkColor($RWG_WindowState_Label, $GUI_BKCOLOR_TRANSPARENT) $RWG_WindowState_Edit = GUICtrlCreateEdit("", 630, 200, 130, 22, BitOR($ES_READONLY, $ES_CENTER)) $RWG_WindowMonitorResolution_Label = GUICtrlCreateLabel("Monitor Resolution:", 630, 225, 130, 20, $SS_CENTER) GUICtrlSetBkColor($RWG_WindowMonitorResolution_Label, $GUI_BKCOLOR_TRANSPARENT) $RWG_WindowMonitorResolution_Edit = GUICtrlCreateEdit("", 630, 245, 130, 22, BitOR($ES_READONLY, $ES_CENTER)) GUICtrlCreateGroup("", -99, -99, 1, 1) $RWG_Process_Button = GUICtrlCreateButton('Process Pixels', 620, 293, 150, 30, $BS_DEFPUSHBUTTON) $RWG_WindowControl_Label = GUICtrlCreateLabel("Window Controls:", 10, 330, 600, 20, $SS_CENTER) $RWG_WindowControlVisible_CheckBox = GUICtrlCreateCheckbox("Show Only Visible Controls", 625, 325) GUICtrlSetState($RWG_WindowControlVisible_CheckBox, $GUI_CHECKED) $RWG_WindowControl_ListView = GUICtrlCreateListView("Control Handle|Class|Instance|ID|Visible|Left (X)|Top (Y)|Width|Height|Control Text", 10, 350, 760, 300, BitOr($LVS_NOSORTHEADER, $LVS_SINGLESEL), BitOr($LVS_EX_FULLROWSELECT, $LVS_EX_GRIDLINES, $WS_EX_CLIENTEDGE)) _GUICtrlListView_SetColumnWidth($RWG_WindowControl_ListView, 0, 112) _GUICtrlListView_JustifyColumn($RWG_WindowControl_ListView, 0, 2) _GUICtrlListView_SetColumnWidth($RWG_WindowControl_ListView, 2, 63) _GUICtrlListView_JustifyColumn($RWG_WindowControl_ListView, 2, 2) _GUICtrlListView_SetColumnWidth($RWG_WindowControl_ListView, 4, 56) _GUICtrlListView_JustifyColumn($RWG_WindowControl_ListView, 4, 2) _GUICtrlListView_SetColumnWidth($RWG_WindowControl_ListView, 5, 56) _GUICtrlListView_JustifyColumn($RWG_WindowControl_ListView, 5, 2) _GUICtrlListView_SetColumnWidth($RWG_WindowControl_ListView, 6, 56) _GUICtrlListView_JustifyColumn($RWG_WindowControl_ListView, 6, 2) _GUICtrlListView_SetColumnWidth($RWG_WindowControl_ListView, 7, 56) _GUICtrlListView_JustifyColumn($RWG_WindowControl_ListView, 7, 2) _GUICtrlListView_SetColumnWidth($RWG_WindowControl_ListView, 8, 56) _GUICtrlListView_JustifyColumn($RWG_WindowControl_ListView, 8, 2) GUICtrlSetBkColor($RWG_WindowControl_ListView, $GUI_BKCOLOR_LV_ALTERNATE) Get_WindowInfo(GUICtrlRead($RWG_OpenWindow_List)) Get_WindowControls(GUICtrlRead($RWG_OpenWindow_List), $RWG_WindowControlVisible) GUISetState() _GUICtrlListView_ClickItem($RWG_WindowControl_ListView, 0) WinSetOnTop($RWG_GUI, '', 1) While 1 $RWG_Msg = GUIGetMsg() Switch $RWG_Msg Case $GUI_EVENT_CLOSE, $RWG_Exit_MenuItem _OnExit() Case $RWG_RefreshWindowList_MenuItem Refresh_WindowList(0) Get_WindowControls(GUICtrlRead($RWG_OpenWindow_List), $RWG_WindowControlVisible) Case $RWG_About_MenuItem GUISetState(@SW_DISABLE, $RWG_GUI) JB2_ThankYou(0, $RWG_GUI, $Script_Name, $Script_Version) GUISetState(@SW_ENABLE, $RWG_GUI) Case $RWG_ChangeLog_MenuItem GUISetState(@SW_DISABLE, $RWG_GUI) JB2_ChangeLog($RWG_GUI, $Script_Name, $Script_Version) GUISetState(@SW_ENABLE, $RWG_GUI) Case $RWG_OpenWindow_List Get_WindowInfo(GUICtrlRead($RWG_OpenWindow_List)) Get_WindowControls(GUICtrlRead($RWG_OpenWindow_List), $RWG_WindowControlVisible) Case $RWG_WindowControlVisible_CheckBox If BitAND(GUICtrlRead($RWG_WindowControlVisible_CheckBox), $GUI_CHECKED) = $GUI_CHECKED Then $RWG_WindowControlVisible = True Else $RWG_WindowControlVisible = False EndIf Get_WindowControls(GUICtrlRead($RWG_OpenWindow_List), $RWG_WindowControlVisible) Case $RWG_WindowControl_ListView MsgBox(4096, 'Test', _GUICtrlListView_GetSelectedIndices($RWG_WindowControl_ListView), -1, $RWG_GUI) Case $RWG_Process_Button $RWG_PB_CurrentSelection = _GUICtrlListView_GetSelectionMark($RWG_WindowControl_ListView) $RWG_PB_CurrentSelection_List = _GUICtrlListView_GetItemTextArray($RWG_WindowControl_ListView, $RWG_PB_CurrentSelection) $hFrame = _WinAPI_GetParent($RWG_PB_CurrentSelection_List[1]) #CS GUISetState(@SW_HIDE, $RWG_GUI) Pixels2Table(GUICtrlRead($RWG_OpenWindow_List)) GUISetState(@SW_SHOW, $RWG_GUI) #CE EndSwitch WEnd ; ====================================================================================================================================================== #EndRegion ; Script Body ; ====================================================================================================================================================== #Region ; Necessary Supporting Functions ; ====================================================================================================================================================== #Region ; Get_WindowList Function ; ================================================================================================================================================== Func Get_WindowList() $WindowList = '' $Temp_WindowList = WinList() $Temp_WindowList_Content = '' Dim $WindowList[$Temp_WindowList[0][0]+1][3] ; Declared Globally At The Beginning $WindowList[0][0] = $Temp_WindowList[0][0]+1 For $w = 1 To $Temp_WindowList[0][0] ; Windows To Ignore, Both Windows Without A Title And A Windows That Are Not Actually Visible If $Temp_WindowList[$w][0] = '' Or $Temp_WindowList[$w][0] = $Script_Name & " " & $Script_Version Or $Temp_WindowList[$w][0] = 'BBar' Or $Temp_WindowList[$w][0] = 'ICA Seamless Host Agent' Or $Temp_WindowList[$w][0] = 'Message' Or $Temp_WindowList[$w][0] = 'OLEChannelWnd' Or $Temp_WindowList[$w][0] = 'Program Manager' Or $Temp_WindowList[$w][0] = 'Splash GUI' Or $Temp_WindowList[$w][0] = 'Start' Or StringRight($Temp_WindowList[$w][0], 5) = 'Toast' Then ContinueLoop ; Gets The Handle of The Current Window $Temp_WindowState = WinGetState($Temp_WindowList[$w][1]) #CS ; Filtering Windows Based On Window State ConsoleWrite($aWindows[$i][0] & ': ') If BitAND($Temp_WindowState, 1) = 1 Then ConsoleWrite(' exists') If BitAND($Temp_WindowState, 2) = 2 Then ConsoleWrite(' visible') If BitAND($Temp_WindowState, 4) = 4 Then ConsoleWrite(' enabled') If BitAND($Temp_WindowState, 8) = 8 Then ConsoleWrite(' active') If BitAND($Temp_WindowState, 16) = 16 Then ConsoleWrite(' minimized') If BitAND($Temp_WindowState, 32) = 32 Then ConsoleWrite(' maximized') ConsoleWrite(@CRLF) #CE If BitAND($Temp_WindowState, 2) = 2 Then $WindowList[$w][0] = $Temp_WindowList[$w][0] $WindowList[$w][1] = $Temp_WindowList[$w][1] If BitAND($Temp_WindowState, 8) = 8 Then $WindowList[$w][2] &= 'Active / ' If BitAND($Temp_WindowState, 16) = 16 Then $WindowList[$w][2] &= 'Minimized / ' If BitAND($Temp_WindowState, 32) = 32 Then $WindowList[$w][2] &= 'Maximized' If StringRight($WindowList[$w][2], 3) = ' / ' Then $WindowList[$w][2] = StringTrimRight($WindowList[$w][2], 3) If StringInStr($Temp_WindowList[$w][0], '|') Then $Temp_WindowList[$w][0] = StringReplace($Temp_WindowList[$w][0], '|', '[JB' & Chr(178) & ']') $Temp_WindowList_Content &= $Temp_WindowList[$w][0] & '|' EndIf Next _ArraySort($WindowList, 0, 1, 0, 0) $WindowList = JB2_DeleteEmpty2DArrayRows($WindowList) ; Column Structure: 0 = WindowTitle / 1 = WindowHandle $WindowList[0][0] = UBound($WindowList) - 1 If StringRight($Temp_WindowList_Content, 1) = '|' Then $Temp_WindowList_Content = StringTrimRight($Temp_WindowList_Content, 1) Return $Temp_WindowList_Content EndFunc ; ================================================================================================================================================== #EndRegion ; Get_WindowList Function ; ================================================================================================================================================== #Region ; Get_WindowInfo Function ; ================================================================================================================================================== Func Get_WindowInfo($GWL_Title) GUICtrlSetData($RWG_WindowTitle_Edit, '') GUICtrlSetData($RWG_WindowStart_Edit, '') GUICtrlSetData($RWG_WindowResolution_Edit, '') GUICtrlSetData($RWG_WindowState_Edit, '') GUICtrlSetData($RWG_WindowMonitor_Edit, '') GUICtrlSetData($RWG_WindowMonitorResolution_Edit, '') $GWL_TempState = '' If StringInStr($GWL_Title, '[JB' & Chr(178) & ']') Then $GWL_Title = StringReplace($GWL_Title, '[JB' & Chr(178) & ']', '|') $GWL_CurrentWindow_ListPosition = _ArraySearch($WindowList, $GWL_Title) $GWL_Handle = $WindowList[$GWL_CurrentWindow_ListPosition][1] If StringInStr($WindowList[$GWL_CurrentWindow_ListPosition][2], 'Maximized') Then $GWL_State = 'Maximized' ElseIf StringInStr($WindowList[$GWL_CurrentWindow_ListPosition][2], 'Minimized') Then $GWL_State = 'Minimized' Else $GWL_State = 'No' EndIf _GetMonitors() If $GWL_State = 'Minimized' Then WinSetState($GWL_Handle, '', @SW_RESTORE) $GWL_TempState = WinGetState($GWL_Handle) ; To Determine If The Minimized Window Is Maximized If Restored. $Temp_WinInfo = WinGetPos($GWL_Handle) WinSetState($GWL_Handle, '', @SW_MINIMIZE) Else $Temp_WinInfo = WinGetPos($GWL_Handle) EndIf If IsArray($Temp_WinInfo) Then If UBound($Temp_WinInfo) = 4 Then If $GWL_State = 'Maximized' Or BitAND($GWL_TempState, 32) = 32 Then $Temp_WinInfo[0] += 8 $Temp_WinInfo[1] += 8 EndIf $GWL_Monitor = _GetMonitorFromPoint($Temp_WinInfo[0], $Temp_WinInfo[1]) GUICtrlSetData($RWG_WindowStart_Edit, $Temp_WinInfo[0] & 'x' & $Temp_WinInfo[1]) GUICtrlSetData($RWG_WindowResolution_Edit, $Temp_WinInfo[2] & 'x' & $Temp_WinInfo[3]) GUICtrlSetData($RWG_WindowState_Edit, $GWL_State) GUICtrlSetData($RWG_WindowMonitor_Edit, 'Monitor ' & $GWL_Monitor) GUICtrlSetData($RWG_WindowMonitorResolution_Edit, $__MonitorList[$GWL_Monitor][5] & 'x' & $__MonitorList[$GWL_Monitor][6]) Else Refresh_WindowList(1, 'The selected window is no longer available.') Get_WindowInfo(GUICtrlRead($RWG_OpenWindow_List)) EndIf Else Refresh_WindowList(1, 'The selected window is no longer available.') Get_WindowInfo(GUICtrlRead($RWG_OpenWindow_List)) EndIf EndFunc ; ================================================================================================================================================== #EndRegion ; Get_WindowInfo Function ; ================================================================================================================================================== #Region ; Get_WindowControls Function ; ================================================================================================================================================== Func Get_WindowControls($GWC_Title, $GWC_Visible = True) _GUICtrlListView_BeginUpdate($RWG_WindowControl_ListView) _GUICtrlListView_DeleteAllItems($RWG_WindowControl_ListView) $RWG_WindowControl_ListView_1Width = 13 $RWG_WindowControl_ListView_3Width = 7 $RWG_WindowControl_ListView_9Width = 12 If StringLen($GWC_Title) > $RWG_WindowControl_ListView_9Width Then $RWG_WindowControl_ListView_9Width = StringLen($GWC_Title) If StringInStr($GWC_Title, '[JB' & Chr(178) & ']') Then $GWC_Title = StringReplace($GWC_Title, '[JB' & Chr(178) & ']', '|') $GWC_CurrentWindow_ListPosition = _ArraySearch($WindowList, $GWC_Title) $GWC_Handle = $WindowList[$GWC_CurrentWindow_ListPosition][1] $Temp_WinInfo = WinGetPos($GWC_Handle) _GUICtrlListView_AddItem($RWG_WindowControl_ListView, $GWC_Handle, 0) _GUICtrlListView_AddSubItem($RWG_WindowControl_ListView, 0, 'Entire Window', 1) _GUICtrlListView_AddSubItem($RWG_WindowControl_ListView, 0, 0, 2) _GUICtrlListView_AddSubItem($RWG_WindowControl_ListView, 0, 0, 3) _GUICtrlListView_AddSubItem($RWG_WindowControl_ListView, 0, 1, 4) _GUICtrlListView_AddSubItem($RWG_WindowControl_ListView, 0, $Temp_WinInfo[0], 5) _GUICtrlListView_AddSubItem($RWG_WindowControl_ListView, 0, $Temp_WinInfo[1], 6) _GUICtrlListView_AddSubItem($RWG_WindowControl_ListView, 0, $Temp_WinInfo[2], 7) _GUICtrlListView_AddSubItem($RWG_WindowControl_ListView, 0, $Temp_WinInfo[3], 8) _GUICtrlListView_AddSubItem($RWG_WindowControl_ListView, 0, $GWC_Title, 9) $GWC_ControlList = JB2_GetWindowControls($GWC_Handle, $GWC_Visible) For $li = 1 To $GWC_ControlList[0][0] If StringLen($GWC_ControlList[$li][1]) > $RWG_WindowControl_ListView_1Width Then $RWG_WindowControl_ListView_1Width = StringLen($GWC_ControlList[$li][1]) If StringLen($GWC_ControlList[$li][3]) > $RWG_WindowControl_ListView_3Width Then $RWG_WindowControl_ListView_3Width = StringLen($GWC_ControlList[$li][3]) If StringLen($GWC_ControlList[$li][9]) > $RWG_WindowControl_ListView_9Width Then $RWG_WindowControl_ListView_9Width = StringLen($GWC_ControlList[$li][9]) Assign("$RWG_WindowControl_ListView_Row" & Number($li),GUICtrlCreateListViewItem($GWC_ControlList[$li][0] & "|" & $GWC_ControlList[$li][1] & "|" & $GWC_ControlList[$li][2] & "|" & $GWC_ControlList[$li][3] & "|" & $GWC_ControlList[$li][4] & "|" & $GWC_ControlList[$li][5] & "|" & $GWC_ControlList[$li][6] & "|" & $GWC_ControlList[$li][7] & "|" & $GWC_ControlList[$li][8] & "|" & $GWC_ControlList[$li][9], $RWG_WindowControl_ListView)) GUICtrlSetBkColor(-1, 0xcccccc) Next _GUICtrlListView_SetColumnWidth($RWG_WindowControl_ListView, 1, Number(($RWG_WindowControl_ListView_1Width + 1) * 8)) ; 8px average width of characters at 8pt font. _GUICtrlListView_JustifyColumn($RWG_WindowControl_ListView, 1) _GUICtrlListView_SetColumnWidth($RWG_WindowControl_ListView, 3, Number(($RWG_WindowControl_ListView_3Width + 1) * 7)) ; 7px average width of characters at 8pt numeric font. _GUICtrlListView_JustifyColumn($RWG_WindowControl_ListView, 3, 2) _GUICtrlListView_SetColumnWidth($RWG_WindowControl_ListView, 9, Number(($RWG_WindowControl_ListView_9Width + 1) * 8)) ; 8px average width of characters at 8pt font. _GUICtrlListView_JustifyColumn($RWG_WindowControl_ListView, 9) _GUICtrlListView_EndUpdate($RWG_WindowControl_ListView) _GUICtrlListView_ClickItem($RWG_WindowControl_ListView, 0) EndFunc ; ================================================================================================================================================== #EndRegion ; Get_WindowControls Function ; ================================================================================================================================================== #Region ; Pixels2Table Function ; ================================================================================================================================================== Func Pixels2Table($P2T_Window) ProgressOn("Converting Pixels To HTML Table", "", "", $Progress_Left, $Progress_Top, 2) $P2T_CurrentWindow_ListPosition = _ArraySearch($WindowList, $P2T_Window) If StringInStr($WindowList[$P2T_CurrentWindow_ListPosition][2], 'Minimized') Then WinSetState($WindowList[$P2T_CurrentWindow_ListPosition][1], '', @SW_RESTORE) $P2T_CurrentWindow_Position = WinGetPos($WindowList[$P2T_CurrentWindow_ListPosition][1]) If StringLen($P2T_CurrentWindow_Position[2]) >= StringLen($P2T_CurrentWindow_Position[3]) Then $P2T_XYDigits = StringLen($P2T_CurrentWindow_Position[2]) Else $P2T_XYDigits = StringLen($P2T_CurrentWindow_Position[3]) EndIf WinActivate($WindowList[$P2T_CurrentWindow_ListPosition][1]) $ProgressTotalItems = Number($P2T_CurrentWindow_Position[2] * $P2T_CurrentWindow_Position[3]) $ProgressPercentPer = Number(100/$ProgressTotalItems) $ProgressProgress = 0 $ProgressPercent = 0 $ProgressLabel1 = "0 of " & $ProgressTotalItems & " Pixels(s)" $ProgressLabel2 = "0% Completed." ProgressSet($ProgressPercent, $ProgressLabel1 & " / " & $ProgressLabel2) ; ============================================================================================================================================== $P2T_FileHandle = FileOpen($P2T_FileName, 2) FileWrite($P2T_FileHandle, $P2T_Header) ; ============================================================================================================================================== $P2T_Y = 1 ; For $y = 1 To $P2T_CurrentWindow_Position[3] For $y = $P2T_CurrentWindow_Position[1] To Number($P2T_CurrentWindow_Position[1] + $P2T_CurrentWindow_Position[3]) FileWrite($P2T_FileHandle, @TAB & @TAB & @TAB & '<tr>' & @CRLF) ; ========================================================================================================================================== $P2T_X = 1 ; For $x = 1 To $P2T_CurrentWindow_Position[2] For $x = $P2T_CurrentWindow_Position[0] To Number($P2T_CurrentWindow_Position[0] + $P2T_CurrentWindow_Position[2]) ProgressSet($ProgressPercent, $ProgressLabel1 & " / " & $ProgressLabel2, 'Row (Y): ' & StringFormat('%0' & $P2T_XYDigits & 'i', $P2T_Y) & ' / Column (X): ' & StringFormat('%0' & $P2T_XYDigits & 'i', $P2T_X)) $Temp_P2T_Color = '#' & Hex(PixelGetColor($x, $y, $WindowList[$P2T_CurrentWindow_ListPosition][1]) , 6) FileWrite($P2T_FileHandle, @TAB & @TAB & @TAB & @TAB & '<td style="background-color: ' & $Temp_P2T_Color & ';"><span class="cellcontent">' & StringFormat('%0' & $P2T_XYDigits & 'i', $P2T_X) & 'X<br>' & StringFormat('%0' & $P2T_XYDigits & 'i', $P2T_Y) & 'Y</span><span class="hoverbox">Pixel Infomation<br><span class="hoverboxbody">Row (Y Position): ' & $P2T_Y & '<br>Column (X Position): ' & $P2T_X & '<br>Color Code: ' & $Temp_P2T_Color & '</span></span></td>' & @CRLF) $ProgressProgress += 1 $ProgressPercent += $ProgressPercentPer $ProgressLabel1 = $ProgressProgress & " of " & $ProgressTotalItems & " Pixrls(s)" $ProgressLabel2 = Round($ProgressPercent, 0) & "% Completed." $P2T_X += 1 Next ; ========================================================================================================================================== FileWrite($P2T_FileHandle, @TAB & @TAB & @TAB & '</tr>' & @CRLF) $P2T_Y += 1 Next ; ============================================================================================================================================== FileWrite($P2T_FileHandle, $P2T_Footer) FileClose($P2T_FileHandle) $ProgressLabel2 = "100% Completed." ProgressSet(100, $ProgressLabel1 & " / " & $ProgressLabel2, "Software Installation Complete") Sleep(5000) ProgressOff() ; ============================================================================================================================================== ShellExecute($P2T_FileName) EndFunc ; ================================================================================================================================================== #EndRegion ; Pixels2Table Function ; ================================================================================================================================================== #Region ; Refresh_WindowList Function ; ================================================================================================================================================== Func Refresh_WindowList($RWL_TrayTip, $RWL_MsgContent = '') ; $RWL_TrayTip : 0 = Off / 1 = On If $RWL_MsgContent <> '' And StringRight($RWL_MsgContent, 1) <> ' ' Then $RWL_MsgContent &= ' ' If $RWL_TrayTip = 1 Then TrayTip('Resize-A-Window...', $RWL_MsgContent & 'Refreshing window list.', 10, 2) $RWG_OpenWindow_List_Content = Get_WindowList() $RWG_OpenWindow_List_CurrentContent = '' For $a = 1 To $WindowList[0][0] If StringInStr($WindowList[$a][2], 'Active') Then $RWG_OpenWindow_List_CurrentContent = $WindowList[$a][0] Next If $RWG_OpenWindow_List_CurrentContent = '' Then $RWG_OpenWindow_List_CurrentContent = $WindowList[1][0] GUICtrlSetData($RWG_OpenWindow_List, '', '') GUICtrlSetData($RWG_OpenWindow_List, $RWG_OpenWindow_List_Content, $RWG_OpenWindow_List_CurrentContent) EndFunc ; ================================================================================================================================================== #EndRegion ; Refresh_WindowList Function ; ================================================================================================================================================== #Region ; JB2_GetWindowControls Function ; ============================================================================================================================================================ ; = Name.............: JB2_GetWindowControls = ; = Description......: Returns all or a specified subset of controls for a given window. = ; = Required Includes: Array.au3 & WinAPI.au3 = ; = Syntax...........: JB2_GetWindowControls($GWC_WindowHandle[, $GWC_VisibleOnly = False[, $GWC_ControlTextContains = ''[, $GWC_GetSpecificClasses = '']]]) = ; = Parameters ......: $GWC_WindowHandle - The handle (hWnd) of the window to get the controls from. = ; = $GWC_VisibleOnly - Optional: True - Retrieves only visible controls or False - Retrieves all controls. = ; = $GWC_ControlTextContains - Optional: Text that a control must contain to be returned. = ; = $GWC_GetSpecificClasses - Optional: A specific class to return. (i.e. Button, ComboBox, Edit, Static, Etc.) = ; = Return values....: Success - Returns an array containing window control information. = ; = Failure - 0 = ; = Author...........: jdelaney = ; = Modified.........: Joshua Barnette, JBSquaredDesigns.com (2015-10-26) = ; = Retrieved From...: https://www.autoitscript.com/forum/topic/164226-get-all-windows-controls/ = ; = Remarks..........: If only the window handle is given all window controls are returned. = ; = = ; = The array returned is two-dimensional and is made up as follows: = ; = $aArray[0][0] = Number of controls returned = ; = $aArray[1][0] = 1st control handle (hWnd) = ; = $aArray[1][1] = 1st control class = ; = $aArray[1][2] = 1st control class instance = ; = $aArray[1][3] = 1st control ID = ; = $aArray[1][4] = 1st control visibility (1 - Visible, 0 - Not Visible) = ; = $aArray[1][5] = 1st control X position realtive to window = ; = $aArray[1][6] = 1st control Y position realtive to window = ; = $aArray[1][7] = 1st control width = ; = $aArray[1][8] = 1st control height = ; = $aArray[1][9] = 1st control text = ; = ... = ; = $aArray[n][0] = nth control handle (hWnd) = ; = $aArray[n][1] = nth control class = ; = $aArray[n][2] = nth control class instance = ; = $aArray[n][3] = nth control ID = ; = $aArray[n][4] = nth control visibility (1 - Visible, 0 - Not Visible) = ; = $aArray[n][5] = nth control X position realtive to window = ; = $aArray[n][6] = nth control Y position realtive to window = ; = $aArray[n][7] = nth control width = ; = $aArray[n][8] = nth control height = ; = $aArray[n][9] = nth control text = ; = = ; ============================================================================================================================================================ Func JB2_GetWindowControls($GWC_WindowHandle, $GWC_VisibleOnly = 0, $GWC_ControlTextContains = '', $GWC_GetSpecificClass = '') If Not IsHWnd($GWC_WindowHandle) Then ; MsgBox(16, $Script_Name & ' Error', 'To retrieve all window controls, you must provide a valid window handle (hwnd).') Return 0 EndIf $GWC_GetClassList = WinGetClassList($GWC_WindowHandle) ; Create array $GWC_ClassList = StringSplit($GWC_GetClassList, @CRLF, 2) ; Sort array _ArraySort($GWC_ClassList) _ArrayDelete($GWC_ClassList, 0) Dim $GWC_WindowControlList[UBound($GWC_ClassList) + 1][10] $GWC_WindowControlList[0][0] = UBound($GWC_ClassList) + 1 ; Loop $GWC_CurrentClass = '' $GWC_CurrentClassCount = 1 $GWC_TotalCounter = 1 If StringLen($GWC_GetSpecificClass) > 0 Then For $sc = UBound($GWC_ClassList)-1 To 0 Step - 1 If $GWC_ClassList[$sc] <> $GWC_GetSpecificClass Then _ArrayDelete($GWC_ClassList, $sc) EndIf Next EndIf For $cl = 0 To UBound($GWC_ClassList) - 1 If $GWC_ClassList[$cl] = $GWC_CurrentClass Then $GWC_CurrentClassCount += 1 Else $GWC_CurrentClass = $GWC_ClassList[$cl] $GWC_CurrentClassCount = 1 EndIf $GWC_ControlHandle = ControlGetHandle($GWC_WindowHandle, "", "[CLASSNN:" & $GWC_CurrentClass & $GWC_CurrentClassCount & "]") $GWC_ControlText = StringRegExpReplace(ControlGetText($GWC_WindowHandle, "", $GWC_ControlHandle), "[\n\r]", "{@CRLF}") $GWC_ControlPosition = ControlGetPos($GWC_WindowHandle, "", $GWC_ControlHandle) $GWC_CurrentClassID = _WinAPI_GetDlgCtrlID($GWC_ControlHandle) $GWC_ControlVisibility = ControlCommand($GWC_WindowHandle, "", $GWC_ControlHandle, "IsVisible") If $GWC_VisibleOnly And Not $GWC_ControlVisibility Then ; $GWC_TotalCounter += 1 ContinueLoop EndIf If StringLen($GWC_ControlTextContains) > 0 Then If Not StringInStr($GWC_ControlText, $GWC_ControlTextContains) Then ; $GWC_TotalCounter += 1 ContinueLoop EndIf EndIf $GWC_WindowControlList[$GWC_TotalCounter][0] = $GWC_ControlHandle $GWC_WindowControlList[$GWC_TotalCounter][1] = $GWC_ClassList[$cl] $GWC_WindowControlList[$GWC_TotalCounter][2] = $GWC_CurrentClassCount $GWC_WindowControlList[$GWC_TotalCounter][3] = $GWC_CurrentClassID $GWC_WindowControlList[$GWC_TotalCounter][4] = $GWC_ControlVisibility If IsArray($GWC_ControlPosition) Then $GWC_WindowControlList[$GWC_TotalCounter][5] = $GWC_ControlPosition[0] $GWC_WindowControlList[$GWC_TotalCounter][6] = $GWC_ControlPosition[1] $GWC_WindowControlList[$GWC_TotalCounter][7] = $GWC_ControlPosition[2] $GWC_WindowControlList[$GWC_TotalCounter][8] = $GWC_ControlPosition[3] EndIf $GWC_WindowControlList[$GWC_TotalCounter][9] = $GWC_ControlText If Not WinExists($GWC_WindowHandle) Then ExitLoop $GWC_TotalCounter += 1 Next $GWC_WindowControlList = JB2_DeleteEmpty2DArrayRows($GWC_WindowControlList) $GWC_WindowControlList[0][0] = UBound($GWC_WindowControlList) - 1 Return $GWC_WindowControlList EndFunc ;==>GetAllWindowsControls ; ============================================================================================================================================================ ; = Author...........: jdelaney = ; = Modified.........: Joshua Barnette, JBSquaredDesigns.com (2015-10-26) = ; = Retrieved From...: https://www.autoitscript.com/forum/topic/164226-get-all-windows-controls/ = ; ============================================================================================================================================================ #EndRegion ; JB2_GetWindowControls Function ; ================================================================================================================================================== #Region ; OnExit Functions ; ================================================================================================================================================== Func _OnExit() GUIDelete($RWG_GUI) Exit EndFunc ; ================================================================================================================================================== Func _OnExitWithMsg() GUIDelete($RWG_GUI) JB2_ThankYou(2000) Exit EndFunc ; ================================================================================================================================================== #EndRegion ; OnExit Functions ; ================================================================================================================================================== #Region ; JB2_DeleteEmpty2DArrayRows Function ; ================================================================================================================================================== ; = Written By: WeaponX ; = Retrieved From : http://www.autoitscript.com/forum/topic/97637-remove-empty-rows-in-2d-array/ ; = Modified By: Joshua Barnette, JBSquaredDesigns.com (2014-05-28) ; ============================================================================================================================================== Func JB2_DeleteEmpty2DArrayRows($JB2_DeleteEmpty2DArrayRows_Array) Local $JB2_DeleteEmpty2DArrayRows_Rows = Ubound($JB2_DeleteEmpty2DArrayRows_Array,1) Local $JB2_DeleteEmpty2DArrayRows_Cols = Ubound($JB2_DeleteEmpty2DArrayRows_Array,2) Local $JB2_DeleteEmpty2DArrayRows_Temp[$JB2_DeleteEmpty2DArrayRows_Rows][$JB2_DeleteEmpty2DArrayRows_Cols] Local $JB2_DeleteEmpty2DArrayRows_NotEmpty Local $JB2_DeleteEmpty2DArrayRows_Count = 0 ;Loop through rows For $Y = 0 to $JB2_DeleteEmpty2DArrayRows_Rows - 1 $JB2_DeleteEmpty2DArrayRows_NotEmpty = 0 ;Loop through columns For $X = 0 to $JB2_DeleteEmpty2DArrayRows_Cols - 1 ;Copy all columns to temp array even if they are all empty $JB2_DeleteEmpty2DArrayRows_Temp[$JB2_DeleteEmpty2DArrayRows_Count][$X] = $JB2_DeleteEmpty2DArrayRows_Array[$Y][$X] ;If even one column contains data, make sure it doesn't get deleted If $JB2_DeleteEmpty2DArrayRows_Array[$Y][$X] <> "" Then $JB2_DeleteEmpty2DArrayRows_NotEmpty = BitOr($JB2_DeleteEmpty2DArrayRows_NotEmpty, 1) Next ;If the row has any data, increment, else keep overwriting last row until it contains something If $JB2_DeleteEmpty2DArrayRows_NotEmpty Then $JB2_DeleteEmpty2DArrayRows_Count += 1 Next Redim $JB2_DeleteEmpty2DArrayRows_Temp[$JB2_DeleteEmpty2DArrayRows_Count][$JB2_DeleteEmpty2DArrayRows_Cols] $JB2_DeleteEmpty2DArrayRows_Temp[0][0] = UBound($JB2_DeleteEmpty2DArrayRows_Temp) - 1 Return $JB2_DeleteEmpty2DArrayRows_Temp EndFunc ; ================================================================================================================================================== #EndRegion ; JB2_DeleteEmpty2DArrayRows Function ; ================================================================================================================================================== #Region ; JB2_SplashScreen & Supporting Functions ; ================================================================================================================================================== #Region ; JB2_SplashScreen ; ============================================================================================================================================== Func JB2_SplashScreen($JB2_SplashScreen_Status, $JB2_SplashScreen_Status_Message = "") If $JB2_SplashScreen_Status = "On" Then Global $JB2_SplashScreen_Image = _ResourceGetAsImage("JB2_SplashScreen_Image", $RT_RCDATA) ; Extract image width and height from PNG Global $JB2_SplashScreen_Width = _GDIPlus_ImageGetWidth($JB2_SplashScreen_Image) Global $JB2_SplashScreen_Height = _GDIPlus_ImageGetHeight($JB2_SplashScreen_Image) ; Create layered window Global $JB2_SplashScreen_GUI = GUICreate("Splash GUI", $JB2_SplashScreen_Width, $JB2_SplashScreen_Height, -1, -1, $WS_POPUP, $WS_EX_LAYERED, WinGetHandle(AutoItWinGetTitle())) JB2_SplashScreen_SetBitmap($JB2_SplashScreen_GUI, $JB2_SplashScreen_Image, 0) GUISetState(@SW_SHOW) ;fade in png background For $i = 0 To 255 Step 17 JB2_SplashScreen_SetBitmap($JB2_SplashScreen_GUI, $JB2_SplashScreen_Image, $i) Sleep(50) Next ; create child MDI gui window to hold controls Global $JB2_SplashScreen_GUI_Child = GUICreate("Splash GUI Child", $JB2_SplashScreen_Width-20, 17, 10, $JB2_SplashScreen_Height+5, $WS_POPUP, BitOR($WS_EX_LAYERED, $WS_EX_MDICHILD), $JB2_SplashScreen_GUI) ; child window transparency is required to accomplish the full effect, so $WS_EX_LAYERED above, and ; I think the way this works is the transparent window color is based on the image you set here: GUICtrlCreatePic("", 0, 0, $JB2_SplashScreen_Width-20, 17) GUICtrlSetState(-1, $GUI_DISABLE) Global $JB2_SplashScreen_GUI_Message = GUICtrlCreateLabel("", 0, 0, $JB2_SplashScreen_Width-20, 17) GUICtrlSetFont(-1, 9, 800) If StringInStr(@OSVersion, "WIN_XP") Then GUICtrlSetColor(-1, 0x000066) GUICtrlSetBKColor(-1, 0x000000) Else GUICtrlSetColor(-1, 0x000066) GUICtrlSetBKColor(-1, 0xFFFFFF) EndIf GUISetState(@SW_SHOW) ElseIf $JB2_SplashScreen_Status = "Update" Then GUICtrlSetData($JB2_SplashScreen_GUI_Message, $JB2_SplashScreen_Status_Message) ElseIf $JB2_SplashScreen_Status = "Off" Then GUIDelete($JB2_SplashScreen_GUI_Child) For $i = 255 To 0 Step -17 JB2_SplashScreen_SetBitmap($JB2_SplashScreen_GUI, $JB2_SplashScreen_Image, $i) Sleep(50) Next GUIDelete($JB2_SplashScreen_GUI) _WinAPI_DeleteObject($JB2_SplashScreen_Image) EndIf EndFunc ; ============================================================================================================================================== #EndRegion ; JB2_SplashScreen ; ============================================================================================================================================== #Region ; JB2_SplashScreen_SetBitmap ; ============================================================================================================================================== Func JB2_SplashScreen_SetBitmap($JB2_SplashScreen_hGUI, $JB2_SplashScreen_hImage, $JB2_SplashScreen_iOpacity) Local $JB2_SplashScreen_hScrDC, $JB2_SplashScreen_hMemDC, $JB2_SplashScreen_hBitmap, $JB2_SplashScreen_hOld, $JB2_SplashScreen_pSize, $JB2_SplashScreen_tSize, $JB2_SplashScreen_pSource, $JB2_SplashScreen_tSource, $JB2_SplashScreen_pBlend, $JB2_SplashScreen_tBlend $JB2_SplashScreen_hScrDC = _WinAPI_GetDC(0) $JB2_SplashScreen_hMemDC = _WinAPI_CreateCompatibleDC($JB2_SplashScreen_hScrDC) $JB2_SplashScreen_hBitmap = _GDIPlus_BitmapCreateHBITMAPFromBitmap($JB2_SplashScreen_hImage) $JB2_SplashScreen_hOld = _WinAPI_SelectObject($JB2_SplashScreen_hMemDC, $JB2_SplashScreen_hBitmap) $JB2_SplashScreen_tSize = DllStructCreate($tagSIZE) $JB2_SplashScreen_pSize = DllStructGetPtr($JB2_SplashScreen_tSize) DllStructSetData($JB2_SplashScreen_tSize, "X", _GDIPlus_ImageGetWidth($JB2_SplashScreen_hImage)) DllStructSetData($JB2_SplashScreen_tSize, "Y", _GDIPlus_ImageGetHeight($JB2_SplashScreen_hImage)) $JB2_SplashScreen_tSource = DllStructCreate($tagPOINT) $JB2_SplashScreen_pSource = DllStructGetPtr($JB2_SplashScreen_tSource) $JB2_SplashScreen_tBlend = DllStructCreate($tagBLENDFUNCTION) $JB2_SplashScreen_pBlend = DllStructGetPtr($JB2_SplashScreen_tBlend) DllStructSetData($JB2_SplashScreen_tBlend, "Alpha", $JB2_SplashScreen_iOpacity) DllStructSetData($JB2_SplashScreen_tBlend, "Format", $JB2_SplashScreen_AC_SRC_ALPHA) _WinAPI_UpdateLayeredWindow($JB2_SplashScreen_hGUI, $JB2_SplashScreen_hScrDC, 0, $JB2_SplashScreen_pSize, $JB2_SplashScreen_hMemDC, $JB2_SplashScreen_pSource, 0, $JB2_SplashScreen_pBlend, $ULW_ALPHA) _WinAPI_ReleaseDC(0, $JB2_SplashScreen_hScrDC) _WinAPI_SelectObject($JB2_SplashScreen_hMemDC, $JB2_SplashScreen_hOld) _WinAPI_DeleteObject($JB2_SplashScreen_hBitmap) _WinAPI_DeleteDC($JB2_SplashScreen_hMemDC) EndFunc ; ============================================================================================================================================== #EndRegion ; JB2_SplashScreen_SetBitmap ; ================================================================================================================================================== #EndRegion ; JB2_SplashScreen & Supporting Functions ; ================================================================================================================================================== #Region ; JB2_ChangeLog Function ; ================================================================================================================================================== Func JB2_ChangeLog($JB2_ChangeLog_GUIWindow = '', $JB2_ChangeLog_Script_Title = '', $JB2_ChangeLog_Script_Version = '') $JB2_ChangeLog_ListView_0Width = 0 $JB2_ChangeLog_ListView_1Width = 0 If $JB2_ChangeLog_Script_Title = '' Then $JB2_ChangeLog_GUI_Title = 'Change Log' Else $JB2_ChangeLog_GUI_Title = $JB2_ChangeLog_Script_Title & ' Change Log' EndIf $JB2_ChangeLog_GUI = GUICreate($JB2_ChangeLog_GUI_Title, 600, 550, -1, -1, BitXOR($GUI_SS_DEFAULT_GUI, $WS_MINIMIZEBOX), -1, $JB2_ChangeLog_GUIWindow) $JB2_ChangeLog_AppLogo = GUICtrlCreatePic("", 15, 15, 256, 256) GUICtrlSetBkColor($JB2_ChangeLog_AppLogo, $GUI_BKCOLOR_TRANSPARENT) _ResourceSetImageToCtrl($JB2_ChangeLog_AppLogo, "JB2_SplashScreen_Image") GUICtrlCreateLabel($JB2_ChangeLog_Script_Title, 296, 25, 300, 25, $SS_CENTER) GUICtrlSetFont (-1, 14, 800) If $JB2_ChangeLog_Script_Version <> "" Then GUICtrlCreateLabel("Version: " & $JB2_ChangeLog_Script_Version, 296, 50, 300, 20, $SS_CENTER) GUICtrlSetFont (-1, 10, 600) EndIf GUICtrlCreateLabel("Copyright © 2014-" & @YEAR & ", JBSquaredDesigns.com." & @CRLF & "All Rights Reserved.", 296, 75, 300, 30, $SS_CENTER) $JB2_ChangeLog_Logo = GUICtrlCreatePic("", 382, 105, 128, 128) GUICtrlSetBkColor($JB2_ChangeLog_Logo, $GUI_BKCOLOR_TRANSPARENT) _ResourceSetImageToCtrl($JB2_ChangeLog_Logo, "JB2_128PNG_Logo") GUICtrlCreateGroup("", 10, 276, 580, 265) GUICtrlCreateLabel("Change Log", 20, 288, 560, 30, $SS_CENTER) GUICtrlSetFont (-1, 14, 800) $JB2_ChangeLog_ListView = GUICtrlCreateListView("Date|Changes", 20, 316, 560, 215, BitOr($LVS_NOSORTHEADER, $LVS_SORTASCENDING), BitOr($LVS_EX_FULLROWSELECT, $LVS_EX_GRIDLINES, $WS_EX_CLIENTEDGE)) GUICtrlSetBkColor($JB2_ChangeLog_ListView, $GUI_BKCOLOR_LV_ALTERNATE) For $li = 2 To $Script_ChangeLog[0][0] If StringLen($Script_ChangeLog[$li][0]) > $JB2_ChangeLog_ListView_0Width Then $JB2_ChangeLog_ListView_0Width = StringLen($Script_ChangeLog[$li][0]) If StringLen($Script_ChangeLog[$li][1]) > $JB2_ChangeLog_ListView_1Width Then $JB2_ChangeLog_ListView_1Width = StringLen($Script_ChangeLog[$li][1]) Assign("$JB2_ChangeLog_ListView_Row" & Number($li - 1),GUICtrlCreateListViewItem($Script_ChangeLog[$li][0] & "|" & $Script_ChangeLog[$li][1], $JB2_ChangeLog_ListView)) GUICtrlSetBkColor(-1, 0xcccccc) Next _GUICtrlListView_SetColumnWidth($JB2_ChangeLog_ListView, 0, Number(($JB2_ChangeLog_ListView_0Width + 2) * 8)) ; 8px average width of characters at 8pt font. _GUICtrlListView_JustifyColumn($JB2_ChangeLog_ListView, 0, 2) _GUICtrlListView_SetColumnWidth($JB2_ChangeLog_ListView, 1, Number(($JB2_ChangeLog_ListView_1Width + 1) * 8)) ; 8px average width of characters at 8pt font. _GUICtrlListView_JustifyColumn($JB2_ChangeLog_ListView, 1) GUICtrlCreateGroup("", -99, -99, 1, 1) GUISetState() While 1 $JB2_ChangeLog_iMsg = GUIGetMsg() Switch $JB2_ChangeLog_iMsg Case $GUI_EVENT_CLOSE GUIDelete($JB2_ChangeLog_GUI) Return EndSwitch WEnd EndFunc ; ================================================================================================================================================== #EndRegion ; JB2_ChangeLog Function ; ================================================================================================================================================== #Region ; JB2_ThankYou Function ; ================================================================================================================================================== Func JB2_ThankYou($JB2_ThankYou_SleepTimer, $JB2_ThankYou_GUIWindow = '', $JB2_ThankYou_Script_Title = '', $JB2_ThankYou_Script_Version = '') If $JB2_ThankYou_SleepTimer <> 0 Then $JB2_ThankYou_GUI = GUICreate("Thank You For Choosing:", 280, 280, -1, -1, BitXOR($GUI_SS_DEFAULT_GUI, $WS_MINIMIZEBOX), -1, $JB2_ThankYou_GUIWindow) $Logo = GUICtrlCreatePic("", 15, 15, 250, 250, $SS_SUNKEN) _ResourceSetImageToCtrl($Logo, "JB2_Logo") GUISetState() Sleep($JB2_ThankYou_SleepTimer) Else If $JB2_ThankYou_Script_Title = "" Then $JB2_ThankYou_GUI_Title = "About" Else $JB2_ThankYou_GUI_Title = "About " & $JB2_ThankYou_Script_Title EndIf $JB2_ThankYou_GUI = GUICreate($JB2_ThankYou_GUI_Title, 560, 280, -1, -1, BitXOR($GUI_SS_DEFAULT_GUI, $WS_MINIMIZEBOX), -1, $JB2_ThankYou_GUIWindow) $Logo = GUICtrlCreatePic("", 15, 15, 250, 250, $SS_SUNKEN) _ResourceSetImageToCtrl($Logo, "JB2_Logo") GUICtrlCreateLabel($JB2_ThankYou_Script_Title, 290, 25, 260, 25, $SS_CENTER) GUICtrlSetFont (-1, 14, 800) If $JB2_ThankYou_Script_Version <> "" Then GUICtrlCreateLabel("Version: " & $JB2_ThankYou_Script_Version, 290, 50, 260, 20, $SS_CENTER) GUICtrlSetFont (-1, 10, 600) EndIf GUICtrlCreateLabel("Copyright © 2014-" & @YEAR & ", JBSquaredDesigns.com." & @CRLF & "All Rights Reserved.", 290, 75, 260, 200, $SS_CENTER) GUISetState() While 1 $JB2_ThankYou_iMsg = GUIGetMsg() Switch $JB2_ThankYou_iMsg Case $GUI_EVENT_CLOSE GUIDelete($JB2_ThankYou_GUI) Return EndSwitch WEnd EndIf EndFunc ; ================================================================================================================================================== #EndRegion ; JB2_ThankYou Function ; ====================================================================================================================================================== #EndRegion ; Necessary Supporting Functions ; ====================================================================================================================================================== TrayMenuIcons.au3 ShowMonitorInfo.au3
×
×
  • Create New...