Jump to content
Sign in to follow this  
faustf

controlsend and windows 10 why not work?

Recommended Posts

hi guys

i have a script  like this,  in windows 7 work perfect , in windows 10 not  work  , some one can explain me  why ??'

#include <Array.au3>
#include <MsgBoxConstants.au3>
Global $aGPathFoto= FileReadToArray (@ScriptDir & "\TEMP\PathFoto.txt")
 
Local $ctrl = 0
 
While 1
    Local $hWnd = WinWait("[CLASS:#32770]", "", 10)
    If WinExists("[CLASS:#32770]") Then
 
        If $ctrl < 2 Then
 
            ControlSend($hWnd, "Choose File to Upload", "[CLASS:Edit; INSTANCE:1]",  $aGPathFoto[0]&"{Enter}")
 
            Exit
 
            $ctrl += 1
        Else

            ExitLoop
        EndIf
    EndIf

WEnd

$aGpathfoto = C:\Users\Public\Pictures\Sample Pictures\Chrysanthemum.jpg

Share this post


Link to post
Share on other sites

MS .NET frammework issue ?

 

https://en.wikipedia.org/wiki/Microsoft_UI_Automation

 

And #RequireAdmin if the application 

[CLASS:#32770]

Is runned as admin.

 

 

Edited by caramen

My video tutorials : HERE ( In construction )  || My Discord : https://discord.gg/S9AnwHw

How to Ask Help ||  UIAutomation From Junkew || WebDriver From Danp2 || And Water's UDFs in the Quote

Spoiler

 Water's UDFs:
Active Directory (NEW 2018-10-19 - Version 1.4.10.0) - Download - General Help & Support - Example Scripts - Wiki
OutlookEX (2018-10-31 - Version 1.3.4.1) - Download - General Help & Support - Example Scripts - Wiki
ExcelChart (2017-07-21 - Version 0.4.0.1) - Download - General Help & Support - Example Scripts
PowerPoint (2017-06-06 - Version 0.0.5.0) - Download - General Help & Support
Excel - Example Scripts - Wiki
Word - Wiki
 
Tutorials:

ADO - Wiki

 

Share this post


Link to post
Share on other sites

yes  work  , but not  work i explain much better

i  have  a  first exe  ,it run like administrator , and  it   call

a   exe

#include <Array.au3>
#include <MsgBoxConstants.au3>
#RequireAdmin
Global $aGPathFoto= FileReadToArray (@ScriptDir & "\TEMP\PathFoto.txt")
 
Local $ctrl = 0
 
While 1
    Local $hWnd = WinWait("[CLASS:#32770]", "", 10)
    If WinExists("[CLASS:#32770]") Then
 
        If $ctrl < 2 Then
 
            ControlSend($hWnd, "Choose File to Upload", "[CLASS:Edit; INSTANCE:1]",  $aGPathFoto[0]&"{Enter}")
 
            Exit
 
            $ctrl += 1
        Else

            ExitLoop
        EndIf
    EndIf

WEnd

the problem is  if  i run  with double click over second exe it  works  , but if  the second is  call by first  (both have #RequireAdmin) not work  o_O

 

Share this post


Link to post
Share on other sites

Look : 

If you got rigths issue: 

You have to understand this : 

When you start a script without rights: You CANNOT do automation to a software Runned as Admin/Domain Admin (RunAs) with rights.

When you start your script with #RequireAdmin : It will ask you the rights at the start of the script. All the application opened by your script will have these rights Nothing else. 

So everything that you will automate with this case have to got the same permitions/rights or no rights needed at all to be automated.

 

When you start your script with #RequireAdmin : You can automate all admin application and all user application that does not need rights. 

 

Check all that. Come back if you still have issue. Hope i am clear enouth becose my english need improvement ;p.

 

 

 

 

You got somthing reaaaaaly easy to do to check about how rights are working on a soft. 

 

Just attach handle and try play with windows. Just with WinMove. Non-Admin rights based software will be able to be moved without #RequireAdmin

The oposite is true.

Edited by caramen

My video tutorials : HERE ( In construction )  || My Discord : https://discord.gg/S9AnwHw

How to Ask Help ||  UIAutomation From Junkew || WebDriver From Danp2 || And Water's UDFs in the Quote

Spoiler

 Water's UDFs:
Active Directory (NEW 2018-10-19 - Version 1.4.10.0) - Download - General Help & Support - Example Scripts - Wiki
OutlookEX (2018-10-31 - Version 1.3.4.1) - Download - General Help & Support - Example Scripts - Wiki
ExcelChart (2017-07-21 - Version 0.4.0.1) - Download - General Help & Support - Example Scripts
PowerPoint (2017-06-06 - Version 0.0.5.0) - Download - General Help & Support
Excel - Example Scripts - Wiki
Word - Wiki
 
Tutorials:

ADO - Wiki

 

Share this post


Link to post
Share on other sites

yes  i know  this  therfore i thin is very strange  in pratical with first  exe  (run in administration mode ) open a site and arrive to  upload  foto ,  before open a foto upload (and  script go in pause )  i run a  external second exe  the second exe have the same   requireadmin (and obviusly if the first exe run like admin ..) at  this point  remain in open foto  and see the  2 exe  run and  also  ersult of control send  give me 1   but not  write nothing 0_0

Share this post


Link to post
Share on other sites

Oh... Wow... Never thougth about this... 

 

A script with #RequireAdmin that is running an other script with #RequireAdmin 

Hmmmm.... 

 

You probably have to let this #RequireAdmin on both script and have the behavior prompt disabled in the registry. Tio be sure abou the UAC prompt. But this is not your issue right ? 

 

becose when you explain it. It s realy similar about rights requirements. 


My video tutorials : HERE ( In construction )  || My Discord : https://discord.gg/S9AnwHw

How to Ask Help ||  UIAutomation From Junkew || WebDriver From Danp2 || And Water's UDFs in the Quote

Spoiler

 Water's UDFs:
Active Directory (NEW 2018-10-19 - Version 1.4.10.0) - Download - General Help & Support - Example Scripts - Wiki
OutlookEX (2018-10-31 - Version 1.3.4.1) - Download - General Help & Support - Example Scripts - Wiki
ExcelChart (2017-07-21 - Version 0.4.0.1) - Download - General Help & Support - Example Scripts
PowerPoint (2017-06-06 - Version 0.0.5.0) - Download - General Help & Support
Excel - Example Scripts - Wiki
Word - Wiki
 
Tutorials:

ADO - Wiki

 

Share this post


Link to post
Share on other sites

Give it a try on that: 

 

Try shellExecut and then try winmove. < I am sure this one wont work

 

 

Try RunAs Domain admin and try again to move < I am sure this one will work


My video tutorials : HERE ( In construction )  || My Discord : https://discord.gg/S9AnwHw

How to Ask Help ||  UIAutomation From Junkew || WebDriver From Danp2 || And Water's UDFs in the Quote

Spoiler

 Water's UDFs:
Active Directory (NEW 2018-10-19 - Version 1.4.10.0) - Download - General Help & Support - Example Scripts - Wiki
OutlookEX (2018-10-31 - Version 1.3.4.1) - Download - General Help & Support - Example Scripts - Wiki
ExcelChart (2017-07-21 - Version 0.4.0.1) - Download - General Help & Support - Example Scripts
PowerPoint (2017-06-06 - Version 0.0.5.0) - Download - General Help & Support
Excel - Example Scripts - Wiki
Word - Wiki
 
Tutorials:

ADO - Wiki

 

Share this post


Link to post
Share on other sites

i resolve  ,  the script  work correct also   i use a timing  for  wait open and  this timing not respect  time  now  work correct :)

Share this post


Link to post
Share on other sites

Create an account or sign in to comment

You need to be a member in order to leave a comment

Create an account

Sign up for a new account in our community. It's easy!

Register a new account

Sign in

Already have an account? Sign in here.

Sign In Now
Sign in to follow this  

  • Similar Content

    • By somebadhat
      Restore blank Windows 10 start menu icons.
      ; RESTORE BLANK WINDOWS 10 START MENU ICONS. ; TOGGLE SETTINGS-START-"USE START FULL SCREEN" TWICE ; THIS WILL RESTORE SOME OF THE BLANK ICONS ; FOR THOSE THAT IT DOES NOT REDO "CHANGE ICON" FROM THE PROPERTIES DIALOG BOX FOR EACH MISSING ICON. ; "C:\Program Files (x86)\AutoIt3\AutoIt3_x64.exe" "F:\MYAPPS\WINDOWS\StartMenu1.au3" ; windows 10 and autoit3 AutoItSetOption ("SendKeyDelay" , "1000") Run(@ComSpec & " /c start ms-settings:personalization-start", "", @SW_SHOWMINIMIZED) Sleep(1000) ; send("{tab 8}{space}{tab 6}") ; Move to "use start full screen", toggle it and (improves reliability) return cursor to "find a setting" search box. MouseClick("left", 379, 490, 1, 0) ; Change as needed. Autoitv3 Window Info MouseClick Coords are 23px north. If y=467 use y=490 Sleep(250) ; Msgbox(0,"Operation halted","Continue?") ; PAUSE FOR DEBUG WinClose("[CLASS:ApplicationFrameWindow]", "") Send("{LWIN 2}") ; OPEN AND CLOSE THE START MENU Run(@ComSpec & " /c start ms-settings:personalization-start", "", @SW_SHOWMINIMIZED) Sleep(1000) ; send("{tab 8}{space}{tab 6}") ; Move to "use start full screen", toggle it and (improves reliability) return cursor to "find a setting" search box. MouseClick("left", 379, 490, 1, 0) ; Change as needed. Autoitv3 Window Info MouseClick Coords are 23px north. If y=467 use y=490 Sleep(250) ; Msgbox(0,"Operation halted","Continue?") ; PAUSE FOR DEBUG WinClose("[CLASS:ApplicationFrameWindow]", "") Send("{LWIN}") ; OPEN START MENU sleep(2000) Send("{LWIN}") ; CLOSE START MENU Exit
    • By Simpel
      Hi,
      at work we changed now from windows 7 to windows 10. Suddenly this command _GUICtrlListView_GetHotItem() isn't working anymore for me. When I drag&drop a listviewitem it always returns -1.
      Here is the script that worked with WIN7:
      #include <GUIConstantsEx.au3> #include <GuiListView.au3> #include <Misc.au3> Local $aArray_Base[5][2] = [["0 - 0", "0 - 1"], ["1 - 0", "1 - 1"], ["2 - 0", "2 - 1"], ["3 - 0", "3 - 1"], ["4 - 0", "4 - 1"]] GUICreate("listview", 220, 200) Global $g_idListView = GUICtrlCreateListView("", 10, 10, 200, 180) _GUICtrlListView_AddColumn($g_idListView, "Col 1", 100) _GUICtrlListView_AddColumn($g_idListView, "Col 2", 100) _GUICtrlListView_AddArray($g_idListView, $aArray_Base) GUISetState(@SW_SHOW) While 1 Switch GUIGetMsg() Case $GUI_EVENT_CLOSE ExitLoop Case $GUI_EVENT_PRIMARYDOWN _Arrange_List() EndSwitch WEnd Func _Arrange_List() Local $iSelected = _GUICtrlListView_GetSelectionMark($g_idListView) If $iSelected = -1 Then Return While _IsPressed(1) WEnd Local $iDropped = _GUICtrlListView_GetHotItem($g_idListView) ConsoleWrite("GetHotItem: " & $iDropped & @CRLF) If $iDropped > -1 Then _GUICtrlListView_BeginUpdate($g_idListView) If $iSelected < $iDropped Then _GUICtrlListView_InsertItem($g_idListView, "", $iDropped + 1) _GUICtrlListView_SetItemText($g_idListView, $iDropped +1, _GUICtrlListView_GetItemTextString($g_idListView, $iSelected), -1) _GUICtrlListView_DeleteItem($g_idListView, $iSelected) ElseIf $iSelected > $iDropped Then _GUICtrlListView_InsertItem($g_idListView, "", $iDropped) _GUICtrlListView_SetItemText($g_idListView, $iDropped, _GUICtrlListView_GetItemTextString($g_idListView, $iSelected + 1), -1) _GUICtrlListView_DeleteItem($g_idListView, $iSelected + 1) EndIf _GUICtrlListView_SetItemSelected($g_idListView, $iDropped) _GUICtrlListView_SetSelectionMark($g_idListView, $iDropped) _GUICtrlListView_EndUpdate($g_idListView) EndIf EndFunc Any ideas?
      Regards, Simpel
       
      P.S. If I click an item then $iDropped is returning the correct number.
    • By gahhon
      I have a application that have a function is to create a shortcut to desktop, lets say is ChromePortable.lnk.
      $iCreate = FileCreateShortcut($DIR_WA_FOLDER & '\GoogleChromePortable.exe', $DIR_SHORTCUT, $DIR_WA_FOLDER, '--kiosk "https://example.com/"') So the shortcut will be launch as kiosk mode and force to enter the specific website. However, the user is still able to right-click on the shortcut and modify the target value to remove the kiosk mode. What can I do to disable the user to editing the target value?
      So far, I had asked and tried from SuperUser for advises Disable Shortcut Target Field
      icacls "ChromePortable.lnk" /GRANT EVERYONE:RX So this will set the permission of this shortcut file to only Read & Execute only! But after I set it, the user is still can modify.
      Please kindly advise.
      Please note and assume that user don't have Administration account or etc, that should be only have 1 account to logon to the computer.
       
      EDIT:
      I must disable inheritance to remove all others permissions like SYSTEM, ADMINISTRATORS, etc. Then only GRANT everyone for READ & EXECUTE only.
      But still the user can go to edit the permissions tho. Any advise?
    • By Htps
      1. How do I make a multiple minimized windows at once believe I am holding down a key for like 5 seconds?
      I know I can send minimized windows a key press with ControlSend.
      What hat would be the way to simulate a 'humanly' held down key to a few minimized windows? 
       
      2. How come: if I compare a handle's hexa value and the actual handler, I get false
      For example: when the Notepad's handler value is 0x00000000000CFFFF, I always get the message box.
       
      if(NOT(0x00000000000C0664 == WinGetHandle("Untitled - Notepad"))) Then MsgBox(0,"swi","0x00000000000CFFFF" & @CRLF & "lmao" & @CRLF & WinGetHandle("Untitled - Notepad")) EndIf  
      Why does that happen? also I can't use hexadecimal value as a handler when I use the ControlSend function.
    • By ur
      When I compiled my script or any script to exe using 32 bit compiler and ran on 32 bit machine, I am getting below error.
       

       
      But it is 32 bit only.
       
      And, for testing, I disabled smart screen also, but same issue.
      Please suggest.
       
×
×
  • Create New...