amvx86 15 Newbie Poster

Hello Everyone,

I'm trying to create / edit a binary value within the windows registry so far I have this:

  Dim data As Byte() = New Byte() {&H48, 96}
        Microsoft.Win32.Registry.SetValue("hkey_local_machine\hardware\description\system\bios", "SystemProductName2", data, Microsoft.Win32.RegistryValueKind.Binary)

However, I want to set a product name say "Acer Stuff" to the registry and what is happening it will not print the characters. I'm getting numbers. Any suggestions? I've searched for a few hours to get this done and I'm having a difficult time. Any help would be greatly appreciated.

Thanks.

amvx86 15 Newbie Poster

@rproffitt,

Oh trust me I know. The reason why I'm going back to these days of coding is because we are seeing an uptick in malware written in these languages. Moreso VC++ 6.0, VB5-6. I'm pulling some old malware samples I've written and turning them into learning tools so that I can deliver what others need to pull regarding IOC's

vb5-6 I have a lot of code to fall back on. VC++ 6.0 wasn't my strong suit so that's why I posted the question.

In all actuality I still have my MSDN 6.0 still on my RAID. I have the environment installed in a VM for this purpose. PSC has been a good resource too. -=]

amvx86 15 Newbie Poster

@nullptr,

I will have to modify this code to make it so that it runs every 500ms and check for a handful of windows. I'm using this for a specific training where I work and I need to provide different instances for our employees to think outside the box to solve certain issues that may arise. I need to see how well to get this to fit into what we are looking to accomplish as I've already planned out the VB6, vb 2010/2015 portions.

A better question would also be if you wouldn't mind do you nkow of any tutorials or books from the 9X days (VC++ 6.0) that I might be able to reference as well? I used to have a lot of resources but stopped coding for a while.

Thanks.

amvx86 15 Newbie Poster

Hey everyone,

I'm looking to add a block / function within a C++ application that will search for open windows. For instance, wordpad and notepad. If either are open perform an action. I'm doing this within win32 API but my question is this.

If I create something as such, this has to be on a thread. (I come from a VB background) and we had timers. What would be the best way to implement a timer in C++? I was thinking a do loop on a thread that checks for certain things, but would this be too memory / cpu intensive?

I'd appreciate any and all advice.

Thank you.

amvx86 15 Newbie Poster

Thank you for the information. I have completed what needs to be done. I've fixed the code. THANK YOU!! -=]

diafol commented: Good stuff :) +15
amvx86 15 Newbie Poster

Diafol,

If I try your suggestion, it returns: 

Send us junk at: and it's blank. It I try it with the <?php $colMail ?> it also does the same thing. Suggestions? 

./anthony

EDIT:
Okay I think I see what is going on. I have to put the PHP code FIRST and then, add the HTML to the bottom of the page as shown: 

<?php $colMail = "this"; ?>
<a href=" <?=$colMail?> "><?=$colMail?></a>
amvx86 15 Newbie Poster

Stefan & Diafol,

Word, I will check this and re-do the code and post it back as best as possible. The mailto was a test to see if it worked (which it does), the picture map is where I'm having the issue. Give me a bit and I will see to repost. Thanks again -=]

./anthony

amvx86 15 Newbie Poster

For some reason, wouldn't let me post code, so lets try again.

This is the code I'm working with. I'm trying to get the e-mail address into the html code, but it will not do so. I can retrieve the variable from the function but it does not show up in the link. Any suggestions?

    echo "<a href='php_click.php?add=car'>Add Car</a>";

   if (isset($_GET['adID'])){
                    echo "Received information <br>";
                    //RUN A FUNCTION HERE TO SEE IF REGEX PICKS UP AN EMAIL
                    $plainEmail = $_GET['adID'];
                    loadad($_GET['adID']);
                    checkMail($_GET['adID']) . "<br>";

            } else {
                    echo "Is not a mailing list user.<br>";
            }

    function loadad($colMail){
    echo "<b>Email address: " . $colMail . "<br><br><br></b>";
    echo "<a href='mailto:" . $colMail . "'>" . $colMail . "</a>";
    echo "<p align='center'> <img id='Image-Maps-Com-image-maps-2016-11-29-212437' src='http://www.image-maps.com/m/private/0/94sm55oguavokhp2albcqok1c1_compad.jpg' border='0' width='1200' height='900' orgWidth='1200' orgHeight='900' usemap=
    '#image-maps-2016-11-29-212437' alt='' /> <map name='image-maps-2016-11-29-212437' id='ImageMapsCom-image-maps-2016-11-29-212437'> <area id='link1' alt='' title='link1' name='link1' href='php_click.php?add=nds1&adID='".$colMail." shape='rect' coords='86,181,329,629' style='outline:none;' target='_self'     /> <area id='link2' alt='' title='link2' name='link2' href='php_click.php?add=greenday&adID='" . $colMail . " shape='rect' coords='336,171,579,619' style='outline:none;' target='_self'     /> <area  alt='' title='link3' name='link3' href='php_click.php?add=bluemonday' shape='rect' coords='573,166,816,614' style='outline:none;' target='_self'     /> <area  alt=''  title='link4' name='link4' href='php_click.php?add=silversurfer'" . $colMail ." shape='rect' coords='813,181,1113,629' style='outline:none;' target='_self'     /> <area shape='rect' coords='1198,898,1200,900' alt='Image Map' style='outline:none;' title='Image Map' href='http://www.image-maps.com/index.php?aff=mapped_users_0' /> </map>";

    }
amvx86 15 Newbie Poster

post

amvx86 15 Newbie Poster

Good Morning,

For the last few weeks I've been searching HIGH AND LOW. All forms, dozens of tabs open, and bought about 200 bucks in books. My goal is to learn the windows win32 API and I'm hitting brick walls everywhere I look. So far, I've learned that findwindow (or calls from user32.dll) can be accessed from winuser.h and I'm having a DIFFICULT TIME learning how to get around with the API calls. I'm okay with VB6 / VB 2010 but this, I want to rip my eyes out, freeze them put them in a sock and beat microsoft employees to death with them. I've played with code such as: 



#include <stdio.h>
#include <stdlib.h>
#include <windows.h>
#include <winuser.h>

int main()
{
    HWND hWnd;
    hWnd = FindWindow("CalcFrame", NULL);

    if ( hWnd != 1)
    {
        printf("Window is closed\n"); 
    } else {
        printf("The window is open!\n"); 
    }

    return 0; 
    }


However, NOTHING is working! Maybe there is a resource online for C API calls in windows? Maybe there is a book? Please I need something. I should also mention that **I AM NOT** using .NET. and I'm using Dev-C++ and NetBeans (which I'm leaning more towards NetBeans). Someone, PLEASE HELP!!! 

Thank you, 

amvx86.
amvx86 15 Newbie Poster

Nutster,

Thank you for pointing that out. I'll check it out when I have a chance. I appreciate all your help. I will let you know what happens when I test it.

Thank you again!

amvx86 15 Newbie Poster

Nutster,

The issue I'm having is that I'm trying to point the drives that I found to the drive function to get the size, but if I do something like this: 

char DRIVE_TYPE[1]; 

GetDiskSpace("%ls", LogicalDrives); 


I can't do it, I get this: 89 passing arg 1 of `GetDriveFree' from incompatible pointer type. Any suggestions? 

Thank you
amvx86 15 Newbie Poster

Ladies and Gentlemen Coders,

I'm working with the code below:

    int GetDrives(void)
    {
        wchar_t LogicalDrives[MAX_PATH] = {0}; 
        DWORD r = GetLogicalDriveStringsW(MAX_PATH, LogicalDrives); 
        if ( r == 0 )
        {
             printf("Failed to get drive names. %ld", GetLastError()); 
             return 1; 
             }
             int NumDriveCount = 0;         
         if ( r > 0 && r <= MAX_PATH) 
         {
              wchar_t *SingleDrive = LogicalDrives; 
              while(*SingleDrive){
                                  printf("Local Drives: %s Drive Size: %ls", SingleDrive, ); 
                                  SingleDrive += wcslen(SingleDrive) +1; 
                                  NumDriveCount++;
                                  }    
                                  }
              printf("Total Drives: %i\n", NumDriveCount); 
    }

    #pragma comment(lib, "user32.lib")
    char DRIVE_TYPE[1]; 

    int GetDriveFree(char *DRIVE[])
    {
    //int GetDriveFree(void) {


        unsigned __int64 freeCall,
                         total,
                         free;

        int r = GetDiskFreeSpaceExW(L"C:\\", (PULARGE_INTEGER) &freeCall,
            (PULARGE_INTEGER) &total, (PULARGE_INTEGER) &free);

        if (r == 0) {

            wprintf(L"Failed to get free disk space %ld", GetLastError());
            return 1;
        }   

        wprintf(L"Available space to caller: %I64u MB\n", freeCall / (1024*1024));
        wprintf(L"Total space: %I64u MB\n", total / (1024*1024));
        wprintf(L"Free space on drive: %I64u MB\n", free / (1024*1024));

        return 0;
    }

And as you can see on line:

printf("Local Drives: %s Drive Size: %ls", SingleDrive, ); 
                              SingleDrive += wcslen(SingleDrive) +1; 
                              NumDriveCount++;



                          I have tried running 



  //ALSO LINK THIS TO FREE SPACE
                              //GetDriveFree(LogicalDrives); 
                              printf("This is the drive: %s\n", LogicalDrives); 
                              //GetDriveFree(LogicalDrives);
                              printf("This is a drive test %s\n", LogicalDrives); 
                              LogicalDrives = DRIVE_TYPE;
                              SingleDrive += wcslen(SingleDrive) +1; 



                          And, for some reason I can't for the life of me get this to work. I am beginning in C and have burned through 3 books in the last few days. Can someone maybe explain as to why this does not work? The rest of the code …
amvx86 15 Newbie Poster

Hey what's up everyone?

I'm about 3 days into hitting an extreme amount of brick walls and I'm about punch drunk. Currently I've spent 4 hours on this alone and I'm still not getting anywhere. Does anyone have some code samples that I might be able to use to put a translator together that calls on bing and or google? I've messed with some code examples, and most of them are in C# which I'm not coding in.

For Bing I have messed with this code:

           Dim BingKey = My.Computer.Registry.GetValue("hkey_local_machine\Software\Bing\Keys", "Bing", Nothing)
            Dim strTranslatedText As String = Nothing
            Try

                Dim client As New BingLang.LanguageServiceClient()
                client = New BingLang.LanguageServiceClient()

                strTranslatedText = client.Translate("AppID", RichTextBox1.Text, "de", "en")
                RichTextBox2.Text = strTranslatedText
            Catch ex As Exception
                MessageBox.Show(ex.Message)
            End Try

which does not work (yes all the imports as well as the api references have been set.) I have found other code samples such as:

        Dim clientID As String = "AppID"
        Dim clientSecret As String = "KEY_CODE_HERE"
        Dim strTranslatorAccessURI As String = "https://website.com"
        Dim strRequestDetails As String = String.Format("grant_type=client_credentials&client_id={0}&client_secret={1}&scope=http://api.microsofttranslator.com", HttpUtility.UrlEncode(clientID), HttpUtility.UrlEncode(clientSecret))


        Dim webRequest As System.Net.WebRequest = System.Net.WebRequest.Create(strTranslatorAccessURI)
        webRequest.ContentType = "application/x-www-form-urlencoded"
        webRequest.Method = "POST"
        Dim bytes() As Byte = System.Text.Encoding.ASCII.GetBytes(strRequestDetails)
        webRequest.ContentLength = bytes.Length


        Using outputStream As System.IO.Stream = webRequest.GetRequestStream()
            outputStream.Write(bytes, 0, bytes.Length)
        End Using
        Dim webResponse As System.Net.WebResponse = webRequest.GetResponse()
        ' Make sure you add a reference to System.Runtime.Serialization here
        Dim AdmToken As New AdmAccessToken
        Dim serializer As System.Runtime.Serialization.Json.DataContractJsonSerializer = New System.Runtime.Serialization.Json.DataContractJsonSerializer(AdmToken.GetType())
        Dim token As AdmAccessToken = serializer.ReadObject(webResponse.GetResponseStream()) …
amvx86 15 Newbie Poster

Dude, I wasn't expecting all this. I greatly appreciate what you've done here. I'm going to mess with this and incorporate it... In time to come I might PM you regarding something related to the project that I am working on -=]

amvx86 15 Newbie Poster

No suggestions?

amvx86 15 Newbie Poster

Here is some of the code I converted, but I still lack the know how to make it functional. Any suggestions?

    Structure UUID
        Public Data1 As Long
        Public Data2 As Integer
        Public Data3 As Integer
        Public data4() As Long
        'Data4(0 to 7) As Byte
    End Structure
    Structure typWindows
        Public ClassName As String
        Public hWnd As Long
    End Structure
    Structure typWinFinal
        Public ChildWindows() As typWindows
        Public Count As Integer
    End Structure
    Structure YIMType
        Public Text As String
        Public HTML As String
    End Structure
    Public Const c_ChatStyle As String = "<STYLE>" & vbCrLf & _
                                                ".sendername { font-size:10pt;font-family:Arial;font-weight:bold;color:#000000;text-decoration:none };" & vbCrLf & _
                                                ".recvername { font-size:10pt;font-family:Arial;font-weight:bold;color:#0000FF;text-decoration:none };" & vbCrLf & _
                                                ".ymsgrname { font-size:10pt;font-family:Arial;font-weight:bold;color:#FF0000;text-decoration:none };" & vbCrLf & _
                                                ".chatusername { font-size:10pt;font-family:Arial;color:#FF0000;text-decoration:none };" & vbCrLf & _
                                                ".usertext { font-size:10pt;font-family:Arial; };" & vbCrLf & _
                                                ".redstatus { font-size:10pt;font-family:Arial;font-weight:bold;color:#FF0000;text-decoration:none };" & vbCrLf & _
                                                ".greenstatus { font-size:10pt;font-family:Arial;font-weight:bold;color:#008800;text-decoration:none };" & vbCrLf & _
                                                ".graystatus { font-size:10pt;font-family:Arial;font-weight:bold;color:#888888;text-decoration:none };" & vbCrLf & _
                                                ".chatrecver { font-size:10pt;font-family:Arial;font-weight:bold;color:#880000;text-decoration:none };" & vbCrLf & _
                                                ".chatsender { font-size:10pt;font-family:Arial;font-weight:bold;color:#0000FF;text-decoration:none };" & vbCrLf & _
                                                ".chataction { font-size:10pt;font-family;Arial;color:#880088;text-decoration:none };" & vbCrLf & _
                                                "a { color:#0000FF; };" & vbCrLf & _
                                                "p { text-indent:-7;margin-left:10;margin-top:0;margin-bottom:0 };" & vbCrLf & _
                                                "</STYLE>"
    Public Const c_PMStyle As String = "<STYLE>" & vbCrLf & _
                                                    ".sendername { font-size:10pt;font-family:Arial;font-weight:bold;color:#000000; }" & vbCrLf & _
                                                    ".recvername { font-size:10pt;font-family:Arial;font-weight:bold;color:#0000FF; }" & vbCrLf & _
                                                    ".ymsgrname { font-size:10pt;font-family:Arial;font-weight:bold;color:#FF0000; }" & vbCrLf & _
                                                    ".usertext { font-size:10pt;font-family:Arial; }" & vbCrLf & _
                                                    ".redstatus { font-size:10pt;font-family:Arial;font-weight:bold;color:#FF0000; }" & vbCrLf & …
amvx86 15 Newbie Poster

This is the old bas / module that I used in VB6...

Private Declare Function FindWindow Lib "user32" Alias "FindWindowA" (ByVal lpClassName As String, ByVal lpWindowName As String) As Long
Private Declare Function FindWindowEx Lib "user32" Alias "FindWindowExA" (ByVal hWnd1 As Long, ByVal hWnd2 As Long, ByVal lpsz1 As String, ByVal lpsz2 As String) As Long
Private Declare Function RegisterWindowMessage Lib "user32" Alias "RegisterWindowMessageA" (ByVal lpString As String) As Long
Private Declare Function SendMessageTimeout Lib "user32" Alias "SendMessageTimeoutA" (ByVal hWnd As Long, ByVal msg As Long, ByVal wParam As Long, lParam As Any, ByVal fuFlags As Long, ByVal uTimeout As Long, lpdwResult As Long) As Long
Private Declare Function ObjectFromLresult Lib "oleacc" (ByVal lResult As Long, riid As UUID, ByVal wParam As Long, ppvObject As Any) As Long
Private Const SMTO_ABORTIFHUNG = &H2
Private Type UUID
   Data1                            As Long
   Data2                            As Integer
   Data3                            As Integer
   Data4(0 To 7)                    As Byte
End Type
Public Type YIMType
    Text                            As String
    HTML                            As String
End Type
Public Function GetIMText() As YIMType
    Dim IMClass                     As Long
    Dim MidWin                      As Long
    Dim InternetExplorerServer      As Long
    'Loop through all the windows finding their handles from predefined classnames.
    IMClass = FindWindow("imclass", vbNullString)
    MidWin = FindWindowEx(IMClass, 0&, "ATL:004EFB68", vbNullString)
    'Loop through all the windows finding their handles from predefined classnames.
    If MidWin = 0 Then
        MidWin = FindWindowEx(IMClass, 0&, "ATL:004F0BA8", vbNullString)
        If MidWin = 0 Then
            MidWin = FindWindowEx(IMClass, 0&, "ATL:004EEB68", vbNullString)
            If MidWin = 0 Then MidWin = FindWindowEx(IMClass, 0&, "ATL:004EBB50", vbNullString)
        End If
        'If you …
amvx86 15 Newbie Poster

The code is an old module, I think I have it worked out, so I might post original code first, my modded code, and questions on what I'm looking to achieve if possible? I remember you helping me a long time ago about putting the cart before the horse -- dude, i've come a long way and I appreciate the help :-) I'll post in a hot minute.

amvx86 15 Newbie Poster

I have an old API from a bas file, and I'm trying to convert it. I think I'm on the right track however, I keep running into some problems with it. I can post the old one, and the new one, with the edits that I've made. Is there anyone who would be able to assist me? I don't want someone to re-write the bas or module for me -- I'd like some pointers on where i'm going wrong, and where i've gone wrong and waht to change. Or, is this too much to ask for? I don't want to seem like I'm doing it for homework and want someone to help me -- I think I'm well passed the age of homework :-X lol

./amvx86

amvx86 15 Newbie Poster

Not so much, but what I am looking for is an API spy. Better yet, is there a way to do this in or with pinvoke?

Child& = FindWindow("#32770", vbNullString)
Button& = FindWindowEx(Child&, 0&, "Button", vbNullString)
For i& = 1& To 2&
    Button& = FindWindowEx(Child&, Button&, "Button", vbNullString)
Next i&

Is there a method that I can use this in pinvoke to find a button? And, use a gettext call to determine which caption I am over?

amvx86 15 Newbie Poster

Hello everyone,

So I have a quick question. Back when there was something written by BoFen and it was called codegenie and I have a copy of it and i've been using it with some success. What I'd like to know is are there any good api spies that generate information like this:

ShellTrayWnd& = FindWindow("Shell_TrayWnd", vbNullString)
Button& = FindWindowEx(ShellTrayWnd&, 0&, "Button", vbNullString)

because I'm not too sure, how you could determine the buttons. For instance.

The run dialog, it has 3 buttons. OK, CANCEL and Browse. If i'm dealing with multiple buttons, lets say 7 buttons as follows:

OK, CANCEL, BROWSE, PING, OPEN, CLOSE, EXIT

how can I single out one specific button? For instance: Only targeting PING button, how would I be able to do so?

./x86

amvx86 15 Newbie Poster

lol I changed the passwords for safety but it doesn't matter as the server is in-house and once the server is worked on it will have these defaults changed. When I try to connect through telnet I get some funky errors. When I go through phpmyadmin it connects just fine. Any suggestions?

amvx86 15 Newbie Poster

Hello everyone,

I'm writing up a new application that instead of using microsoft as a server, I'm using a linux server with a database in it. The database was setup, the tables were set up, and access was granted in mysql. The issue I'm having is that I keep getting an error message with error 25 stating that "A network related or instance specific error occurred." then it goes down to say error -25 connection string is not valid. This is the connection method that I am utilizing:

        On Error GoTo errorhandler

        Dim con As New SqlClient.SqlConnection("server=192.168.0.23:3306; database=test; user ID=root;Password=password;Integrated Security=true;")
        Dim cmd As SqlCommand
        cmd = New SqlCommand("SELECT * FROM students", con)
        Dim da As SqlDataAdapter
        Dim ds As DataSet
        da = New SqlDataAdapter(cmd)
        ds = New DataSet
        da.Fill(ds, "students")

        MsgBox(ds)

        con.Open()
        DataGridView1.DataSource = ds.Tables("students").DefaultView
        con.Close()

        Exit Sub
errorhandler:
        MsgBox(Err.Description, vbExclamation)

Does anyone have an idea as to why this is not working? Or, how to get this working? I would greatly appreciate it.

amvx86 15 Newbie Poster

Hey what's up everyone? I have a script here that works when i execute it from command line, and when I double-click it. Now, there is something interesting going on here.

1) When the program is executed by process.start it does not load (even when called from cmd.exe /c ...)
2) When the program is executed with system.diagnostics... it loads but does not supply ANY output.
3) Created a terminal program for vb console; it gets executed and then it executes the file... no output.

When you physically click on the exe files I created and they in turn shell the application and you magically have output. But, when the main program calls the script it can turn blue before output comes out.

I do not want to use ironpython. My question is... how can I get this application to produce output?! I've been at it since 730 AM EST. Leave it to microsoft to scew up something simple!

./amvx86

amvx86 15 Newbie Poster

OKay I got it working, you have to add this:

                Do Until WebBrowser1.ReadyState = WebBrowserReadyState.Complete
                    Application.DoEvents()
                Loop

before you can crawl the site. Sorry for the post.

amvx86 15 Newbie Poster

Tinstaafl,

I'm using it as is as one normally would. webbrowser1.navigate(website) and then once it navigates then we call the crawl. I should actually attempt to wait for the page to load and try that again. Let me see how this works and I will get back to you. I may have answered my own question.

amvx86 15 Newbie Poster

Hello everyone,

Maybe someone out there can help me. I have this code that I am using and for the life of me it keeps throwing an error:

        If Len(ComboBox1.Text) < 1 Then
            MsgBox("You need to specify a target for this to operate properly.", vbExclamation, "Error")
            Exit Sub
        End If

        GetCleanURL()

        WebBrowser1.Navigate(Server_Addy_RAW)



        Dim links As HtmlElementCollection = WebBrowser1.Document.Links
        For Each link As HtmlElement In links
            Linkbox.Items.Add(link.GetAttribute("href"))
        Next

the point of the code is to navigate to a web site and then pull the links and add them to a list box. When that is done it keeps crawling the web location. However, the error I keep getting is this:

Object reference not set to an instance of an object. and to use the new keyword. When I remove the webbrowser1.navigate it will bomb unless the web browser control navigates to the page befre and then the crawler is invoked. Any ideas?

./x86

amvx86 15 Newbie Poster

Rock the show. Thanks for the reply I will search on how to make this a reality. -=]

amvx86 15 Newbie Poster

This may sound like a crazy request. However, anyone from the vb 6.0 days will know what I'm talking about. Remember how the editor had the +/- signs that you can hide the code but it would be as follows:

public sub this ()
End sub

and clicking the + would do this:

Public Sub this ()
...
...
...
end sub

Is there a way to do this in the richtextbox control? Or, is there a different control that needs to be used?

./x86

amvx86 15 Newbie Poster

I sample code from old projects of mine, and that was a delay like no other. The code I'm dealing with is as follows:

    `Dim WINDOW& = FindWindow("#32770", "2323234124312")`

//THE REASON WHY YOU SEE THE 232323232... IS BECAUSE IT IS SAYING THAT THE WINDOWS IS OPEN

what I'm really looking for however, is a specific window that is a message box, but it keeps saying the window is open when I know for fact it is not. I tried to use another piece of code however, that has failed and left me frustrated.

I have also tried to access this code:

        Private Declare Function GetWindowText Lib "user32" Alias "GetWindowTextA" (ByVal hwnd As Long, ByVal lpString As String, ByVal cch As Long) As Long
Private Declare Function GetWindowTextLength Lib "user32" Alias "GetWindowTextLengthA" (ByVal hwnd As Long) As Long

with the old vb 6 version:

     Public Function GetText(ByVal hwnd As Long) As String

    ' This function will return the text from a hWnd.  The following
    ' example will return the text from the chatroom.

    ' RICHCNTL& = FindWindowEx(FindChatWnd(), 0&, "RICHCNTL", vbNullString)
    ' ChatText$ = GetText(RICHCNTL&)

    Dim TextLen As Long, hWndTxt As String
    TextLen& = SendMessage(hwnd&, WM_GETTEXTLENGTH, 0&, vbNullString)
    hWndTxt$ = (TextLen&)
    Call SendMessageByString(hwnd&, WM_GETTEXT, TextLen& + 1&, hWndTxt$)
    GetText$ = hWndTxt$
End Function

Public Declare Function SendMessageByString Lib "user32" Alias "SendMessageA" (ByVal hwnd As Long, ByVal wMsg As Long, ByVal wParam As Long, ByVal lParam As String) As Long
Public Const WM_GETTEXT = &HD …
amvx86 15 Newbie Poster

This is a useful resource, however, is it possible to find a resource, or is there one that shows you what each library does? Mind you I have not programmed in approximately 5 years, or better since .net took off. So most of this stuff is a bit blurry to me. I remember there was something (like the new pinvoke trace) that gave you examples, and the code that you can plug in. For instance, say user32.dll it will have say findwindow, findwindowex, etc. Then it would give you how to make the call and how to reference it. Is there anything online or a binary that does this?

amvx86 15 Newbie Poster

Sorry about the delay. No this is my application that I'm writing. I'm sampling code from other people because I am a little lost in .net 4.0 in vb 2010. I will post the information when I can get to the computer I am working on the code. Hang tight, and I appreciate the help.

amvx86 15 Newbie Poster

I have tried the MSDN but for some reason it never seems to work for me. The older MSDN was well documented and put together. I come from a pretty sound vb 6 background and could have designed anything in that language. But the API calls are confusing as hell. I do understand a good majority of the api calls from VB6. But I am just lost. Do you have any tutorials? I'm kinda skeptical when I search for code I rarely find things that I'm looking for, just like getwindowtext it returns everything but what I'm looking for. I remember when I needed apis i would search and in a few minutes I'd have what I needed. Or, more so, I found the great resource of planet source code, and even that, too has been in the decline. I'm getting desperate for answers and I don't like bugging people for help.

amvx86 15 Newbie Poster

Hey everyone,

I hate posting in forums asking people for help, and then searching for hours and wanting to throw my computer out the window because I can never seem to find the resources I need for programming. I feel that in vb 6 everything was well documented and now here in 2010 it's harsh and nothing is well documented. Can anyone suggest books on win32 api programming? Or, any books on vb 2010 API programming at all? I would appreciate it more than being answered in the forms and posting every time I have a problem.

Regards,
amvx86

amvx86 15 Newbie Poster

I need some help with this one. i have a few code samples I have found on the internet, however, when I attempt to use them I get errors, and nothing really works. What I'm trying to do is get the text of a message box, and the contents of the message. Can anyone please help with sample code? I would appreciate it.

./amvx86

amvx86 15 Newbie Poster

Rock on. I appreciate it. The code works well. I also appreciate the resource.

amvx86 15 Newbie Poster

Reverend Jim,

This is very close to what I'm trying to do. I have been at it for a while trying to mod the code to get it to get the values. Do you think you can help me with this portion? What I'm looking to do is obtain the string value of a key. And, if you can... Do you know any good books that reference the win32 api in vb.net 2010?

./x86

amvx86 15 Newbie Poster

tinstaafl,

I know how to read and write to the registry. I'm lost as to how to create the loop needed to iterate through the keys. Do you have any information on this?

amvx86 15 Newbie Poster

Hello all,

I am trying to get a bunch of sub-keys and values from the registry in vb 2010 and i remember in vb6 this was quite easy. Can anyone share code to help? Or a link where I can go? I've been searching for nearly 8 hours on line and can't find anything I can use. The microsoft sites don't really help and most of the articles I find are for vb 7, or vb 6. Any help would be appreciated.

./x86

amvx86 15 Newbie Poster

Hello all,

I've built a program which will take users data from the command line using int main (int argc, char *argv[]). However, when i wrote the program; i can successfully extract the options specified --php --html, etc. What i'm having a hard time with is writing the program to accept a parameter such as -t:website.com the only return parameter i'm returning is: -t: is there any way to get the -t: and break off the -t: and only return website.com? Any help would be great.

Thank you.