Threadssss

galdasc

Erfahrenes Mitglied
Hi

ihr jennt ja sicherlich die API (selbsterklärend):
Declare Function SetThreadPriority Lib "kernel32" Alias "SetThreadPriority" (ByVal hThread As Long, ByVal nPriority As Long) As Long

frage: woher bekomme ich hThread ??(wichtig)
grund: ich möcht von verschiedenen anderen gerade laufenden Threads die Priörität ändern(^^), nicht aber von dem "eigenen".
 
hab momentan hier nicht vb droben
und auch kein api viewer


aber wenn mich nicht alles täuscht wird es eine
GetThreadPriority()
weis aber jetzt nicht genau was die dir zurückgibt
schau einfach in deiner api nach
Get....

warscheinlich musst du wie wenn du den hwnd wisse willst
fenster und klassen namen angeben und er gibt dir den hthread
 
hilft dir vielleicht die funktion GetCurrentThread weiter? steht zwar nicht in der visual basic-referenz, aber vielleicht bringt's dich ja erstmal etwas weiter:

GetCurrentThread

This function returns a pseudohandle for the current thread.

At a Glance

Header file: Kfuncs.h
Versions: 1.0 and later


Syntax:
HANDLE GetCurrentThread(void);


Return Values
A pseudohandle for the current thread indicates success.

Remarks

A pseudohandle is a special constant that is interpreted as the current thread handle. The calling thread can use this handle to specify itself whenever a thread handle is required. Pseudohandles are not inherited by child processes.

This handle has the maximum possible access to the thread object. For systems that support security descriptors, this is the maximum access allowed by the security descriptor for the calling process. For systems that do not support security descriptors, this is THREAD_ALL_ACCESS.

The function cannot be used by one thread to create a handle that can be used by other threads to refer to the first thread. The handle is always interpreted as referring to the thread that is using it. A thread can create a “real” handle to itself that can be used by other threads, or inherited by other processes, by specifying the pseudohandle as the source handle in a call to the DuplicateHandle function.

The pseudohandle need not be closed when it is no longer needed. Calling the CloseHandle function with this handle has no effect. If the pseudohandle is duplicated by DuplicateHandle, the duplicate handle must be closed.
 
thx

@flashgod: ich hab die ganzen APIs in APIviewer durchgewälzt, aber nichts wirklich brauchbares gefunden.

@asphyxia: die API kenn ich schon, die hilft mir halt eben nicht wirklich weiter, weil ich ja von ANDEREN als von meinem eigenen Thread das handle wissen will.

Was ist eigentlich GENAU ein thread, ich hab nur eine verwaschene vorstellung davon.^^

und was bitte soll diese API bedeuten (bzw. was bedeutet das "token"?):

Declare Function OpenThreadToken Lib "Advapi32" (ByVal ThreadHandle As Long, ByVal DesiredAccess As Long, ByVal OpenAsSelf As Long, TokenHandle As Long) As Long

thx
thx

-/cu\-
 
Zurück