Results 1 to 7 of 7

Thread: GetWindowRect in VB.net?

  1. #1

    Thread Starter
    Addicted Member
    Join Date
    Jun 2004
    Location
    USA
    Posts
    172

    GetWindowRect in VB.net?

    I'm trying to use getwindowrect and it keeps getting errors.. Is there something that is equivelent to that in VB.net so I don't have to declare APIs.. Thanks

    -Jake

  2. #2
    Sleep mode
    Join Date
    Aug 2002
    Location
    RUH
    Posts
    8,083

  3. #3

    Thread Starter
    Addicted Member
    Join Date
    Jun 2004
    Location
    USA
    Posts
    172

    Re: GetWindowRect in VB.net?

    I already looked there hehe.. It doesn't have anything for vb.net except it says System.Windows.Forms.Form.DesktopLocation; System.Windows.Forms.Form.Size, but thats for actual forms in your project.

  4. #4
    Sleep mode
    Join Date
    Aug 2002
    Location
    RUH
    Posts
    8,083
    What error are you getting when using the API call ? as a general API translation , change every Long type to Integer . And DesktopLocation method is the pure .NET way .

  5. #5

    Thread Starter
    Addicted Member
    Join Date
    Jun 2004
    Location
    USA
    Posts
    172

    Re: GetWindowRect in VB.net?

    I figured it out. I had to use Dim R as New RECT() instead of Dim R as RECT. Can you explain why this is? Why are longs different now? I figured out all that. I figured out for findwindow that you can't use vbNullString, you have to declare either class or name as integer and pass it as 0 when you call it.. What other wierd changes are like this? Thanks

  6. #6

    Thread Starter
    Addicted Member
    Join Date
    Jun 2004
    Location
    USA
    Posts
    172

    Re: GetWindowRect in VB.net?

    Oh yeah also, does the DesktopLocation thing work with windows that aren't Forms in your .net project? Like say there was a solitare window or something, and it's handle was 1234567. Could you get the left, right, top and bottom of that window with .NET?

  7. #7
    Super Moderator Shaggy Hiker's Avatar
    Join Date
    Aug 2002
    Location
    Idaho
    Posts
    40,106

    Re: GetWindowRect in VB.net?

    Longs are now 64 bit integers, whereas pointers (any LPtype thing), and integers are 32 bits on Pentium processors. The advantage for this is that the size of number on which you can perform integer math has just increased far above the 2 billion limit of a 32 bit integer.
    My usual boring signature: Nothing

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •  



Click Here to Expand Forum to Full Width