Reply
 
LinkBack Thread Tools Search this Thread Display Modes
  #1   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 2,059
Default How to call GetPriorityClass,GetThreadPriority?

How can I call Get/SetPriorityClass and Get/SetThreadPriority?

At issue is the HANDLE parameter. I had hoped that I might get away
with passing a NULL pointer (ByVal 0), but it didn't work.

Public Declare Function GetPriorityClass Lib "kernel32" (ByRef pHandle
As Long) As Long
Public Declare Function GetThreadPriority Lib "kernel32" (ByRef
tHandle As Long) As Long

Private Sub getProcInfo()
Dim x As Long
x = GetPriorityClass(ByVal 0)
Debug.Print "GetPriorityClass= "; Hex(x)
x = GetThreadPriority(ByVal 0)
Debug.Print "GetThreadPriority= "; Hex(x)
End Sub
  #2   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 1
Default How to call GetPriorityClass,GetThreadPriority?


joeu2004;272545 Wrote:
How can I call Get/SetPriorityClass and Get/SetThreadPriority?

At issue is the HANDLE parameter. I had hoped that I might get away
with passing a NULL pointer (ByVal 0), but it didn't work.

Public Declare Function GetPriorityClass Lib "kernel32" (ByRef pHandle
As Long) As Long
Public Declare Function GetThreadPriority Lib "kernel32" (ByRef
tHandle As Long) As Long

Private Sub getProcInfo()
Dim x As Long
x = GetPriorityClass(ByVal 0)
Debug.Print "GetPriorityClass= "; Hex(x)
x = GetThreadPriority(ByVal 0)
Debug.Print "GetThreadPriority= "; Hex(x)
End Sub


Hello joeu2004,

You have to pass in a valid handle to the function. Null will not
default to the calling thread or class.


--
Leith Ross

Sincerely,
Leith Ross

'The Code Cage' (http://www.thecodecage.com/)
------------------------------------------------------------------------
Leith Ross's Profile: http://www.thecodecage.com/forumz/member.php?userid=75
View this thread: http://www.thecodecage.com/forumz/sh...ad.php?t=75943

  #3   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 2,059
Default How to call GetPriorityClass,GetThreadPriority?

On Mar 16, 11:24*pm, Leith Ross
wrote:
You have to pass in a valid handle to the function.
Null will not default to the calling thread or class.


Okay. Aha! I just discovered GetCurrentProcess() and GetCurrentThread
(). I also realized that I should pass those pseudo-handles by value,
not by reference, to GetPriorityClass() and GetThreadPriority().

With those two fixes, things are working now.

Many thanks!
Reply
Thread Tools Search this Thread
Search this Thread:

Advanced Search
Display Modes

Posting Rules

Smilies are On
[IMG] code is On
HTML code is Off
Trackbacks are On
Pingbacks are On
Refbacks are On


Similar Threads
Thread Thread Starter Forum Replies Last Post
How to call this DLL? Paul Lenz Excel Programming 0 September 9th 07 08:12 PM
I'm not sure what you'd call it, but is it possible to do this? nut_mom Excel Discussion (Misc queries) 3 June 28th 06 06:17 PM
Call Center Management: How to calculate 'cost per call' Denniso6 Excel Discussion (Misc queries) 2 June 25th 06 05:01 PM
Don't know what to call what I need? chanwando Excel Worksheet Functions 5 September 9th 05 10:01 PM
How do you call one Sub from another Sub ? lothario[_30_] Excel Programming 2 October 17th 03 01:47 PM


All times are GMT +1. The time now is 01:19 PM.

Powered by vBulletin® Copyright ©2000 - 2025, Jelsoft Enterprises Ltd.
Copyright ©2004-2025 ExcelBanter.
The comments are property of their posters.
 

About Us

"It's about Microsoft Excel"