473,382 Members | 1,107 Online
Bytes | Software Development & Data Engineering Community
Post Job

Home Posts Topics Members FAQ

Join Bytes to post your question to a community of 473,382 software developers and data experts.

Passing Whnd to API function in .NET

Hi All,

I want to pass this structure to API function.

Private Structure FLASHWINFO

Dim cbSize As Long

Dim hwnd As Long

Dim dwFlags As Long

Dim uCount As Long

Dim dwTimeout As Long

End Structure

Now here handle of window is type "intPtr" so how to convert it to Long ,

Long is Integer in .NET

Is the following statement right?

cint(me.Handle.toInt32)

Regards

Sakharam Phapale
Nov 21 '05 #1
2 955
define your structure as follows:

Private Structure FLASHWINFO
Dim cbSize As Integer
Dim hwnd As IntPtr
Dim dwFlags As Integer
Dim uCount As Integer
Dim dwTimeout As Integer
End Structure

Now you can directly pass the hWnd without worrying about the conversion to
Int32.

hope this helps..
Imran.

"Sakharam Phapale" <sp******@annetsite.com> wrote in message
news:%2****************@TK2MSFTNGP11.phx.gbl...
Hi All,

I want to pass this structure to API function.

Private Structure FLASHWINFO

Dim cbSize As Long

Dim hwnd As Long

Dim dwFlags As Long

Dim uCount As Long

Dim dwTimeout As Long

End Structure

Now here handle of window is type "intPtr" so how to convert it to Long ,

Long is Integer in .NET

Is the following statement right?

cint(me.Handle.toInt32)

Regards

Sakharam Phapale

Nov 21 '05 #2
* "Sakharam Phapale" <sp******@annetsite.com> scripsit:
I want to pass this structure to API function.

Private Structure FLASHWINFO

Dim cbSize As Long

Dim hwnd As Long

Dim dwFlags As Long

Dim uCount As Long

Dim dwTimeout As Long

End Structure


Replace 'Long' with 'Int32' and declare 'hwnd' as 'IntPtr'. Then you
can pass in 'Me.Handle' directly.

--
M S Herfried K. Wagner
M V P <URL:http://dotnet.mvps.org/>
V B <URL:http://dotnet.mvps.org/dotnet/faqs/>
Nov 21 '05 #3

This thread has been closed and replies have been disabled. Please start a new discussion.

Similar topics

12
by: harry | last post by:
I have an object that's passed in to a function as a parameter i.e public boolean getProjectTitle(ProjectHeader_DTO obj) {...} If I then call a method on this object inside the function i.e...
3
by: domeceo | last post by:
can anyone tell me why I cannot pass values in a setTimeout function whenever I use this function it says "menu is undefined" after th alert. function imgOff(menu, num) { if (document.images) {...
58
by: jr | last post by:
Sorry for this very dumb question, but I've clearly got a long way to go! Can someone please help me pass an array into a function. Here's a starting point. void TheMainFunc() { // Body of...
2
by: dave.harper | last post by:
I'm relatively new to C++, but have a question regarding functions and arrays. I'm passing a relatively large array to a function several thousand times during the course of a loop, and it seems...
8
by: kalinga1234 | last post by:
there is a problem regarding passing array of characters to another function(without using structures,pointer etc,).can anybody help me to solve the problem.
11
by: John Pass | last post by:
Hi, In the attached example, I do understand that the references are not changed if an array is passed by Val. What I do not understand is the result of line 99 (If one can find this by line...
12
by: Andrew Bullock | last post by:
Hi, I have two classes, A and B, B takes an A as an argument in its constructor: A a1 = new A(); B b = new B(a1);
12
by: Mike | last post by:
Consider the following code: """ struct person { char *name; int age; }; typedef struct person* StructType;
7
by: TS | last post by:
I was under the assumption that if you pass an object as a param to a method and inside that method this object is changed, the object will stay changed when returned from the method because the...
0
isladogs
by: isladogs | last post by:
The next Access Europe User Group meeting will be on Wednesday 3 Apr 2024 starting at 18:00 UK time (6PM UTC+1) and finishing by 19:30 (7.30PM). In this session, we are pleased to welcome former...
0
by: ryjfgjl | last post by:
In our work, we often need to import Excel data into databases (such as MySQL, SQL Server, Oracle) for data analysis and processing. Usually, we use database tools like Navicat or the Excel import...
0
by: taylorcarr | last post by:
A Canon printer is a smart device known for being advanced, efficient, and reliable. It is designed for home, office, and hybrid workspace use and can also be used for a variety of purposes. However,...
0
by: Charles Arthur | last post by:
How do i turn on java script on a villaon, callus and itel keypad mobile phone
0
by: ryjfgjl | last post by:
In our work, we often receive Excel tables with data in the same format. If we want to analyze these data, it can be difficult to analyze them because the data is spread across multiple Excel files...
0
by: emmanuelkatto | last post by:
Hi All, I am Emmanuel katto from Uganda. I want to ask what challenges you've faced while migrating a website to cloud. Please let me know. Thanks! Emmanuel
0
BarryA
by: BarryA | last post by:
What are the essential steps and strategies outlined in the Data Structures and Algorithms (DSA) roadmap for aspiring data scientists? How can individuals effectively utilize this roadmap to progress...
1
by: Sonnysonu | last post by:
This is the data of csv file 1 2 3 1 2 3 1 2 3 1 2 3 2 3 2 3 3 the lengths should be different i have to store the data by column-wise with in the specific length. suppose the i have to...
0
by: Hystou | last post by:
There are some requirements for setting up RAID: 1. The motherboard and BIOS support RAID configuration. 2. The motherboard has 2 or more available SATA protocol SSD/HDD slots (including MSATA, M.2...

By using Bytes.com and it's services, you agree to our Privacy Policy and Terms of Use.

To disable or enable advertisements and analytics tracking please visit the manage ads & tracking page.