Jump to content
  • Advertisement


This topic is now archived and is closed to further replies.


Parameters to a thread (Visual Basic)

This topic is 5637 days old which is more than the 365 day threshold we allow for new replies. Please post a new topic.

If you intended to correct an error in the post then please contact us.

Recommended Posts

Ive searched this on the web and read many times that it is impossible. Tho, I have seen this working before, so Im 100% sure it''s possible. (In visual basic) I wanna call an api function without declaring it first. This is what I have so far: Private Declare Function LoadLibrary Lib "kernel32" Alias "LoadLibraryA" (ByVal lpLibFileName As String) As Long Private Declare Function GetProcAddress Lib "kernel32" (ByVal hModule As Long, ByVal lpProcName As String) As Long Private Declare Function FreeLibrary Lib "kernel32" (ByVal hLibModule As Long) As Long Private Declare Function CreateThread Lib "kernel32" (lpThreadAttributes As Any, ByVal dwStackSize As Long, lpStartAddress As Long, lpParameter As Any, ByVal dwCreationFlags As Long, lpThreadId As Long) As Long Private Sub Form_Load() Dim lib As Long Dim procaddr As Long Dim ThreadID As Long ''Load the library lib = LoadLibrary("kernel32") If lib <> 0 Then ''Get the proc address procaddr = GetProcAddress(lib, "Beep") ''Free the library FreeLibrary lib ''If i got the proc address, execute it If procaddr <> 0 Then CreateThread ByVal 0, 0, ByVal procaddr, 0, 0, ThreadID End If End If End Sub This way, Beep gets executed fine. Now only I wanna pass the parameters 1000 and 1000 to it. How can I do this? The one time I saw it it was alot of very strange code (Some hex I think, so probably assembly instructions). So how do I pass 1000 and 1000 to it? 10x, H4ck3r

Share this post

Link to post
Share on other sites

  • Advertisement

Important Information

By using GameDev.net, you agree to our community Guidelines, Terms of Use, and Privacy Policy.

We are the game development community.

Whether you are an indie, hobbyist, AAA developer, or just trying to learn, GameDev.net is the place for you to learn, share, and connect with the games industry. Learn more About Us or sign up!

Sign me up!