Jump to content

error message -API-OpenProcess:Priviliged: Access is denied


ddeerr
 Share

Go to solution Solved by PaulIA,

Recommended Posts

Hi,

I get this message when i try to use __ListView_FindItem function from Auto3Lib.

The strange thing is that i'am administrator of my computer (Win2000)

I saw this thread about a similar problem

http://www.autoitscript.com/forum/index.ph...nied&st=225

but if the priviledge are apply autmatically ? normaly it works ?

;---------------- here i create the list ----------------
;   list file to download
$listSelectFiles = GUICtrlCreateListView("Fichier|Type", 143, 43, 369, 361, -1, $LVS_EX_CHECKBOXES)
_GUICtrlListViewSetColumnWidth($listSelectFiles, 0, 317)


;---------------- here for display window (as usual) ----------------


;----------------here event management ----------------
While 1
    Dim $atat[2]
    $nMsg = GUIGetMsg()
    Switch $nMsg
        Case $ok_btn                      ; the testing button
;     doc for use with my little memory  :king: 
; ====================================================================================================
; Description ..: Searches for an item with the specified characteristics
; Parameters ...: $hWnd         - Handle to the control
;                 $iStart       - Zero based index of the item to begin the search with or -1 to start
;                   from the beginning. The specified item is itself excluded from the search.
;                 $tFindInfo    - tagLVFINDINFO array that contains search information
; Return values : Returns the zero based index of the item if successful, or -1 otherwise
; Author .......: Paul Campbell (PaulIA)
; Notes ........:
; ====================================================================================================
            $atat[1] = "gzip.exe"
            $toto = __ListView_FindItem($listSelectFiles, -1, $atat, "gzip.exe")
            MsgBox(0,"","-" & $toto & "-")
        Case $GUI_EVENT_CLOSE
            Exit
    EndSwitch
WEnd
Link to comment
Share on other sites

Yes, it appears you need system privileges in order to do that. That is what PaulIA is saying at least. System privileges > administrator privileges.

"So man has sown the wind and reaped the world. Perhaps in the next few hours there will no remembrance of the past and no hope for the future that might have been." & _"All the works of man will be consumed in the great fire after which he was created." & _"And if there is a future for man, insensitive as he is, proud and defiant in his pursuit of power, let him resolve to live it lovingly, for he knows well how to do so." & _"Then he may say once more, 'Truly the light is sweet, and what a pleasant thing it is for the eyes to see the sun.'" - The Day the Earth Caught Fire

Link to comment
Share on other sites

Yes, it appears you need system privileges in order to do that. That is what PaulIA is saying at least. System privileges > administrator privileges.

if i understand one the last step is that :

#294220

so normally the rights are add if required or maybe it has not been update regarding the malware probably attak ?

Link to comment
Share on other sites

  • Solution

This has nothing to do with system priviliges at all. Let's run through it by the numbers...

1. All Auto3Lib functions require you to pass the window handle of the control, not the AutoIt controlID. This is stated in the header of every Auto3Lib function.

2. The header for __ListView_FindItem states that the 3rd parameter is a _tagLVFINDINFO structure and you're passing an array.

3. What you should have called is _ListView_FindText, which is used to retrieve the text from a ListView item.

4. You did not post a complete piece of code that I could run to find your problem.

5. You should post all Auto3Lib questions in the Auto3Lib thread so that I don't have to search the entire forum every day.

Here is what your code should look like:

#include <A3LListView.au3>
#include <GUIConstants.au3>
#include <GUIListView.au3>

Global $hGUI, $iList, $iBtn, $hList, $iIndex, $iMsg

$hGUI  = GUICreate("Test", 400, 300)
$iList = GUICtrlCreateListView("Fichier|Type", 2, 2, 396, 260, -1, $LVS_EX_CHECKBOXES)
$iBtn  = GUICtrlCreateButton("OK", 165, 270, 75, 25)
_GUICtrlListViewSetColumnWidth($iList, 0, 317)
$hList = GUICtrlGetHandle($iList)
GUISetState()

_GUICtrlListViewInsertItem($iList, 0, "Item 1")
_GUICtrlListViewInsertItem($iList, 1, "gzip.exe")

While 1
  $iMsg = GUIGetMsg()
  Switch $iMsg
    Case $iBtn
      $iIndex = _ListView_FindText($hList, "gzip.exe")
      MsgBox(0,"","-" & $iIndex & "-")
    Case $GUI_EVENT_CLOSE
      Exit
  EndSwitch
WEnd
Auto3Lib: A library of over 1200 functions for AutoIt
Link to comment
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
 Share

  • Recently Browsing   0 members

    • No registered users viewing this page.
×
×
  • Create New...