Welcome to Experts Exchange

Add your voice to the tech community where 5M+ people, just like you, are talking about what matters.

  • Help others & share knowledge
  • Earn cash & points
  • Learn & ask questions
Solved

Window Handle: intPtr to Long

Posted on 2007-04-05
2
1,764 Views
Last Modified: 2013-12-03
Hi I have the handle of a window as an intPtr, how do I get the handle as a Long from this?
I've tried searching many places, I'm new to VB .Net so I hope it's something so simple people never need to ask.
I appreciate any help.

Matty
0
Comment
Question by:Matty023
2 Comments
 
LVL 85

Accepted Solution

by:
Mike Tomlinson earned 125 total points
ID: 18861580
You don't!

Use an Integer (NOT a Long)....

For example:

    ' From within some Form
    Dim hWnd As IntPtr = Me.Handle
    Dim intWnd As Integer = hWnd.ToInt32

A handle is represented by a Long in VB6, but in .Net you use an Integer.
0
 
LVL 1

Author Comment

by:Matty023
ID: 18861635
Thankyou very much, the things I hate the most are the easy problems that get you stuck for too much time. And I appreciate the Integer tip, all the examples on the net seem to be written in VB6 which means I'm converting it to .Net as I'm learning it.
And there's a shortage of English Books in China for Exchange students.
Here's your points, I appreciate the help ^_^
0

Featured Post

Networking for the Cloud Era

Join Microsoft and Riverbed for a discussion and demonstration of enhancements to SteelConnect:
-One-click orchestration and cloud connectivity in Azure environments
-Tight integration of SD-WAN and WAN optimization capabilities
-Scalability and resiliency equal to a data center

Question has a verified solution.

If you are experiencing a similar issue, please ask a related question

Introduction When many people think of the WebBrowser (http://msdn.microsoft.com/en-us/library/2te2y1x6%28v=VS.85%29.aspx) control, they immediately think of a control which allows the viewing and navigation of web pages. While this is true, it's a…
It was really hard time for me to get the understanding of Delegates in C#. I went through many websites and articles but I found them very clumsy. After going through those sites, I noted down the points in a easy way so here I am sharing that unde…
This is Part 3 in a 3-part series on Experts Exchange to discuss error handling in VBA code written for Excel. Part 1 of this series discussed basic error handling code using VBA. http://www.experts-exchange.com/videos/1478/Excel-Error-Handlin…
A short tutorial showing how to set up an email signature in Outlook on the Web (previously known as OWA). For free email signatures designs, visit https://www.mail-signatures.com/articles/signature-templates/?sts=6651 If you want to manage em…

856 members asked questions and received personalized solutions in the past 7 days.

Join the community of 500,000 technology professionals and ask your questions.

Join & Ask a Question