[source] My first function

Discussion in 'Programming General' started by sik of it, Nov 10, 2007.

[source] My first function
  1. Unread #1 - Nov 10, 2007 at 8:43 AM
  2. sik of it
    Joined:
    Jan 24, 2006
    Posts:
    8
    Referrals:
    0
    Sythe Gold:
    0

    sik of it Newcomer

    [source] My first function

    Hey everyone I'm pretty new here. Anyways I was playing around on vb.net 2005 earlier and made a new function. In the program I made, what happens is you drag the crosshair onto windows (that means buttons, text boxes and most other controls) and the program returns the hwnd (window handle) of that window and also takes a picture and displays a bitmap. The bitmap's position and size depends on how you set the four textbox properties as follows:

    x: distance in pixels from the left side of the window you select
    y: distance in pixels from the top side of the window you select
    w: the width of the bitmap
    h: the height of the bitmap

    NOTE: I haven't coded this to reject bad values so if you are going to put in incorrect values into the text boxes it is at your own risk.

    I know this little program isn't anything special but for those trying to learn how to make macroes I thought it could be of a little assistance. If there is anything I should do to make the program faster, simpler or better then please reply with what you think, I'm only learning to I would really appreciate it!

    Full source code included in the attachment.
     

    Attached Files:

  3. Unread #2 - Nov 10, 2007 at 9:54 AM
  4. Swan
    Joined:
    Jan 23, 2007
    Posts:
    4,957
    Referrals:
    0
    Sythe Gold:
    0
    Sythe's 10th Anniversary Member of the Month Winner

    Swan When They Cry...
    Retired Global Moderator

    [source] My first function

    methods (functions) are easy :)

    i.e.
    Code:
    Public Sub Write(ByVal text As String) 
        Console.WriteLine(Text)
    End Sub
    
    Public Function retVal() As String
       String value = "Hi! I'm a function!"
       return value
    End Function
    etc.

    Classes are probably a better idea to tackle for you mate ;)
     
  5. Unread #3 - Nov 10, 2007 at 1:34 PM
  6. sik of it
    Joined:
    Jan 24, 2006
    Posts:
    8
    Referrals:
    0
    Sythe Gold:
    0

    sik of it Newcomer

    [source] My first function

    Classes eh? Ok I think I'll go look them up now, thanks a lot swan.
     
< Random colors? | I need help >

Users viewing this thread
1 guest


 
 
Adblock breaks this site