Jump to content

Search the Community

Showing results for tags 'PopUp'.

  • 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

Categories

  • Forum FAQ
  • AutoIt

Calendars

  • Community Calendar

Find results in...

Find results that contain...


Date Created

  • Start

    End


Last Updated

  • Start

    End


Filter by number of...

Joined

  • Start

    End


Group


Member Title


Location


WWW


Interests

Found 12 results

  1. Hello forum world, I am having an issue with a popup window displaying after selecting something using the ControlCommand( ) function. I am able to select the desired item from the dropdown list using the control command function but a popup window opens immediately after, not allowing the control command function to finish. Such as: ConsoleWrite("Before ControlCommand" & @CRLF) ControlCommand($Win_Name, "", $ID, "SelectString", $DropItemName) ConsoleWrite("After ControlCommand" & @CRLF) ^^^^ So in the console I can get the "Before...", then the ControlCommand executes the selection of the dropdown menu. Popup window opens But since there is a popup, I can not get the "After..." statement to write to the console. This is where I am stuck, as I can not execute another command to close the popup window. Send help, oh gracious autoit forum.
  2. Is there probably a way to click ie popup button and hide or invisible popup button in the same time? I try to use WinSetState @SW_hide , the result is ie crashing or no response because button hide and the next click command won't work... $oForm=_IEFormGetObjByName($oIE,"form1") $obutton=_IEFormElementGetObjByName($oForm,"btn_OK") $hWnd = _IEPropertyGet($oIE, "hwnd") _IEAction($obutton,"focus") ControlSend($hWnd, "", "[CLASS:Internet Explorer_Server; INSTANCE:1]", "{Enter}") WinWait("", "確定存檔嗎?") WinSetState("","確定存檔嗎?",@SW_Hide) ControlClick("", "確定存檔嗎?", "[CLASS:Button; TEXT:確定; Instance:1;]")
  3. First off, the project I'm working on revolves around AS/400 "Client Access software", it's foundation is directly influenced by the thread linked at the bottom of this post. Moving on, to explain the problem I'm facing; my project utilizes an infinite While loop and automatically performs semi-hard coded monotonous tasks to save users time and effort, the problem is, occasionally and unexpectedly "Display Messages" will popup and the core script will continue executing instead of dismissing said message and the script "breaks". As a countermeasure I've added some code to the While loop in an effort to intervene and dismiss these display messages before the core script has a chance to do anything... however it doesn't work. I hope I didn't do too bad of a job explaining that. So I think my question is: How can I temporarily "pause" the core script when these messages spontaneously appear? The only other solution I thought of would be to check if a display message has appeared before executing every line of code but that obviously isn't very practical. Any and all help is greatly appreciated! Thanks ;Loop to keep script running and handle display messages While 1 dismiss_display_messages() Sleep(50) WEnd ;Function to dismiss display messages Func dismiss_display_messages() If $ps.SearchText("Display Messages") Then $ps.SendKeys("[enter]", 8, 1) ;This while loop waits until the display message has disappeared to resume the core script While $ps.SearchText("Display Messages") Sleep(100) WEnd EndIf EndFunc
  4. I need to send a string of text to this popup and click on the ok button to save it. Here is the code I have so far: ;Start IE Sleep(7000) $oIE = _IECreate("http://www.google.com") Sleep(500) _IELoadWait($oIE) $hIE = _IEPropertyGet($oIE, "hwnd") ; Get Handle of the IE window Sleep(500) WinSetState($hIE, "", @SW_MAXIMIZE) ;Wait for a browser page load to complete Sleep(3000) _IENavigate($oIE, "https://properURL.com") Sleep(8000) _IELoadWait($oIE) ;Attach to a browser control embedded in another window $oIE = _IEAttach("https://"properURL.com", url") ConsoleWrite('@@ Debug(' & @ScriptLineNumber & ') : $oIE = ' & $oIE & @CRLF & '>Error code: ' & @error & ' Extended code: 0x' & Hex(@extended) & @CRLF) ;### Debug Console Sleep(2000) ;Get the title of the webpage ;Local $wTitle = _IEPropertyGet($oIE, "title") ;MsgBox($MB_SYSTEMMODAL, "Webpage title:", $wTitle) ;Clicks the new button Sleep(3000) _IEAction($nWorkOrderB, "focus") _IEAction($nWorkOrderB, "click") Sleep(5000) ;Store the Element names where the important data will be sent ;Store the long description button Local $wLongDButton = _IEGetObjById($oIE, "m65d795a4-img") ;Store the long Description field id Local $wComments = _IEGetObjById($oIE, "ma6499a9c-rte_iframe") ;Store the ok button id that is in the long description Local $wCommOk = _IEGetObjById($oIE, "m74031266-pb") ;******************************************************************************* ; Send the stored data to the proper field ;******************************************************************************* ;Click the long description button Sleep(300) _IEAction($wLongDButton, "focus") _IEAction($wLongDButton, "click") Sleep(300) ;Sends the Comments Sleep(500) _IEAction($wComments, "focus") _IEAction($wComments, "click") Sleep(500) _IEFormElementSetValue($wComments, "hello darkness my old friend") ;Click the ok button Sleep(500) _IEAction($wCommOk, "focus") _IEAction($wCommOk, "click") Sleep(500) Here is the popup:
  5. I'm trying to implement a Ctl-F popup box that looks something like the one that Notepad uses, but I'm not havine much luck. I intend to get it working, then beef up the popup's contents to add several checkboxes, buttons and radio boxes. What my example code does is to use InputBox(), but that's not what I want. Here is my test code: #include <Array.au3> #include <GUIConstantsEx.au3> #AutoIt3Wrapper_Au3Check_Parameters=-d -w 1 -w 2 -w 3 -w 4 -w 5 -w 6 Opt("GUICloseOnESC", 1) Opt("GUIOnEventMode", 1) Opt('MustDeclareVars', 1) OnAutoItExitRegister("ExitStageLeft") Opt("WinTitleMatchMode", -2) Global $hGUI _Main() Func _Main() $hGUI = GUICreate("Test ^F", 300, 200) setupSpecialKeysHandlers() GUISetOnEvent($GUI_EVENT_CLOSE, "Event_GUIClose") GUISetState() While (1) Sleep(157) WEnd EndFunc ;==>_Main Func handle_CTRL_F_key() Local $str $str = InputBox("Search", "Enter the string to search for:") ConsoleWrite("+++: $str ==>" & $str & "<==" & @CRLF) EndFunc ;==>handle_CTRL_F_key Func ExitStageLeft() Exit (99) EndFunc ;==>ExitStageLeft Func Event_GUIClose() Exit (1) EndFunc ;==>Event_GUIClose Func setupSpecialKeysHandlers() Local $ar, $parts, $key, $handler, $id Local $aAccelKeys[1][2] ; Create a table of Special keys and their handlers $ar = StringSplit("", "") _ArrayAdd($ar, "^f - handle_CTRL_F_key ") ReDim $aAccelKeys[UBound($ar) - 1][2] ; Now, create $aAccelKeys array with the table data. ; For each entry, create a Dummy GUI and associate its ; ID with the special key. For $ndx = 1 To UBound($ar) - 1 $parts = StringSplit($ar[$ndx], "-", 2) $key = StringStripWS($parts[0], 8) $handler = StringStripWS($parts[1], 8) $id = GUICtrlCreateDummy() $aAccelKeys[$ndx - 1][0] = $key $aAccelKeys[$ndx - 1][1] = $id GUICtrlSetOnEvent($id, $handler) Next GUISetAccelerators($aAccelKeys) ; Setup the Special keys hooks EndFunc ;==>setupSpecialKeysHandlers
  6. Hi there, this is supposed to work as a toast, called by functions and such. Kinda looks like the windows 10 notification, as intended, and the only problem is that i can't find a way to hide the taskbar button. Opt("WinSearchChildren", 1) #include <WindowsConstants.au3> #include <GUIConstantsEx.au3> HotKeySet("{ESC}", "Terminate") Local $hParentWin, $hChildWin, $aMsg $hParentWin = GUICreate("Parent GUI", 200, 100) GUISetState(@SW_SHOW) $hChildWin = GUICreate("Child GUI", 360, 65, @DesktopWidth + 400, @DesktopHeight - 106, $WS_POPUP, $WS_EX_APPWINDOW+$WS_EX_TOPMOST) GUISetBkColor(0x1F1F1F, $hChildWin) GUICtrlCreatePic(@ScriptDir&'\Info.bmp', 8, 8, 48, 48) $Title = GUICtrlCreateLabel('Title', 70, 10, 250, 25) GUICtrlSetFont($Title, 14, 900, 0, 'Arial', 5) GUICtrlSetColor($Title, 0xFFFFFF) GUICtrlSetBkColor($Title, 0x1F1F1F) $Text = GUICtrlCreateLabel('Text', 70, 35, 250, 25) GUICtrlSetFont($Text, 10, 600, 0, 'Arial', 5) GUICtrlSetColor($Text, 0x707070) GUICtrlSetBkColor($Text, 0x1F1F1F) GUISetState(@SW_SHOW) Show() Func Show() WinMove($hChildWin, '', @DesktopWidth - 360, @DesktopHeight - 106, 360, 65, 1) ConsoleWrite('Show - ' & @MSEC & @CRLF) EndFunc ;==>Show Func Hide() WinMove($hChildWin, '', @DesktopWidth + 400, @DesktopHeight - 106, 360, 65, 1) ConsoleWrite('Hide - ' & @MSEC & @CRLF) EndFunc ;==>Hide While 1 Sleep(300) WEnd Func Terminate() Exit EndFunc ;==>Terminate Info.bmp
  7. Greetings fellows, I have an issue that is bothering me for quite some time now (Since Autoit3 V3.3.8.0 and still not solved in 3.3.14.0) and i have not found any clue how to solve this particular problem regarding the control of popup-menus for specific controls. I have been searching using many keywords in the hope to find a similar posted issue either on the internet or here on this forum but did not yet stumbled upon it so i have no other option than to post the question (Sorry if there would exist an earlier topic). Below is an example that demonstrates the issue very clearly if you follow the steps to reproduce: #include <GuiMenu.au3> #include <GUIConstantsEx.au3> #include <ListViewConstants.au3> #include <WindowsConstants.au3> $TestWindow1 = GUICreate("TestWindow1", 353, 277, 100, 80) $ListView1 = GUICtrlCreateListView("", 8, 8, 338, 262) $ListView1_0 = GUICtrlCreateListViewItem("TestItem1", $ListView1) $ListView1_1 = GUICtrlCreateListViewItem("TestItem2", $ListView1) $ListView1_2 = GUICtrlCreateListViewItem("TestItem3", $ListView1) GUISetState(@SW_SHOW) $TestWindow2 = GUICreate("TestWindow2", 353, 277, 100 + 400, 80) $ListView2 = GUICtrlCreateListView("", 8, 8, 338, 262) $ListView2_0 = GUICtrlCreateListViewItem("TestItem1", $ListView2) $ListView2_1 = GUICtrlCreateListViewItem("TestItem2", $ListView2) $ListView2_2 = GUICtrlCreateListViewItem("TestItem3", $ListView2) GUISetState(@SW_SHOW) GUIRegisterMsg($WM_NOTIFY, "WM_NOTIFY") Local $MenuContext, $MenuContext2 Local $ahLVMenu[3] Local $ahLVMenu2[3] For $i = 0 To 2 $ahLVMenu[$i] = GUICtrlCreateDummy() $ahLVMenu2[$i] = GUICtrlCreateDummy() Next While 1 Local $nMsg = GUIGetMsg(1) Switch $nMsg[0] Case $GUI_EVENT_CLOSE If $nMsg[1] == $TestWindow2 Then GUISetState(@SW_HIDE, $nMsg[1]) Else Exit EndIf Case $ahLVMenu[0] ConsoleWrite("Dialog 1, Item 1" & @CRLF) Case $ahLVMenu[1] ConsoleWrite("Dialog 1, Item 2" & @CRLF) Case $ahLVMenu[2] ConsoleWrite("Dialog 1, Item 3" & @CRLF) Case $ahLVMenu2[0] ConsoleWrite("Dialog 2, Item 1" & @CRLF) Case $ahLVMenu2[1] ConsoleWrite("Dialog 2, Item 2" & @CRLF) Case $ahLVMenu2[2] ConsoleWrite("Dialog 2, Item 3" & @CRLF) EndSwitch WEnd Func WM_NOTIFY($hWnd, $Msg, $wParam, $lParam) #forceref $hWnd, $Msg, $wParam Local $hWndFrom, $iIDFrom, $event, $tNMHDR, $hWndListView, $hWndListView2, $tInfo $hWndListView = $ListView1 $hWndListView2 = $ListView2 Local $tMsgFilter, $hMenu If Not IsHWnd($ListView1) Then $hWndListView = GUICtrlGetHandle($ListView1) If Not IsHWnd($ListView2) Then $hWndListView2 = GUICtrlGetHandle($ListView2) $tNMHDR = DllStructCreate($tagNMHDR, $lParam) $hWndFrom = HWnd(DllStructGetData($tNMHDR, "hWndFrom")) $iIDFrom = DllStructGetData($tNMHDR, "IDFrom") $event = DllStructGetData($tNMHDR, "Code") Switch $hWndFrom Case $hWndListView2 Switch $event Case $NM_RCLICK ; Sent by a list-view control when the user clicks an item with the right mouse button _LV_PopUpMenu2() ; Show popup context menu in Pharmacist article list EndSwitch Case $hWndListView Switch $event Case $NM_RCLICK ; Sent by a list-view control when the user clicks an item with the right mouse button _LV_PopUpMenu() ; Show popup context menu in Pharmacist article list EndSwitch EndSwitch $hWndFrom = 0 $iIDFrom = 0 $tNMHDR = 0 $hWndListView = 0 $hWndListView2 = 0 $tInfo = 0 $tMsgFilter = 0 $hMenu = 0 Return $GUI_RUNDEFMSG EndFunc ;==>WM_NOTIFY Func _LV_PopUpMenu() $MenuContext = _GUICtrlMenu_CreatePopup(40) _GUICtrlMenu_InsertMenuItem($MenuContext, 0, "Dialog 1, item 1", $ahLVMenu[0]) _GUICtrlMenu_InsertMenuItem($MenuContext, 1, "Dialog 1, item 2", $ahLVMenu[1]) _GUICtrlMenu_InsertMenuItem($MenuContext, 2, "Dialog 1, item 3", $ahLVMenu[2]) _GUICtrlMenu_TrackPopupMenu($MenuContext, $TestWindow1) _GUICtrlMenu_DestroyMenu($MenuContext) Return $GUI_RUNDEFMSG EndFunc ;==>_LV_PopUpMenu Func _LV_PopUpMenu2() $MenuContext2 = _GUICtrlMenu_CreatePopup(40) _GUICtrlMenu_InsertMenuItem($MenuContext2, 0, "Dialog 2, item 1", $ahLVMenu2[0]) _GUICtrlMenu_InsertMenuItem($MenuContext2, 1, "Dialog 2, item 2", $ahLVMenu2[1]) _GUICtrlMenu_InsertMenuItem($MenuContext2, 2, "Dialog 2, item 3", $ahLVMenu2[2]) _GUICtrlMenu_TrackPopupMenu($MenuContext2, $TestWindow2) _GUICtrlMenu_DestroyMenu($MenuContext2) Return $GUI_RUNDEFMSG EndFunc ;==>_LV_PopUpMenu2 I have two window dialogs and two listview controls defined. Each listview control has its own popup menu and menu items. The code above works fine as long as both window dialogs are visible. You can right-click on each listview control and you get the designated menu popped up and if you select an item, the message for the specific item is being written into the console frame for it. However, if you close window 2, and attempt to trigger the options in the popup menu for window 1, you will notice that the notification messages are no longer being triggered at all. The popup menu becomes visible if you right-click the area and disappears if you select an option, but the control item no longer sends a notification which means that the attached events for the trapping are no longer being executed. Now if you switch the code snippets of the window frames being generated, you will notice you can achieve the same issue the other way round, which means that context menu item notifications are being received and trigger an event routine as long as window 1 would then in that case remain open. So it seems that whichever window is generated the last, that window somehow seems to get attached to the notification messages that are being send by the dummy controls for the context menu items. Do i misinterpret something here, is there a fix for this issue or did i encountered some kind of bug inside Autoit3?
  8. Hi all, Because i wanted to download and read remote files through proxy servers and if needed use advanced authentication methods (e.g. NTLM), i made some useful functions that utilize standalone wget or curl executables (included). http://publictoolsrepo.sourceforge.net/apps/wget-curl.zip - i was unable to attach it #include <Array.au3> #include 'udf_wget_curl.au3' ; gui examples ; =============================================================================================================================== ; a simple input window Dim $sVALUE = __gui_create_input_dialog('this is the title of the window', 'this is the text shown on the window', 'name', '', False, -1, -1, False, FileRead('randomtext.txt'), 'a optional default value') ConsoleWrite('@@ Debug(' & @ScriptLineNumber & ') : $sVALUE = ' & $sVALUE & @CRLF) ;### Debug Console ; a simple input window with the screen dimmed and the field is passworded Dim $sVALUE = __gui_create_input_dialog('another nice popup', 'this one shows the screen dimmed and the size of the window is relative to the text length' & @CRLF & 'this one shows the screen dimmed and the size of the window is relative to the text length', 'password? :)', '', True, -1, -1, True) ConsoleWrite('@@ Debug(' & @ScriptLineNumber & ') : $sVALUE = ' & $sVALUE & @CRLF) ;### Debug Console ; a simple combo window Dim $sVALUE = __gui_create_combo_dialog('the title', 'the text', 'choose your food', '', False, -1, -1, False, '', 'Pizza|Burger|Raw Code', '') ConsoleWrite('@@ Debug(' & @ScriptLineNumber & ') : $sVALUE = ' & $sVALUE & @CRLF) ;### Debug Console ; a auth window :) Dim $aRESULT = __gui_create_auth_dialog('this looks legit', 'your data is safe with me ;)', 0, True, False, False) _ArrayDisplay($aRESULT) ; a progress window example Dim $aPROGRESS = __gui_progress_create('text displayed', 10, -1, 10, 'this footnote text is optional!') Sleep(1000) __gui_progress_set_bar_amount($aPROGRESS, 20, 'test updated :)') Sleep(1000) __gui_progress_set_bar_amount($aPROGRESS, 40, 'test updated :) and another') Sleep(1000) __gui_progress_set_bar_amount($aPROGRESS, 60, 'test updated :) and another and another') Sleep(1000) __gui_progress_set_bar_amount($aPROGRESS, 80, 'test updated :) and another and another and another') Sleep(1000) __gui_progress_destroy($aPROGRESS) ; wget-curl examples ; =============================================================================================================================== ; download a file with progess __wget_download_start('http://ipv4.download.thinkbroadband.com/10MB.zip', @ScriptDir, 'randomtext.txt', 'a file for you') ; read a remote file :) Dim $sFILE = __wget_read_remote_file('http://publictoolsrepo.sourceforge.net/apps/randomtext.txt') ConsoleWrite('@@ Debug(' & @ScriptLineNumber & ') : $sFILE = ' & $sFILE & @CRLF) ;### Debug ConsoleAs a bonus i also included some of my GUI functions that are used by it. Most functions are written and designed using a modular approach so they should be easily implementable. The following dependencies are also included and i would like to credit the authors. GIFAnimation - trancexx ResourcesEx - Zedna (original) guinness (current) _StringSize - Melba23
  9. I need to input text and submit a form that popups. Here is what I got so far but it is not working. ; Find Phone Popup $pIE = WinGetTitle("[Active]") $oForm = _IEFormGetObjByName($pIE,"phoneFindListForm") $oSelect = _IEFormElementGetObjByName($oForm, "searchField0") _IEAction($oSelect, "focus") _IEFormElementOptionSelect($oSelect, "numplan.dnorpattern")When this runs I get the following error. IE.au3 T3.0-1 Warning from function _IEFormElementGetObjByName, $_IESTATUS_NoMatch --> IE.au3 T3.0-1 Error from function _IEAction(focus), $_IESTATUS_InvalidDataType --> IE.au3 T3.0-1 Error from function _IEFormElementOptionSelect, $_IESTATUS_InvalidDataType --> IE.au3 T3.0-1 Error from function _IEFormGetObjByName, $_IESTATUS_InvalidDataType --> IE.au3 T3.0-1 Error from function _IEFormElementGetObjByName, $_IESTATUS_InvalidDataType --> IE.au3 T3.0-1 Error from function _IEAction(focus), $_IESTATUS_InvalidDataType --> IE.au3 T3.0-1 Error from function _IEFormElementOptionSelect, $_IESTATUS_InvalidDataTypeI am thinking my issue is getting the _IEFormGetObjByName() correct and the rest of the script will work. Once the form is submitted the focus should go back to the original form.
  10. Hello Everybody, This is my first official post even though I have been scouring the forums for a couple weeks now. I am a new program Hobbyist...just began learning Autoit/any language no earlier than the beginning of June. I am currently trying to figure out how to use the find Color under mouse and apply it from a pop up screen to a main GUI. I did find the main part of this code on one of these pages but I can't find where I originally started from...So thank you to whomever that was! Issues I am facing: When it does work it only works onceCan't seem to get the value of the Hex properly (tried different variations and my brain hurts now)The main GUI doesn't refresh properly#include <WindowsConstants.au3> #include <StaticConstants.au3> #include <ButtonConstants.au3> #include <GUIConstantsEx.au3> Global $pos = MouseGetPos() Global $pixel_hex = Hex(PixelGetColor($pos[0],$pos[1]), 6) Global $pixel_last Global $Popcolor, $ColorUpdate, $lblF8, $lblF9, $lblF10, $lblF11, $HexTopFirst, $HexTopSecond, $HexTopThird, $HexTopFourth, _ $HexBotFirst, $HexBotSecond, $HexBotThird, $HexBotFourth, $lblName1, $lblName2, $lblName3, $lblName4, $FirstColor, _ $SecondColor, $ThirdColor, $FourthColor HotKeySet("{F8}","clip8") HotKeySet("{f9}","clip9") HotKeySet("{F10}","clip10") HotKeySet("{f11}","clip11") HotKeySet("{ESC}","endme") ;-----------------MAIN GUI--------------- $MainColor = GUICreate ("Main Color Find", 340,140) $ColorUpdate = GUICtrlCreateButton("Find Colors",110,105,120,25) ;........NAME Labels............ $lblMainName1= GUICtrlCreateLabel("One", 30, 68, 50, 13) $lblMainName2= GUICtrlCreateLabel("Two", 108, 68, 45, 13) $lblMainName3= GUICtrlCreateLabel("Three", 195, 68, 100, 13) $lblMainName4= GUICtrlCreateLabel("Four", 280, 68, 30, 13) ;........Graphics........ $FirstMain = GUICtrlCreateGraphic(35, 48, 18, 18, BitOR($GUI_SS_DEFAULT_GRAPHIC,$SS_BLACKFRAME,$SS_SUNKEN)) $SecondMain = GUICtrlCreateGraphic(112, 48, 18, 18, BitOR($GUI_SS_DEFAULT_GRAPHIC,$SS_BLACKFRAME,$SS_SUNKEN)) $ThirdMain = GUICtrlCreateGraphic(200, 48, 18, 18, BitOR($GUI_SS_DEFAULT_GRAPHIC,$SS_BLACKFRAME,$SS_SUNKEN)) $FourthMain = GUICtrlCreateGraphic(282, 48, 18, 18, BitOR($GUI_SS_DEFAULT_GRAPHIC,$SS_BLACKFRAME,$SS_SUNKEN)) GUISetState(@SW_SHOW) ;----------Main Loop--------------------- While 1 $nMsg = GUIGetMsg(1) Switch $nMsg[1] Case $MainColor Switch $nMsg[0] Case $GUI_EVENT_CLOSE Exit Case $ColorUpdate PopColor() EndSwitch Case $PopColor Sleep(100) Call("grab") Switch $nMsg[0] Case $GUI_EVENT_CLOSE GUIDelete($PopColor) Sleep(10) GUICtrlSetState($ColorUpdate, $GUI_Enable) Case $ColorUpdate GUICtrlSetBkColor($FirstMain,$FirstColor) GUICtrlSetBKColor($SecondMain,$SecondColor) GUICtrlSetBKColor($ThirdMain,$ThirdColor) GUISetBkColor($FourthMain,$FourthColor) EndSwitch EndSwitch WEnd Func PopColor() $PopColor = GUICreate("Color Find Pop", 340,140) $ColorUpdate = GUICtrlCreateButton("Update Main",110,105,120,25) ;........F9 - F12 Labels....... $lblF8= GUICtrlCreateLabel("F8", 35, 7, 30, 20) $lblF9= GUICtrlCreateLabel("F9", 112, 7, 45, 20) $lblF10 = GUICtrlCreateLabel("F10", 200, 7, 50, 20) $lblF11 = GUICtrlCreateLabel("F11", 282, 7, 42, 20) ;........Top HEX Labels....... $HexTopFirst= GUICtrlCreateLabel("", 22, 32, 60, 13) $HexTopSecond= GUICtrlCreateLabel("", 102, 32, 60, 13) $HexTopThird = GUICtrlCreateLabel("", 188, 32, 60, 13) $HexTopFourth = GUICtrlCreateLabel("", 271, 32, 60, 13) ;........BOTTOM HEX Labels....... $HexBotFirst= GUICtrlCreateLabel("", 22, 85, 60, 13) $HexBoTSecond= GUICtrlCreateLabel("", 102, 85, 60, 13) $HexBoTThird = GUICtrlCreateLabel("", 188, 85, 60, 13) $HexBoTFourth = GUICtrlCreateLabel("", 271, 85, 60, 13) ;........NAME Labels............ $lblName1= GUICtrlCreateLabel("One", 30, 68, 50, 13) $lblName2= GUICtrlCreateLabel("Two", 108, 68, 45, 13) $lblName3= GUICtrlCreateLabel("Three", 195, 68, 100, 13) $lblName4= GUICtrlCreateLabel("Four", 280, 68, 30, 13) ;........Graphics........ $FirstColor = GUICtrlCreateGraphic(35, 48, 18, 18, BitOR($GUI_SS_DEFAULT_GRAPHIC,$SS_BLACKFRAME,$SS_SUNKEN)) $SecondColor = GUICtrlCreateGraphic(112, 48, 18, 18, BitOR($GUI_SS_DEFAULT_GRAPHIC,$SS_BLACKFRAME,$SS_SUNKEN)) $ThirdColor = GUICtrlCreateGraphic(200, 48, 18, 18, BitOR($GUI_SS_DEFAULT_GRAPHIC,$SS_BLACKFRAME,$SS_SUNKEN)) $FourthColor = GUICtrlCreateGraphic(282, 48, 18, 18, BitOR($GUI_SS_DEFAULT_GRAPHIC,$SS_BLACKFRAME,$SS_SUNKEN)) GUISetState(@SW_Show) EndFunc func grab() $pos = MouseGetPos() $pixel_hex = Hex(PixelGetColor($pos[0],$pos[1]), 6) If $pixel_last <> $pixel_hex Then GUICtrlSetData($HexTopFirst, $pixel_hex) GUICtrlSetData($HexTopSecond, $pixel_hex) GUICtrlSetData($HexTopThird, $pixel_hex) GUICtrlSetData($HexTopFourth, $pixel_hex) EndIf $pixel_last = $pixel_hex EndFunc Func clip8() Local $color = "0x" & $pixel_last GUICtrlSetBkColor($FirstColor, $color) GUICtrlSetColor($HexBotFirst,"0x"&$Pixel_Last) GUICtrlSetData($HexBotFirst, $Pixel_Last) EndFunc Func clip9() Local $color = "0x" & $pixel_last GUICtrlSetBkColor($SecondColor, $color) GUICtrlSetColor($HexBotSecond,"0x"&$Pixel_Last) GUICtrlSetData($HexBotSecond, $Pixel_Last) EndFunc Func clip10() Local $color = "0x" & $pixel_last GUICtrlSetBkColor($ThirdColor, $color) GUICtrlSetColor($HexBotThird,"0x"&$Pixel_Last) GUICtrlSetData($HexBotThird, $Pixel_Last) EndFunc Func clip11() Local $color = "0x" & $pixel_last GUICtrlSetBkColor($FourthColor, $color) GUICtrlSetColor($HexBotFourth,"0x"&$Pixel_Last) GUICtrlSetData($HexBotFourth, $Pixel_Last) EndFunc Func endme() Exit EndFunc Questions: Can my purpose be served better by applying read and write ini file? Would it be possible to have the main GUI already have a saved HEX color if using ini that can be overwritting from pop up menu?Would OnEvent be better?Any help would be appreciated...been stressing out over this coding for the last few days!
  11. I use a lot of IE functions in my scripts and find it really annoying when I try to use _IENavigate to leave a webpage and I get popups saying things like "Are you sure you want to leave this page?". I searched the forum and could not find a solution that I liked so I created this function. I hope others find it useful and as always I am open to any constructive criticism (that's how we learn). _ProcessGetParent() function taken from MrCreatoR's post (thanks MrCreatoR) #include <IE.au3> ;This page currently has displays a popup when you try to navigate away from the page $any_url = "aquaponics4you.com" ;$any_url = "yahoo.com" $oIE = _IECreate($any_url) $oIE = _IENavigate_kill_popup($oIE, "Google.com") Func _IENavigate_kill_popup($IEObject, $URL, $visible = 1, $wait = 1) If Not IsObj($IEObject) Then Return SetError(1, 0, 0) $closed_process = False ;gets the IE process $pid = WinGetProcess(_IEPropertyGet($IEObject, "hwnd")) ;Trys to navigate to URL _IENavigate($IEObject, $URL, 0) ;Gets list of all process $aProc_List = ProcessList() ;Checks to see if any process were opened by the IE window. If process where opened it closes them and the IE window. For $i = 1 To $aProc_List[0][0] If _ProcessGetParent($aProc_List[$i][1]) = $pid Then ProcessClose($aProc_List[$i][1]) $closed_process = True EndIf Next ;will create a new IE with old IE object varable if it no longer exists. If $closed_process = True Then $IEObject = _IECreate($URL, 0, $wait) Return $IEObject Else If $wait = 1 Then _IELoadWait($IEObject) Return $IEObject EndIf EndFunc ;==>_IENavigate_stop_pop Func _ProcessGetParent($iPID) Local $wbemFlagReturnImmediately = 0x10 Local $wbemFlagForwardOnly = 0x20 Local $colItems = "" Local $strComputer = "localhost" $objWMIService = ObjGet("winmgmts:\\" & $strComputer & "\root\CIMV2") $colItems = $objWMIService.ExecQuery("SELECT * FROM Win32_Process", "WQL", $wbemFlagReturnImmediately + $wbemFlagForwardOnly) If IsObj($colItems) Then For $objItem In $colItems If $objItem.ProcessID = $iPID Then Return $objItem.ParentProcessID Next EndIf Return SetError(1, 0, 0) EndFunc ;==>_ProcessGetParent
  12. Is there a fast way of check to see if a URL is a download link before I use _IENavigate? Also, does anyone know how to disable all popup windows (like the are your sure you want to navigate away windows) without disabling scripting? Thanks
×
×
  • Create New...