Jump to content

Recommended Posts

Posted

I'm not too familiar with DLL calls, and I'm stuck on GetPriorityClass. I would like to get this working as soon as possible, as one of my programs trys to keep running at normal, but is very slow in that state.

$process = ProcessList('mediaplayer.exe')
MsgBox(0, 'test1', $process[1][1])

$return = DLLCall('kernel32.dll', 'int', 'GetPriorityClass', 'ptr', $process[1][1])
$getlast = DLLCall('kernel32.dll', 'int', 'GetLastError', 'void', '')
MsgBox(0, 'test', $return & ' - ' & @error & @CRLF & $getlast)

Writing AutoIt scripts since

_DateAdd("d", -2, _NowCalcDate())
Posted

Thanks. I'll look into that. I got confused when I read that hwnd was for a window handle...or is that for handles in general?

Writing AutoIt scripts since

_DateAdd("d", -2, _NowCalcDate())
Posted

I get confused with handles too... sometimes they are INT sometimes they are HWND.

here

$PROCESS_QUERY_INFORMATION = 1024

$exe = 'svchost.exe'

$process = ProcessList($exe)
If $process[0][0] = 0 Then Exit

$hwnd = DLLCall('kernel32.dll','hwnd','OpenProcess','int',$PROCESS_QUERY_INFORMATION,'int',0,'int',$process[1][1])

$return = DLLCall('kernel32.dll', 'int', 'GetPriorityClass', 'hwnd', $hwnd[0])

MsgBox(0, $exe, '0x' & Hex($return[0],8))

<{POST_SNAPBACK}>

Oh, thank you so much!! I was about to go about as bald as your avatar :) It was an int. I'll post it in a moment, I just have to make a few consts to tell what priority it is now without having to mess with pure hex :evil:

Writing AutoIt scripts since

_DateAdd("d", -2, _NowCalcDate())

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
  • Recently Browsing   0 members

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