Jump to content

aa2zz6

Active Members
  • Posts

    398
  • Joined

  • Last visited

  • Days Won

    1

Everything posted by aa2zz6

  1. Is there a way I can update/modify existing time records in my INI file? The idea is to have my INI file update times when a script runs throughout the working day. I wasn't sure if there is a one-liner code I could use to access the INI file, find the AGOL_Last_Published or AC_Last_Published values and modify the times with a current one. The timestamps won't be the same for each value since scripts run at different intervals throughout the day. -INI Record [GIS_Record] Run__ArcGIS_Online_Updates=True AGOL_Last_Published=06:02:48 <<---- Run__AC_Inspections_Updates=True AC_Last_Published=08:02:48 <<-----
  2. Hey Nine, I'm trying to setup a file Manager script so that when excel sheets (See images) get created by our customer service reps in the New Assignments folder the File Manager script reads cell AA3 determines which office (Strasburg, Lancaster, Mentor) and moves it to the office folder. What would be the best practice because I'm thinking duplication might be an issue possibly?
  3. How do I get my script to loop through an array variable $OfficeSearch? #include <Excel.au3> #include <File.au3> Global $strasburg_Office = @ScriptDir & "\..\../2) Strasburg Office/0_Service_Request/" Global $OfficeSearch[3] = ["Strasburg", "Lancaster", "Mentor"] Global $aFile = _FileListToArrayRec(@ScriptDir, "*.xls;*.xlsx", $FLTA_FILES, Default, Default, $FLTAR_FULLPATH) If @error Then Exit ;_ArrayDisplay($aFile) Global $oExcel = _Excel_Open(False) Global $oWB, $sW57 For $i = 1 To $aFile[0] $oWB = _Excel_BookOpen($oExcel, $aFile[$i]) $sW57 = _Excel_RangeRead($oWB, Default, "AA3") For $i = 1 To $OfficeSearch[0] If StringStripWS($sW57, $STR_STRIPLEADING+$STR_STRIPTRAILING) == "'Mentor" Then ConsoleWrite($aFile[$i] & @CRLF) Global $sFilName = StringRegExpReplace($aFile[$i], "^.*\\|\..*$", "") ;MsgBox(0,"msgbox", $sFilName , 5000) FileMove($aFile[$i], $strasburg_Office & $sFilName & ".xls", $FC_NOOVERWRITE) EndIf Next _Excel_BookClose($oWB) Next _Excel_Close($oExcel)
  4. @Nine This is perfect! Thank you sir
  5. How do I check whether a certain cell or multiple cells are blank? The goal is to loop each excel sheet without having to open , check if a cell W57 is blank , and if it's blank do nothing, else move to another directory #include <File.au3> $FileList = _FileListToArray("Z:\Shared\Enterprise File Shares\NEO Assignments\Strasburg Assignments\New Assignments") If @error = 1 Then MsgBox(0, "", "No Files\Folders Found.") Exit EndIf For $i = 1 To $FileList[0] MsgBox(0, $i, $FileList[$i]) Next
  6. Thanks!! @Dan_555 It's awesome building a web GUI that resizes both the child GUI's and browsers! Func _WM_SIZE($hWnd, $iMsg, $wParam, $lParam) ; Resize child GUI to parent GUI Local $aGUI_Main_Pos = WinGetPos($hGUI_Main), $lnCount = @DesktopHeight WinMove($hGUI_Child_Webapp, "", $aGUI_Main_Pos[0] + 10, $aGUI_Main_Pos[1] + 110, $aGUI_Main_Pos[2] - 50, $aGUI_Main_Pos[3] - 120) WinMove($hGUI_Child_Workforce, "", $aGUI_Main_Pos[0] + 10, $aGUI_Main_Pos[1] + 110, $aGUI_Main_Pos[2] - 50, $aGUI_Main_Pos[3] - 120) WinMove($hGUI_Child_Dashboard, "", $aGUI_Main_Pos[0] + 10, $aGUI_Main_Pos[1] + 110, $aGUI_Main_Pos[2] - 50, $aGUI_Main_Pos[3] - 120) ; Get label posiition and size and adjust child GUI to fit $aPos = ControlGetPos($hGUI_Main, "", $hGUI_Child_Webapp) WinMove($Nhandle, "", $aPos[0] - 10, $aPos[1] - 110, $aPos[2] + 18, $aPos[3] + 118) $aPos = ControlGetPos($hGUI_Main, "", $hGUI_Child_Workforce) WinMove($Nhandle1, "", $aPos[0] - 10, $aPos[1] - 110, $aPos[2] + 18, $aPos[3] + 118) $aPos = ControlGetPos($hGUI_Main, "", $hGUI_Child_Dashboard) WinMove($Nhandle2, "", $aPos[0] - 10, $aPos[1] - 110, $aPos[2] + 18, $aPos[3] + 118) EndFunc ;==>_WM_SIZE
  7. Can anyone help me figure out how to resize child GUI's and parent GUI at the same time? In a previous project I was able to use _WM_SIZE() function to do so but that was with a single child GUI and the browser adjusted quite well. Right now it's not working with anything. Any help would be much appreciated! #include <GUIConstantsEx.au3> #include <WindowsConstants.au3> #include <WinAPIEx.au3> Global $hGUI_Width = @DesktopWidth / 2 + 400 Global $hGUI_Height = @DesktopHeight / 2 + 200 Global $hGUI_Child_Webapp, $hGUI_Child_Workforce, $hGUI_Child_Dashboard, $hGUI_Main = GUICreate("Project Management Tracking", $hGUI_Width + 15, $hGUI_Height + 90,-1, -1, BitOR($WS_SIZEBOX, $WS_MAXIMIZEBOX, $WS_MINIMIZEBOX)) Opt("WinTitleMatchMode", 2) ; Alters the method that is used to match window titles during search operations. GUICtrlCreateGroup("App Manager", 6, 2, 230 - 15, 75) GUICtrlSetResizing(-1, $GUI_DOCKBORDERS) GUICtrlCreateLabel(" Web Map", 10, 54, 60, 15) GUICtrlSetBkColor(-1, 0xFFCCCC) GUICtrlSetResizing(-1, $GUI_DOCKTOP + $GUI_DOCKLEFT + $GUI_DOCKSIZE) GUICtrlCreateLabel(" Field Work ", 80, 54, 60, 15) GUICtrlSetBkColor(-1, 0xFFCCCC) GUICtrlSetResizing(-1, $GUI_DOCKTOP + $GUI_DOCKLEFT + $GUI_DOCKSIZE) GUICtrlCreateLabel(" Dashboard ", 150, 54, 60, 15) GUICtrlSetBkColor(-1, 0xFFCCCC) GUICtrlSetResizing(-1, $GUI_DOCKTOP + $GUI_DOCKLEFT + $GUI_DOCKSIZE) $btnWebapp = IconButton("NEO Facilities", 20, 13, 45, 45, 30, @ScriptDir & "\img\NEO_LOGO.ico") $btnWorkforce = IconButton("Workforce", 90, 13, 45, 45, 30, @ScriptDir & "\img\workforce.ico") $btnDashboard = IconButton("Dashboard", 160, 13, 45, 45, 30, @ScriptDir & "\img\operations-dashboard.ico") _Create_Child($hGUI_Main) GUISetState(@SW_SHOW, $hGUI_Main) ;~ GUIRegisterMsg($WM_SYSCOMMAND, "WM_SYSCOMMAND") GUISetState(@SW_SHOW, $hGUI_Child_Webapp) GUIRegisterMsg($WM_SIZE, "_WM_SIZE") While 1 Switch GUIGetMsg() Case $GUI_EVENT_CLOSE Exit GUISetState(@SW_SHOW, $hGUI_Child_Webapp) Case $btnWebapp GUISetState(@SW_SHOW, $hGUI_Child_Webapp) GUISetState(@SW_HIDE, $hGUI_Child_Workforce) GUISetState(@SW_HIDE, $hGUI_Child_Dashboard) Case $btnWorkforce GUISetState(@SW_HIDE, $hGUI_Child_Webapp) GUISetState(@SW_SHOW, $hGUI_Child_Workforce) GUISetState(@SW_HIDE, $hGUI_Child_Dashboard) Case $btnDashboard GUISetState(@SW_HIDE, $hGUI_Child_Webapp) GUISetState(@SW_HIDE, $hGUI_Child_Workforce) GUISetState(@SW_SHOW, $hGUI_Child_Dashboard) EndSwitch WEnd ;====================================== Func IconButton($BItext, $BIleft, $BItop, $BIwidth, $BIheight, $BIconSize, $BIDLL, $BIconNum = -1) GUICtrlCreateIcon($BIDLL, $BIconNum, $BIleft + 5, $BItop + (($BIheight - $BIconSize) / 2), $BIconSize, $BIconSize) GUICtrlSetResizing(-1, $GUI_DOCKALL) GUICtrlSetState(-1, $GUI_DISABLE) $XS_btnx = GUICtrlCreateButton($BItext, $BIleft, $BItop, $BIwidth, $BIheight, $WS_CLIPSIBLINGS) Return $XS_btnx EndFunc ;==>IconButton ;====================================== Func _Create_Child($hGUI_Main) Local $aGUI_Main_Pos = WinGetPos($hGUI_Main), $lnCount = @DesktopHeight ;==>_Create_Child $hGUI_Child_Webapp = GUICreate("", $hGUI_Width, $hGUI_Height, -1, -1, _ BitOR($WS_POPUP, $WS_BORDER), $WS_EX_MDICHILD, $hGUI_Main) ;GUISetBkColor(0xCCFFCC) GUISetFont(11, 400, Default, "Arial") ;Local $text = GUICtrlCreateLabel("Dashboard", 10, 10, 380, ($lnCount * 20) - 20) WinMove($hGUI_Child_Webapp, "", $aGUI_Main_Pos[0] + 10, $aGUI_Main_Pos[1] + 110) ;===========================>_Webapp Chrome ShellExecute("chrome.exe", "https://egas.maps.arcgis.com/apps/webappviewer/index.html?id=e749ca4f26ff4b69b090ff548f042baf --new-window --start-minimized") $hPrivate = WinWaitActive("[REGEXPTITLE:(?i)(.*'Google Chrome')]", "", 1) WinSetState($hPrivate, "", @SW_HIDE) $Nhandle = WinGetHandle("Google Chrome") _WinAPI_SetParent($Nhandle, $hGUI_Child_Webapp) _WinAPI_SetWindowLong($Nhandle, $GWL_STYLE, $WS_POPUP + $WS_VISIBLE) $aPos = ControlGetPos($hGUI_Child_Webapp, "", $hPrivate) WinMove($Nhandle, "", $aPos[0] - 10, $aPos[1] - 110, $aPos[2] + 18, $aPos[3] + 118) ;==>_Create_Child $hGUI_Child_Workforce = GUICreate("", $hGUI_Width, $hGUI_Height, -1, -1, _ BitOR($WS_POPUP, $WS_BORDER), $WS_EX_MDICHILD, $hGUI_Main) ;GUISetBkColor(0xCCFFCC) GUISetFont(11, 400, Default, "Arial") ;Local $text = GUICtrlCreateLabel("Dashboard", 10, 10, 380, ($lnCount * 20) - 20) WinMove($hGUI_Child_Workforce, "", $aGUI_Main_Pos[0] + 10, $aGUI_Main_Pos[1] + 110) ;===========================>_Webapp Chrome ShellExecute("chrome.exe", "https://workforce.arcgis.com/projects/e8f8bcebaf2945b5a871d66697fbc451/dispatch/assignments --new-window --start-minimized") $hPrivate = WinWaitActive("[REGEXPTITLE:(?i)(.*'Google Chrome')]", "", 1) WinSetState($hPrivate, "", @SW_HIDE) $Nhandle = WinGetHandle("Google Chrome") _WinAPI_SetParent($Nhandle, $hGUI_Child_Workforce) _WinAPI_SetWindowLong($Nhandle, $GWL_STYLE, $WS_POPUP + $WS_VISIBLE) $aPos = ControlGetPos($hGUI_Child_Workforce, "", $hPrivate) WinMove($Nhandle, "", $aPos[0] - 10, $aPos[1] - 110, $aPos[2] + 18, $aPos[3] + 118) ;==>_Create_Child $hGUI_Child_Dashboard = GUICreate("", $hGUI_Width, $hGUI_Height, -1, -1, _ BitOR($WS_POPUP, $WS_BORDER), $WS_EX_MDICHILD, $hGUI_Main) ;GUISetBkColor(0xCCFFCC) GUISetFont(11, 400, Default, "Arial") ;Local $text = GUICtrlCreateLabel("Dashboard", 10, 10, 380, ($lnCount * 20) - 20) WinMove($hGUI_Child_Dashboard, "", $aGUI_Main_Pos[0] + 10, $aGUI_Main_Pos[1] + 110) ;===========================>_Webapp Chrome ShellExecute("chrome.exe", "https://egas.maps.arcgis.com/apps/opsdashboard/index.html#/f9ad3cb50b2d495eb267201f36ae1567 --new-window --start-minimized") $hPrivate = WinWaitActive("[REGEXPTITLE:(?i)(.*'Google Chrome')]", "", 1) WinSetState($hPrivate, "", @SW_HIDE) $Nhandle = WinGetHandle("Google Chrome") _WinAPI_SetParent($Nhandle, $hGUI_Child_Dashboard) _WinAPI_SetWindowLong($Nhandle, $GWL_STYLE, $WS_POPUP + $WS_VISIBLE) $aPos = ControlGetPos($hGUI_Child_Dashboard, "", $hPrivate) WinMove($Nhandle, "", $aPos[0] - 10, $aPos[1] - 110, $aPos[2] + 18, $aPos[3] + 118) EndFunc ;==>_Create_Child ;====================================== Func _WM_SIZE($hWnd, $iMsg, $wParam, $lParam) ; Resize child GUI to parent GUI Local $aGUI_Main_Pos = WinGetPos($hGUI_Main), $lnCount = @DesktopHeight WinMove($hGUI_Child_Webapp, "", $aGUI_Main_Pos[0] + 10, $aGUI_Main_Pos[1] + 110) WinMove($hGUI_Child_Workforce, "", $aGUI_Main_Pos[0] + 10, $aGUI_Main_Pos[1] + 110) WinMove($hGUI_Child_Dashboard, "", $aGUI_Main_Pos[0] + 10, $aGUI_Main_Pos[1] + 110) EndFunc Webapp.zip
  8. So I've run into a road bump and I'm not sure if this UDF will be my answer to my problem. Problem - I'm trying to find a solution that will automatically open firefox or chrome in a GUI. Not separately. Esri's workforce browser application isn't compatible using IE browser so I trying to find a solution that I can use to open a browser inside a GUI. Right now my script will open a browser and move it inside the GUI but I run into the issue of users closing the browser or messing the process up before it gets embedded. Looking forward to hearing back! Thanks! Launch using shellexecute and embed in GUI ShellExecute("firefox.exe", "https://egas.maps.arcgis.com/sharing/rest/oauth2/authorize?client_id=arcgisonline&display=default&response_type=token&state=%7B%22returnUrl%22%3A%22https%3A%2F%2Fegas.maps.arcgis.com%2Fapps%2Fwebappviewer%2Findex.html%3Fid%3De749ca4f26ff4b69b090ff548f042baf%22%2C%22useLandingPage%22%3Afalse%7D&expiration=20160&locale=en-us&redirect_uri=https%3A%2F%2Fegas.maps.arcgis.com%2Fhome%2Faccountswitcher-callback.html&force_login=false&hideCancel=true&showSignupOption=true&canHandleCrossOrgSignIn=true&signuptype=esri&redirectToUserOrgUrl=true") Local $hPrivateIE = WinWait("[REGEXPTITLE:(?i)(.*'Mozilla Firefox')]", "", 3) WinSetState($hPrivateIE, "", @SW_HIDE) Local $oPrivateIE = _IEAttach($hPrivateIE, "hwnd") $Nhandle = WinGetHandle("Mozilla Firefox") _WinAPI_SetParent($Nhandle, $Gui) $aPos = ControlGetPos($Gui, "",$hPrivateIE) _WinAPI_MoveWindow($Nhandle, $aPos[0] - 400, $aPos[1] + 25, 10, 600, False) _WinAPI_SetWindowLong($Nhandle, $GWL_STYLE, $WS_POPUP + $WS_VISIBLE) $aPos = ControlGetPos($Gui, "",$hPrivateIE) WinMove($Nhandle, "", $aPos[0] + 5, $aPos[1] + 25, 10, 0) Full Program #include <GUIConstantsEx.au3> #include <WindowsConstants.au3> #include <APISysConstants.au3> #include <WinAPIEx.au3> #include <IE.au3> Opt("WinTitleMatchMode", 2) ; Alters the method that is used to match window titles during search operations. ; = GUICreate("TreeView Find Item", 800, 600, -1, -1, $WS_SIZEBOX) $Gui = GUICreate("Project Tracking Beta v1", 800, 600, -1, -1, BitOR($WS_SIZEBOX , $WS_CLIPCHILDREN,$WS_MINIMIZEBOX, $WS_CAPTION, $WS_POPUP, $WS_SYSMENU, $WS_MAXIMIZEBOX, $WS_SIZEBOX) , $WS_EX_COMPOSITED) ;GUICreate("Project Tracking Beta v1", 500, 316, -1, -1, BitOR($WS_MINIMIZEBOX, $WS_CAPTION, $WS_POPUP, $WS_SYSMENU, $WS_MAXIMIZEBOX, $WS_SIZEBOX)) GUISetState(@SW_SHOW, $Gui) ShellExecute("firefox.exe", "https://egas.maps.arcgis.com/sharing/rest/oauth2/authorize?client_id=arcgisonline&display=default&response_type=token&state=%7B%22returnUrl%22%3A%22https%3A%2F%2Fegas.maps.arcgis.com%2Fapps%2Fwebappviewer%2Findex.html%3Fid%3De749ca4f26ff4b69b090ff548f042baf%22%2C%22useLandingPage%22%3Afalse%7D&expiration=20160&locale=en-us&redirect_uri=https%3A%2F%2Fegas.maps.arcgis.com%2Fhome%2Faccountswitcher-callback.html&force_login=false&hideCancel=true&showSignupOption=true&canHandleCrossOrgSignIn=true&signuptype=esri&redirectToUserOrgUrl=true") Local $hPrivateIE = WinWait("[REGEXPTITLE:(?i)(.*'Mozilla Firefox')]", "", 3) WinSetState($hPrivateIE, "", @SW_HIDE) Local $oPrivateIE = _IEAttach($hPrivateIE, "hwnd") $Nhandle = WinGetHandle("Mozilla Firefox") _WinAPI_SetParent($Nhandle, $Gui) $aPos = ControlGetPos($Gui, "",$hPrivateIE) _WinAPI_MoveWindow($Nhandle, $aPos[0] - 400, $aPos[1] + 25, 10, 600, False) _WinAPI_SetWindowLong($Nhandle, $GWL_STYLE, $WS_POPUP + $WS_VISIBLE) $aPos = ControlGetPos($Gui, "",$hPrivateIE) WinMove($Nhandle, "", $aPos[0] + 5, $aPos[1] + 25, 10, 0) GUIRegisterMsg($WM_SIZE, "_WM_SIZE") While 1 $msg = GUIGetMsg() Select Case $msg = $GUI_EVENT_CLOSE Exit EndSelect WEnd Func _WM_SIZE($hWnd, $iMsg, $wParam, $lParam) ; Get label posiition and size and adjust child GUI to fit $aPos = ControlGetPos($Gui, "",$hPrivateIE) WinMove($Nhandle, "", $aPos[0] + 10, $aPos[1] + 25, $aPos[2] - 30, $aPos[3] - 30) EndFunc
  9. @pixelsearch You're amazing! Thanks again!
  10. @pixelsearch This is perfect!! Thank you!
  11. Why is button $btnWorkforce keep pushing the child GUI away from the parent GUI? It has the exact same code as button $btnDashboard and that works perfectly. Is there an easier way to write this so multiple child gui's work the same? #include <GUIConstantsEx.au3> #include <WindowsConstants.au3> #include <ColorConstants.au3> #include <ButtonConstants.au3> ; List App Varibles Local $hGUI_Child_Workforce Local $hGUI_Child_Dashboard $hGUI_Main = GUICreate("", 250, 300) ; Create Child GUI [1] _Create_Child_Workforce($hGUI_Main) GUIRegisterMsg($WM_MOVE, "_Position_Child_Workforce") GUIRegisterMsg($WM_NOTIFY, "_WM_NOTIFY_WORKFORCE") ; Create Child GUI [2] _Create_Child_Dashboard($hGUI_Main) GUIRegisterMsg($WM_MOVE, "_Position_Child_Dashboard") GUIRegisterMsg($WM_NOTIFY, "_WM_NOTIFY_DASHBOARD") GUISetState(@SW_SHOW, $hGUI_Main) ; Create app BTN [1] $btnWorkforce = IconButton("Workforce", 15, 25, 140, 40, 30, @ScriptDir & "\workforce.ico") ; Create app BTN [2] $btnDashboard = IconButton("Dashboard", 15, 80, 140, 40, 30, @ScriptDir & "\operations-dashboard.ico") While 1 Switch GUIGetMsg() Case $GUI_EVENT_CLOSE Exit ; List [case $....] for button apps Case $btnWorkforce _All_Hide() GUISetState(@SW_SHOW, $hGUI_Child_Workforce) Case $btnDashboard _All_Hide() GUISetState(@SW_SHOW, $hGUI_Child_Dashboard) EndSwitch WEnd Func _All_Hide() GUISetState(@SW_HIDE, $hGUI_Child_Workforce) GUISetState(@SW_HIDE, $hGUI_Child_Dashboard) EndFunc ;==>_All_Hide ; Functions for ~ Workfoce [1] Func _Create_Child_Workforce($hGUI_Main) Local $lnCount = 600 $hGUI_Child_Workforce = GUICreate("Follower", 800, $lnCount, -1, -1, BitOR($WS_POPUP, $WS_BORDER), 0, $hGUI_Main) GUISetBkColor(0xCCFFCC) GUISetFont(11, 400, Default, "Arial") Global $text = GUICtrlCreateLabel("Workforce", 10, 10, 380, ($lnCount * 20) - 20) _Position_Child_Workforce($hGUI_Main, 0, 0, 0) GUISetState(@SW_HIDE, $hGUI_Child_Workforce) EndFunc ;==>_Create_Child Func _Position_Child_Workforce($hGUI_Main, $iMsg, $wParam, $lParam) Local $aGUI_Main_Pos = WinGetPos($hGUI_Main) WinMove($hGUI_Child_Workforce, "", $aGUI_Main_Pos[0] + $aGUI_Main_Pos[2], $aGUI_Main_Pos[1]) EndFunc ;==>_Position_Child Func _SH_Child_Workforce($hGUI_Main, $sText, $sLength) GUISetState(@SW_SHOW, $hGUI_Child_Workforce) GUICtrlSetData($text, $sText) WinActivate($hGUI_Main) Sleep($sLength) GUISetState(@SW_HIDE, $hGUI_Child_Workforce) GUICtrlSetData($text, "123") EndFunc ;==>_SH_Child Func _WM_NOTIFY_WORKFORCE($nWnd, $iMsg = "", $wParam = "", $lParam = "") Local $tStruct = DllStructCreate("hwnd;uint_ptr;int_ptr;int;int", $lParam) If BitAND(DllStructGetData($tStruct, 3), 0xFFFFFFFF) = $NM_CLICK Then ; Code $hCurrListView = DllStructGetData($tStruct, 1) ; ListView handle EndIf EndFunc ;==>_WM_NOTIFY ; Functions for ~ Dashboard [2] Func _Create_Child_Dashboard($hGUI_Main) Local $lnCount = 600 $hGUI_Child_Dashboard = GUICreate("Follower", 800, $lnCount, -1, -1, BitOR($WS_POPUP, $WS_BORDER), 0, $hGUI_Main) GUISetBkColor(0xCCFFCC) GUISetFont(11, 400, Default, "Arial") Global $text = GUICtrlCreateLabel("Dashboard", 10, 10, 380, ($lnCount * 20) - 20) _Position_Child_Dashboard($hGUI_Main, 0, 0, 0) GUISetState(@SW_HIDE, $hGUI_Child_Dashboard) EndFunc ;==>_Create_Child Func _Position_Child_Dashboard($hGUI_Main, $iMsg, $wParam, $lParam) Local $aGUI_Main_Pos = WinGetPos($hGUI_Main) WinMove($hGUI_Child_Dashboard, "", $aGUI_Main_Pos[0] + $aGUI_Main_Pos[2], $aGUI_Main_Pos[1]) EndFunc ;==>_Position_Child Func _SH_Child_Dashboard($hGUI_Main, $sText, $sLength) GUISetState(@SW_SHOW, $hGUI_Child_Dashboard) GUICtrlSetData($text, $sText) WinActivate($hGUI_Main) Sleep($sLength) GUISetState(@SW_HIDE, $hGUI_Child_Dashboard) GUICtrlSetData($text, "") EndFunc ;==>_SH_Child Func _WM_NOTIFY_DASHBOARD($nWnd, $iMsg = "", $wParam = "", $lParam = "") Local $tStruct = DllStructCreate("hwnd;uint_ptr;int_ptr;int;int", $lParam) If BitAND(DllStructGetData($tStruct, 3), 0xFFFFFFFF) = $NM_CLICK Then ; Code $hCurrListView = DllStructGetData($tStruct, 1) ; ListView handle EndIf EndFunc ;==>_WM_NOTIFY Func IconButton($BItext, $BIleft, $BItop, $BIwidth, $BIheight, $BIconSize, $BIDLL, $BIconNum = -1) GUICtrlCreateIcon($BIDLL, $BIconNum, $BIleft + 5, $BItop + (($BIheight - $BIconSize) / 2), $BIconSize, $BIconSize) GUICtrlSetResizing(-1, $GUI_DOCKALL) GUICtrlSetState(-1, $GUI_DISABLE) $XS_btnx = GUICtrlCreateButton($BItext, $BIleft, $BItop, $BIwidth, $BIheight, $WS_CLIPSIBLINGS) Return $XS_btnx EndFunc ;==>IconButton
  12. Thank you! @pixelsearch
  13. How do I make my buttons stationary when I resize my GUI? The buttons and image will float #include <GUIConstantsEx.au3> #include <ColorConstants.au3> #include <WindowsConstants.au3> #include <ButtonConstants.au3> $hGUI = GUICreate("My_GUI", 800, 600, -1, -1, BitOR($GUI_SS_DEFAULT_GUI,$WS_THICKFRAME)) GUISetBkColor(0xFFFFFF) GUICtrlSetResizing(-1, $GUI_DOCKLEFT+$GUI_DOCKTOP+$GUI_DOCKBOTTOM+$GUI_DOCKWIDTH+$GUI_DOCKHEIGHT) ;$TabSheet1 = GUICtrlCreateTabItem("TabSheet1") ;$TabSheet2 = GUICtrlCreateTabItem("TabSheet2") $btn1 = IconButton("Workforce", 5, 5, 160, 40, 30, "C:\Users\jnmiller\Desktop\New folder\workforce.ico") GUICtrlSetFont(-1, 11, 400, 0, 'Tahoma') GUICtrlSetBkColor(-1, $GUI_BKCOLOR_TRANSPARENT) GUICtrlSetcolor(-1, 0x000000) $btn1 = IconButton("Dashboard", 5, 55, 160, 40, 30, "C:\Users\jnmiller\Desktop\New folder\operations-dashboard.ico" , BitOr($BS_MULTILINE, $BS_VCENTER, $BS_RIGHT)) GUICtrlSetFont(-1, 11, 400, 0, 'Tahoma') GUICtrlSetBkColor(-1, $GUI_BKCOLOR_TRANSPARENT) GUICtrlSetcolor(-1, 0x000000) ;$Tab1 = GUICtrlCreateTab(24, 32, 561, 377) ;GUICtrlCreateTabItem("") GUISetState(@SW_SHOW) While 1 $nMsg = GUIGetMsg() Switch $nMsg Case $GUI_EVENT_CLOSE Exit EndSwitch WEnd GUIDelete() Exit Func IconButton($BItext, $BIleft, $BItop, $BIwidth, $BIheight, $BIconSize, $BIDLL, $BIconNum = -1) GUICtrlCreateIcon($BIDLL, $BIconNum, $BIleft + 5, $BItop + (($BIheight - $BIconSize) / 2), $BIconSize, $BIconSize) GUICtrlSetState( -1, $GUI_DISABLE) $XS_btnx = GUICtrlCreateButton($BItext, $BIleft, $BItop, $BIwidth, $BIheight, $WS_CLIPSIBLINGS) Return $XS_btnx EndFunc operations-dashboard.ico workforce.ico
  14. Why can't I change the tab names? I tried removing the for loop but no tabs will show on the GUI #Include <Constants.au3> #Include <GUIConstantsEx.au3> #Include <StaticConstants.au3> #Include <TabConstants.au3> #Include <WindowsConstants.au3> Dim $Pic[5] $Form1 = GUICreate("MyGUI", 705, 369, 645, 124, BitOR($GUI_SS_DEFAULT_GUI, $WS_MAXIMIZEBOX, $WS_SIZEBOX, $WS_THICKFRAME, $WS_TABSTOP)) GUISetBkColor(0xFFFFFF) GUICtrlCreatePic('img_bg.bmp', 0, 0, 705, 369) GUICtrlSetResizing(-1, $GUI_DOCKLEFT+$GUI_DOCKRIGHT+$GUI_DOCKTOP+$GUI_DOCKBOTTOM) GUICtrlSetState(-1, $GUI_DISABLE) For $i = 0 To 4 $Pic[$i] = GUICtrlCreatePic(@ScriptDir & '\img_black.bmp', 10, 24 + 50 * $i, 162, 49) GUICtrlCreateLabel('Tabsheet' & $i, 21, 40 + 50 * $i, 140, 18, $SS_CENTER) GUICtrlSetFont(-1, 11, 400, 0, 'Tahoma') GUICtrlSetBkColor(-1, $GUI_BKCOLOR_TRANSPARENT) GUICtrlSetcolor(-1, 0xFFFFFF) Next $Tab = GUICtrlCreateTab(172 + 4, 10 + 4, 523 - 8, 349 - 8) GUICtrlSetState(-1, $GUI_DISABLE) GUICtrlCreateTabItem('Dashboard') GUICtrlCreateEdit('', 190, 28, 487, 313) GUICtrlCreateTabItem('Workforce') GUICtrlCreateButton('OK', 398, 319, 70, 23) GUICtrlCreateTabItem('Tabsheet2') GUICtrlCreateTabItem('Tabsheet3') GUICtrlCreateTabItem('Tabsheet4') GUICtrlCreateTabItem('') GUISetState() $Item = -1 $Over = -1 While 1 $Info = GUIGetCursorInfo() If @error Then If $Over <> -1 Then GUICtrlSetImage($Pic[$Over], @ScriptDir & '\img_black.bmp') EndIf $Over = -1 Else $Index = _Index($Info[4]) If $Index <> $Over Then If $Over <> -1 Then GUICtrlSetImage($Pic[$Over], @ScriptDir & '\img_black.bmp') EndIf If ($Index <> -1) And ($Index <> $Item) Then GUICtrlSetImage($Pic[$Index], @ScriptDir & '\img_over.bmp') $Over = $Index Else $Over = -1 EndIf EndIf EndIf $Msg = GUIGetMsg() If $Item = -1 Then $Msg = $Pic[0] $Item = 1 EndIf Switch $Msg Case 0 ContinueLoop Case $GUI_EVENT_CLOSE Exit Case $Pic[0] To $Pic[UBound($Pic) - 1] If $Msg <> $Pic[$Item] Then GUICtrlSetImage($Pic[$Item], @ScriptDir & '\img_black.bmp') GUICtrlSetcolor($Pic[$Item] + 1, 0xFFFFFF) GUICtrlSetImage($Msg, @ScriptDir & '\img_white.bmp') GUICtrlSetcolor($Msg + 1, 0x313A42) $Item = _Index($Msg) GUICtrlSendMsg($Tab, $TCM_SETCURFOCUS, $Item, 0) $Over = -1 EndIf EndSwitch WEnd Func _Index($CtrlID) For $i = 0 To UBound($Pic) - 1 If ($CtrlID = $Pic[$i]) Or ($CtrlID = $Pic[$i] + 1) Then Return $i EndIf Next Return -1 EndFunc ;==>_Index
  15. We have a dashboard setup on our esri portal. Is there anyway to isolate only a few objects to display on a GUI?
  16. Using IECreateEmbedded is a pain. Alternative solution is to launch Edge as minimized and insert directly into the GUI (Fast & Easy) ; Launch Edge outside of GUI and then insert it ShellExecute("microsoft-edge:https://egas.maps.arcgis.com/apps/webappviewer/index.html?id=e749ca4f26ff4b69b090ff548f042baf", "", "","", @SW_MINIMIZE) WinWaitActive("[REGEXPTITLE:(?i)(.*'Microsoft Edge')]", "", 3) $Nhandle = WinGetHandle("Microsoft Edge") _WinAPI_SetParent($Nhandle, $hGUI_child) _WinAPI_SetWindowLong($Nhandle, $GWL_STYLE, $WS_POPUP + $WS_VISIBLE) WinMove($Nhandle, "", -20, -105,@DesktopWidth + 25, $hGUI_height / 2 + 110)
  17. @Danp2 It didn't seem to do the trick but it loads very quick! I'm really puzzled on this one. I wish there were other options to test this against. My arrow keys let me move but it's that left mouse button to pan around that doesn't want to work for some reason.
  18. I'm super puzzled right now. When I Embed Internet Explorer in my GUI, open an ArcGIS Online map, the right cursor to pan doesn't work. But if I open an internet explorer browser to our AGOL maps using the right cursor to pan works perfectly. Any ideas why such behavior would happen if it's the same browser? Thanks! #NoTrayIcon #Region ;**** Directives created by AutoIt3Wrapper_GUI **** #AutoIt3Wrapper_Icon=Windows_Phone_icon-icons.com_66782.ico #AutoIt3Wrapper_Outfile=Example.exe #AutoIt3Wrapper_Compression=4 #EndRegion ;**** Directives created by AutoIt3Wrapper_GUI **** ; *** Start added by AutoIt3Wrapper *** #include <APISysConstants.au3> #include <StaticConstants.au3> #include <StructureConstants.au3> #include <WinAPIConstants.au3> ; *** End added by AutoIt3Wrapper *** #include-once #include <GDIPlus.au3> #include <WindowsConstants.au3> #include <GUIConstants.au3> #include <WinAPIEx.au3> #include <IE.au3> #include <Array.au3> #include <Process.au3> #include <GUIConstantsEx.au3> ; Calculate visible screen dimensions. $one_percent_width = @DesktopWidth / 100 $one_percent_height = @DesktopHeight / 100 $width = $one_percent_width * 98 $height = $one_percent_height * 91 Global $bAero, $hidden = False, $tuck = False, $tucked = False, $untucked = False, $tucking = False, $untucking = False, $timer = 0, $tdiff = 0, _ $LAYERED_GUI = $WS_EX_LAYERED, $hGUI_child, $hGUI_height = 683, $find = False, $qsInfocus = False Global Const $hDwmApiDll = DllOpen("dwmapi.dll"), $sChkAero = DllStructCreate("int;") DllCall($hDwmApiDll, "int", "DwmIsCompositionEnabled", "ptr", DllStructGetPtr($sChkAero)) $bAero = DllStructGetData($sChkAero, 1) If Not $bAero Then $LAYERED_GUI = 0 $hGUI_height = $hGUI_height - 20 EndIf $hGUI = GUICreate("", 715, $hGUI_height, -1, 0, $WS_POPUP, $LAYERED_GUI + $WS_EX_TOPMOST, WinGetHandle(AutoItWinGetTitle())) $hIcon = _WinAPI_GetClassLongEx($hGUI, $GCL_HICON) _WinAPI_DestroyIcon($hIcon) _WinAPI_SetClassLongEx($hGUI, $GCL_HICON, 0) _WinAPI_SetClassLongEx($hGUI, $GCL_HICONSM, 0) If $bAero Then $hGUI_child = GUICreate("", 715-39, 683 - 26, 22, 3, $WS_POPUP, $WS_EX_MDICHILD + $WS_EX_TOPMOST, $hGUI) $hGUI_Font = $hGUI_child Else $hGUI_Font = $hGUI $hGUI_child = $hGUI EndIf GUISetBkColor(0xFFFFFF) GUISetFont(15, 100, Default, 'Segoe UI', $hGUI_Font, 5) ; Embed Internet Explorer $address = "Company Website" $oIE = _IECreateEmbedded() $oIEobj = GUICtrlCreateObj($oIE, 7, 5, 660, $hGUI_height) ;$oNav = _IENavigate($oIE, @ScriptDir & '/contactlist.html', 0) $oNav = _IENavigate($oIE, $address) $oIE.document.body.scroll = "no" $oIE.document.body.style.overflow = "hidden" $hENTER = GUICtrlCreateDummy() Dim $AccelKeys[1][2]=[["{ENTER}", $hENTER]] GUISetAccelerators($AccelKeys) $hGUI_child2 = GUICreate("", 112, 50, 280, 645, $WS_POPUP, $LAYERED_GUI + $WS_EX_MDICHILD + $WS_EX_TOPMOST, $hGUI_child) If Not $bAero Then GUISetBkColor(0xE0F2F7) $hGUI_Font = $hGUI_child2 GUISetFont(33, 100, Default, 'Segoe UI', $hGUI_Font, 5) GUICtrlCreateLabel(" = ", 0, 0, 112, 50, $SS_CENTER + $SS_CENTERIMAGE) EndIf GUISetCursor(0, 1, $hGUI_child2) If $bAero Then _GDIPlus_Startup() $hImage = _GDIPlus_ImageLoadFromFile(@ScriptDir & '\panel.png') SetBitmap($hGUI, $hImage) $hImage = _GDIPlus_ImageLoadFromFile(@ScriptDir & '\roundbn.png') SetBitmap($hGUI_child2, $hImage) _GDIPlus_Shutdown() EndIf GUIRegisterMsg($WM_MOUSEWHEEL, "WM_MOUSEWHEEL") GUIRegisterMsg($WM_COMMAND, "WM_COMMAND") GUISetState(@SW_SHOW, $hGUI) If $bAero Then GUISetState(@SW_SHOW, $hGUI_child) GUISetState(@SW_SHOW, $hGUI_child2) While 1 $mPos = MouseGetPos() If BitAnd($hidden, $mPos[1] = 0, $timer = 0) Then $timer = TimerInit() Sleep(10) ElseIf $mPos[1] <> 0 Then $timer = 0 $tdiff = 0 EndIf If $timer <> 0 Then $tdiff = TimerDiff($timer) If BitAND($hidden, Not $tucked, $mPos[1] <> 0, Not $tucking) Then $tuck = True $untucking = False $tucking = True AdlibRegister("TuckAway", 2500) ElseIf BitAND($hidden, $tucked, $mPos[1] = 0, Not $untucking, $tdiff > 450) Then $tuck = False $tucking = False $untucking = True AdlibRegister("TuckAway") ElseIf BitAND($hidden, Not $tucked, $mPos[1] = 0, $tucking) Then AdlibUnRegister("TuckAway") $tuck = False $tucking = False EndIf $msg = GUIGetMsg(1) Switch $msg[1] Case $hGUI Switch $msg[0] Case $GUI_EVENT_CLOSE, $GUI_EVENT_SECONDARYUP Exit EndSwitch Case $hGUI_child Switch $msg[0] Case $GUI_EVENT_CLOSE, $GUI_EVENT_SECONDARYUP Exit Case $hENTER ; If $qsInfocus Then _IESearchText($oIE, GUICtrlRead($qsInput), 1) EndSwitch Case $hGUI_child2 Switch $msg[0] Case $GUI_EVENT_PRIMARYDOWN If Not $hidden Then HidePanel() Else HidePanel(False) EndIf EndSwitch EndSwitch WEnd Func WM_COMMAND($hWnd, $msg, $wParam, $lParam) Local $iCode = BitShift($wParam, 16) Local $nIDFrom = BitAND($wParam, 0xFFFF) Return $GUI_RUNDEFMSG EndFunc Func _IESearchText($oIE, $sFindText, $fNext = 0) $docRange = $oIE.document.body.createTextRange() $docRange.execCommand("backColor", false, "#ffffff"); If $sFindText <> '' Then If $fNext = 0 Then Global $oRange = $oIE.document.body.createTextRange() Else $oRange.moveStart("character") EndIf If $oRange.FindText($sFindText) Then $oRange.execCommand("backColor", false, "fdee00"); $oRange.scrollIntoView() Else $oRange = $oIE.document.body.createTextRange() EndIf Else $oIE.document.parentwindow.scroll(0) EndIf EndFunc Func WM_MOUSEWHEEL($hWnd, $iMsg, $wParam, $lParam) Switch $wParam Case 0x00780000 $oIE.document.parentwindow.scrollBy(0, -150) Case 0xFF880000 $oIE.document.parentwindow.scrollBy(0, 150) EndSwitch Return $GUI_RUNDEFMSG EndFunc Func HidePanel($hide = True) AdlibUnRegister("TuckAway") If $hide Then $tucked = False $untucked = True $hidden = True For $i = -1 to -663 Step - 1 WinMove($hGUI, "", Default, $i) Next Else $tucked = False $untucked = False $hidden = False For $i = -664 to -4 Step 1 WinMove($hGUI, "", Default, $i) Next EndIf EndFunc Func TuckAway() If $tuck Then $tucking = False $untucked = False $tucked = True For $i = 663 to 695 Step 1 WinMove($hGUI, "", Default, -$i) Sleep(10) Next Else $untucking = False $tucked = False For $i = 695 to 663 Step - 1 WinMove($hGUI, "", Default, -$i) Sleep(10) Next EndIf AdlibUnRegister("TuckAway") EndFunc Func SetBitmap($hGUI, $hImage, $iOpacity = 255) Local $hScrDC, $hMemDC, $hBitmap, $hOld, $pSize, $tSize, $pSource, $tSource, $pBlend, $tBlend $hScrDC = _WinAPI_GetDC(0) $hMemDC = _WinAPI_CreateCompatibleDC($hScrDC) $hBitmap = _GDIPlus_BitmapCreateHBITMAPFromBitmap($hImage) $hOld = _WinAPI_SelectObject($hMemDC, $hBitmap) $tSize = DllStructCreate($tagSIZE) $pSize = DllStructGetPtr($tSize) DllStructSetData($tSize, "X", _GDIPlus_ImageGetWidth($hImage)) DllStructSetData($tSize, "Y", _GDIPlus_ImageGetHeight($hImage)) $tSource = DllStructCreate($tagPOINT) $pSource = DllStructGetPtr($tSource) $tBlend = DllStructCreate($tagBLENDFUNCTION) $pBlend = DllStructGetPtr($tBlend) DllStructSetData($tBlend, "Alpha", $iOpacity) DllStructSetData($tBlend, "Format", 1) _WinAPI_UpdateLayeredWindow($hGUI, $hGUI, 0, $pSize, $hMemDC, $pSource, 0, $pBlend, $ULW_ALPHA) _WinAPI_ReleaseDC(0, $hScrDC) _WinAPI_SelectObject($hMemDC, $hOld) _WinAPI_DeleteObject($hBitmap) _WinAPI_DeleteDC($hMemDC) EndFunc
  19. Thanks for the reply! Figured it out. An IniWrite is able to change the value directly IniWrite("Search.ini", "Search Animals", "02", "Maine Coon Cat")
  20. When I create my INI file, how would I be able to search for "02=Cat" and change Cat to a specific kind like "02=Maine Coon Cat"? Being able to change whatever would be in section [02=] #include <MsgBoxConstants.au3> #include <Array.au3> ; -------- Create ini file ----------- FileWrite("Search.ini", _ "[Search Animals]" & @CRLF & _ "IGNORE_ERRORS=0" & @CRLF & _ "01=Dog" & @CRLF & _ "02=Cat" & @CRLF & _ "03=Bird" & @CRLF & _ "04=Fish") Sleep(1000) ; ------ End of Create ini file ------ _read() FileDelete("Search.ini") ; Tidy up Func _read() Local Const $hostfile = "Search.ini" $var = IniReadSection($hostfile, "Search Animals") If @error Then MsgBox(4096, "Error", "Unable to read section.") Else For $number = 1 To $var[0][0] ; MsgBox(4096, "", "Key: " & $var[$i][0] & @CRLF & "Value: " & $var[$number][1]) If $var[$number][1] == "Cat" Then MsgBox($MB_SYSTEMMODAL, "Search", "The " & $var[$number][1] & " was found at " & $var[$number][0], 5) ExitLoop ; Exits For - Next loop (stops) when search value, "Cat", is found? EndIf Next EndIf _ArrayDisplay($var, "Search Animals") EndFunc ;==>_read
  21. Whatcha trying to do that requires mouse clicks? There is most likely a better way to achieve what you want.
  22. Thanks! #include <IE.au3> #include <Process.au3> Local $regValue = "0x2AF8" ; IE11 edge mode: 11001 (0x2AF9) ; IE11: 11000 (0x2AF8) ; IE10: 10001 (0x2711) ; IE10: 10000 (0x02710) ; IE 9: 9999 (0x270F) ; IE 9: 9000 (0x2328) ; IE 8: 8888 (0x22B8) ; IE 8: 8000 (0x1F40) ; IE 7: 7000 (0x1B58) RegWrite("HKEY_CURRENT_USER\Software\Microsoft\Internet Explorer\Main\FeatureControl\FEATURE_BROWSER_EMULATION", _ProcessGetName(@AutoItPID), "REG_DWORD", $regValue) RegWrite("HKEY_LOCAL_MACHINE\SOFTWARE\Microsoft\Internet Explorer\MAIN\FeatureControl\FEATURE_BROWSER_EMULATION", _ProcessGetName(@AutoItPID), "REG_DWORD", $regValue)
  23. When I run my script pressing F5 everything loads correctly on the website which is embedded in the GUI but when I compile the script to x86 or x64 there are 2 boxes that disappear. Any ideas why compiling a script would cause something from appearing? I'll provide screenshots below. #NoTrayIcon #Region ;**** Directives created by AutoIt3Wrapper_GUI **** #AutoIt3Wrapper_Outfile=Example.exe #AutoIt3Wrapper_Compression=4 #EndRegion ;**** Directives created by AutoIt3Wrapper_GUI **** ; *** Start added by AutoIt3Wrapper *** #include <APISysConstants.au3> #include <StaticConstants.au3> #include <StructureConstants.au3> #include <WinAPIConstants.au3> ; *** End added by AutoIt3Wrapper *** #include-once #include <GDIPlus.au3> #include <WindowsConstants.au3> #include <GUIConstants.au3> #include <WinAPIEx.au3> #include <IE.au3> #include <Array.au3> #include <Process.au3> #include <GUIConstantsEx.au3> Local $regValue = "0x2AF9" RegWrite("HKEY_CURRENT_USERSoftwareMicrosoftInternet ExplorerMainFeatureControlFEATURE_BROWSER_EMULATION", _ProcessGetName(@AutoItPID), "REG_DWORD", $regValue) RegWrite("HKEY_LOCAL_MACHINESOFTWAREMicrosoftInternet ExplorerMAINFeatureControlFEATURE_BROWSER_EMULATION", _ProcessGetName(@AutoItPID), "REG_DWORD", $regValue) ; Calculate visible screen dimensions. $one_percent_width = @DesktopWidth / 100 $one_percent_height = @DesktopHeight / 100 $width = $one_percent_width * 98 $height = $one_percent_height * 91 Global $bAero, $hidden = False, $tuck = False, $tucked = False, $untucked = False, $tucking = False, $untucking = False, $timer = 0, $tdiff = 0, _ $LAYERED_GUI = $WS_EX_LAYERED, $hGUI_child, $hGUI_height = 683, $find = False, $qsInfocus = False Global Const $hDwmApiDll = DllOpen("dwmapi.dll"), $sChkAero = DllStructCreate("int;") DllCall($hDwmApiDll, "int", "DwmIsCompositionEnabled", "ptr", DllStructGetPtr($sChkAero)) $bAero = DllStructGetData($sChkAero, 1) If Not $bAero Then $LAYERED_GUI = 0 $hGUI_height = $hGUI_height - 20 EndIf $hGUI = GUICreate("", 715, $hGUI_height, -1, 0, $WS_POPUP, $LAYERED_GUI + $WS_EX_TOPMOST, WinGetHandle(AutoItWinGetTitle())) $hIcon = _WinAPI_GetClassLongEx($hGUI, $GCL_HICON) _WinAPI_DestroyIcon($hIcon) _WinAPI_SetClassLongEx($hGUI, $GCL_HICON, 0) _WinAPI_SetClassLongEx($hGUI, $GCL_HICONSM, 0) If $bAero Then $hGUI_child = GUICreate("", 715-39, 683 - 26, 22, 3, $WS_POPUP, $WS_EX_MDICHILD + $WS_EX_TOPMOST, $hGUI) $hGUI_Font = $hGUI_child Else $hGUI_Font = $hGUI $hGUI_child = $hGUI EndIf GUISetBkColor(0xFFFFFF) GUISetFont(15, 100, Default, 'Segoe UI', $hGUI_Font, 5) GUICtrlCreateTab(5, 5, 715, $hGUI_height) GUICtrlCreateTabItem ( "WebTMS Tickets" ) $address = "https://www.gpsvisualizer.com/draw/" $oIE = _IECreateEmbedded() $oIEobj = GUICtrlCreateObj($oIE, 5, 50, 650, $hGUI_height - 80) ;$oNav = _IENavigate($oIE, @ScriptDir & '/contactlist.html', 0) $oNav = _IENavigate($oIE, $address) $oIE.document.body.scroll = "no" $oIE.document.body.style.overflow = "hidden" $hENTER = GUICtrlCreateDummy() Dim $AccelKeys[1][2]=[["{ENTER}", $hENTER]] GUISetAccelerators($AccelKeys) $hGUI_child2 = GUICreate("", 112, 50, 280, 645, $WS_POPUP, $LAYERED_GUI + $WS_EX_MDICHILD + $WS_EX_TOPMOST, $hGUI_child) If Not $bAero Then GUISetBkColor(0xE0F2F7) $hGUI_Font = $hGUI_child2 GUISetFont(33, 100, Default, 'Segoe UI', $hGUI_Font, 5) GUICtrlCreateLabel(" = ", 0, 0, 112, 50, $SS_CENTER + $SS_CENTERIMAGE) EndIf GUISetCursor(0, 1, $hGUI_child2) If $bAero Then _GDIPlus_Startup() $hImage = _GDIPlus_ImageLoadFromFile(@ScriptDir & '\panel.png') SetBitmap($hGUI, $hImage) $hImage = _GDIPlus_ImageLoadFromFile(@ScriptDir & '\roundbn.png') SetBitmap($hGUI_child2, $hImage) _GDIPlus_Shutdown() EndIf GUIRegisterMsg($WM_MOUSEWHEEL, "WM_MOUSEWHEEL") GUIRegisterMsg($WM_COMMAND, "WM_COMMAND") GUISetState(@SW_SHOW, $hGUI) If $bAero Then GUISetState(@SW_SHOW, $hGUI_child) GUISetState(@SW_SHOW, $hGUI_child2) While 1 $mPos = MouseGetPos() If BitAnd($hidden, $mPos[1] = 0, $timer = 0) Then $timer = TimerInit() Sleep(10) ElseIf $mPos[1] <> 0 Then $timer = 0 $tdiff = 0 EndIf If $timer <> 0 Then $tdiff = TimerDiff($timer) If BitAND($hidden, Not $tucked, $mPos[1] <> 0, Not $tucking) Then $tuck = True $untucking = False $tucking = True AdlibRegister("TuckAway", 2500) ElseIf BitAND($hidden, $tucked, $mPos[1] = 0, Not $untucking, $tdiff > 450) Then $tuck = False $tucking = False $untucking = True AdlibRegister("TuckAway") ElseIf BitAND($hidden, Not $tucked, $mPos[1] = 0, $tucking) Then AdlibUnRegister("TuckAway") $tuck = False $tucking = False EndIf $msg = GUIGetMsg(1) Switch $msg[1] Case $hGUI Switch $msg[0] Case $GUI_EVENT_CLOSE, $GUI_EVENT_SECONDARYUP Exit EndSwitch Case $hGUI_child Switch $msg[0] Case $GUI_EVENT_CLOSE, $GUI_EVENT_SECONDARYUP Exit Case $hENTER ; If $qsInfocus Then _IESearchText($oIE, GUICtrlRead($qsInput), 1) EndSwitch Case $hGUI_child2 Switch $msg[0] Case $GUI_EVENT_PRIMARYDOWN If Not $hidden Then HidePanel() Else HidePanel(False) EndIf EndSwitch EndSwitch WEnd Func WM_COMMAND($hWnd, $msg, $wParam, $lParam) Local $iCode = BitShift($wParam, 16) Local $nIDFrom = BitAND($wParam, 0xFFFF) Return $GUI_RUNDEFMSG EndFunc Func _IESearchText($oIE, $sFindText, $fNext = 0) $docRange = $oIE.document.body.createTextRange() $docRange.execCommand("backColor", false, "#ffffff"); If $sFindText <> '' Then If $fNext = 0 Then Global $oRange = $oIE.document.body.createTextRange() Else $oRange.moveStart("character") EndIf If $oRange.FindText($sFindText) Then $oRange.execCommand("backColor", false, "fdee00"); $oRange.scrollIntoView() Else $oRange = $oIE.document.body.createTextRange() EndIf Else $oIE.document.parentwindow.scroll(0) EndIf EndFunc Func WM_MOUSEWHEEL($hWnd, $iMsg, $wParam, $lParam) Switch $wParam Case 0x00780000 $oIE.document.parentwindow.scrollBy(0, -150) Case 0xFF880000 $oIE.document.parentwindow.scrollBy(0, 150) EndSwitch Return $GUI_RUNDEFMSG EndFunc Func HidePanel($hide = True) AdlibUnRegister("TuckAway") If $hide Then $tucked = False $untucked = True $hidden = True For $i = -1 to -663 Step - 1 WinMove($hGUI, "", Default, $i) Next Else $tucked = False $untucked = False $hidden = False For $i = -664 to -4 Step 1 WinMove($hGUI, "", Default, $i) Next EndIf EndFunc Func TuckAway() If $tuck Then $tucking = False $untucked = False $tucked = True For $i = 663 to 695 Step 1 WinMove($hGUI, "", Default, -$i) Sleep(10) Next Else $untucking = False $tucked = False For $i = 695 to 663 Step - 1 WinMove($hGUI, "", Default, -$i) Sleep(10) Next EndIf AdlibUnRegister("TuckAway") EndFunc Func SetBitmap($hGUI, $hImage, $iOpacity = 255) Local $hScrDC, $hMemDC, $hBitmap, $hOld, $pSize, $tSize, $pSource, $tSource, $pBlend, $tBlend $hScrDC = _WinAPI_GetDC(0) $hMemDC = _WinAPI_CreateCompatibleDC($hScrDC) $hBitmap = _GDIPlus_BitmapCreateHBITMAPFromBitmap($hImage) $hOld = _WinAPI_SelectObject($hMemDC, $hBitmap) $tSize = DllStructCreate($tagSIZE) $pSize = DllStructGetPtr($tSize) DllStructSetData($tSize, "X", _GDIPlus_ImageGetWidth($hImage)) DllStructSetData($tSize, "Y", _GDIPlus_ImageGetHeight($hImage)) $tSource = DllStructCreate($tagPOINT) $pSource = DllStructGetPtr($tSource) $tBlend = DllStructCreate($tagBLENDFUNCTION) $pBlend = DllStructGetPtr($tBlend) DllStructSetData($tBlend, "Alpha", $iOpacity) DllStructSetData($tBlend, "Format", 1) _WinAPI_UpdateLayeredWindow($hGUI, $hGUI, 0, $pSize, $hMemDC, $pSource, 0, $pBlend, $ULW_ALPHA) _WinAPI_ReleaseDC(0, $hScrDC) _WinAPI_SelectObject($hMemDC, $hOld) _WinAPI_DeleteObject($hBitmap) _WinAPI_DeleteDC($hMemDC) EndFunc Script Results Compiled Results
×
×
  • Create New...