|
-
Mar 20th, 2002, 11:08 AM
#1
Thread Starter
New Member
problem with SetPriorityClass API
I'm trying to set the priority class for a process, but I keep receiving "Error 49: Bad DLL Calling Convention".
Here's the code I'm using. It works fine except for the last line which gives me the error.
Dim lngRetValStartDoc As Long
Dim pptName As String
Dim appName As String
pptName = "Microsoft PowerPoint - [C-Mac Slides_0503_English]"
'Initialize variables within a data type
With processAtt
.lpSecurityDescriptor = 0
.bInheritHandle = True
.nLength = Len(processAtt)
End With
With threadAtt
.lpSecurityDescriptor = 0
.bInheritHandle = True
.nLength = Len(threadAtt)
End With
appName = "C:\program files\microsoft office\office\powerpnt.exe"
'Create a new process
lngRetValCreateProcess = CreateProcess(appName, vbNullString, processAtt, threadAtt, _
False, CREATE_NO_WINDOW, Null, vbNullString, startUp, processInfo)
lngThreadID = processInfo.dwThreadId
lngProcessID = processInfo.dwProcessId
lngRetValStartDoc = StartDoc("C-Mac Slides_0503_English.ppt")
lngWindowName = FindWindow(vbNullString, pptName)
lngRetValGetPriority = GetPriorityClass(lngWindowName)
lngRetValSetPriority = SetPriorityClass(lngWindowName, NORMAL_PRIORITY_CLASS)
Microsoft Certified Professional
Posting Permissions
- You may not post new threads
- You may not post replies
- You may not post attachments
- You may not edit your posts
-
Forum Rules
|
Click Here to Expand Forum to Full Width
|