473,396 Members | 1,894 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,396 software developers and data experts.

Does C# have windows.h

Dom
I can't find it anywhere. And if you don't have it, how do you
override WndProc? Don't you need the window messages?

Dom

Aug 3 '07 #1
7 11606
Dom wrote:
I can't find it anywhere. And if you don't have it, how do you
override WndProc? Don't you need the window messages?
C# does not have .h files ate all.

GUI apps in .NET are significantly different from Win32 API C++.

Usually you do not need to worry about such stuff when you create
a Form class.

But actually it has a WndProc you can override, if you so want.

Arne

Aug 3 '07 #2
Dom wrote:
I can't find it anywhere. And if you don't have it, how do you
override WndProc? Don't you need the window messages?
Maybe you should start reading a bit about Win Forms in .NET.

A quick googling finds:
http://www.codeproject.com/csharp/winfileinfo.asp
http://www.ondotnet.com/pub/a/dotnet.../template.html

They are a bit old, but should be sufficient to get you on
the right track.

Arne
Aug 3 '07 #3
Dom wrote:
I can't find it anywhere. And if you don't have it, how do you
override WndProc? Don't you need the window messages?
I don't know what windows.h has to do with overriding WndProc. C#
doesn't use include files; the information is in referenced assemblies.
You can override things just fine without windows.h.

As far as overriding WndProc goes, in most cases you should not need to
write an override for that method, but if you do need to, you do it just
like you'd override any other method in a class: simply write the
override into your derived class, making sure that the method signature
is exactly the same as the method you are overriding (and of course,
includes the keyword "override").

Pete
Aug 3 '07 #4
Dom
On Aug 2, 10:32 pm, Dom <dolivas...@gmail.comwrote:
I can't find it anywhere. And if you don't have it, how do you
override WndProc? Don't you need the window messages?

Dom
I guess I was being a little to coy. I know that C# does not have
".h" files, I meant, "what does it use instead." In particular, I
wanted to know how to get the message codes.

In C++, when you write a Wndproc, you need the message codes. You
always write a long switch statement, in which you case out the
messages you want to handle, such as WM_RBUTTONDOWN. For example, you
might write:

switch (msg)
case WM_RBUTTONDOWN:
Button1_Click (hwnd, msg, wParam, lParam);
break;

and so on. I assumed WM_???? was defined somewhere in C#.

If I am fundamentally mistaken, and Arne's articles will set me
straight, then don't bother answering.

Dom

Aug 3 '07 #5
Dom
On Aug 2, 10:32 pm, Dom <dolivas...@gmail.comwrote:
I can't find it anywhere. And if you don't have it, how do you
override WndProc? Don't you need the window messages?

Dom
I guess I was being a little to coy. I know that C# does not have
".h" files, I meant, "what does it use instead." In particular, I
wanted to know how to get the message codes.

In C++, when you write a Wndproc, you need the message codes. You
always write a long switch statement, in which you case out the
messages you want to handle, such as WM_RBUTTONDOWN. For example, you
might write:

switch (msg)
case WM_RBUTTONDOWN:
Button1_Click (hwnd, msg, wParam, lParam);
break;

and so on. I assumed WM_???? was defined somewhere in C#.

If I am fundamentally mistaken, and Arne's articles will set me
straight, then don't bother answering.

Dom

Aug 3 '07 #6
Dom wrote:
I guess I was being a little to coy. I know that C# does not have
".h" files, I meant, "what does it use instead." In particular, I
wanted to know how to get the message codes.
I recommend that you always do your best to ask the question you
actually want an answer for.
In C++, when you write a Wndproc, you need the message codes. You
always write a long switch statement, in which you case out the
messages you want to handle, such as WM_RBUTTONDOWN. For example, you
might write:

switch (msg)
case WM_RBUTTONDOWN:
Button1_Click (hwnd, msg, wParam, lParam);
break;

and so on. I assumed WM_???? was defined somewhere in C#.
Sorry to say, it's not. You have to declare the constants yourself,
based on the values that are in the various Windows SDK include files.
Kind of annoying, IMHO.

Pete
Aug 3 '07 #7
On 3 Aug, 03:58, Dom <dolivas...@gmail.comwrote:
On Aug 2, 10:32 pm, Dom <dolivas...@gmail.comwrote:
I can't find it anywhere. And if you don't have it, how do you
override WndProc? Don't you need the window messages?
Dom

I guess I was being a little to coy. I know that C# does not have
".h" files, I meant, "what does it use instead." In particular, I
wanted to know how to get the message codes.

In C++, when you write a Wndproc, you need the message codes. You
always write a long switch statement, in which you case out the
messages you want to handle, such as WM_RBUTTONDOWN. For example, you
might write:

switch (msg)
case WM_RBUTTONDOWN:
Button1_Click (hwnd, msg, wParam, lParam);
break;

and so on. I assumed WM_???? was defined somewhere in C#.

If I am fundamentally mistaken, and Arne's articles will set me
straight, then don't bother answering.

Dom
Hi, take a look at http://www.pinvoke.net/ which will list everything
you need in easy to copy and paste format. Hmm, just noticed they've
got a VS add in as well now. Not played with that, but looks
interesting :)

Aug 3 '07 #8

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

Similar topics

2
by: ROGER | last post by:
>I need to know the reason whereby the Oracle 8i are not supported by Windows XP. >Any answers? Thanks Roger
2
by: mscertified | last post by:
Does a Windows desktop application (not a web app) written with .NET require the .NET framework be installed on the users machines?
1
by: VMI | last post by:
I have a Windows datagrid whose column values are (1,10,100,1000,101,10-1,103,11,1710,2). When the column's sorted (the column's of type String), it'll sort this way , which is wrong. But in...
0
by: NiNiT | last post by:
I need to display embedded Windows Media Player plugin inside a browser that fetches its video over HTTPS. Is that possible? In other words, does Windows Media Player embedded plugin support...
0
by: ukwebguy | last post by:
Hi, I'm using Persits ASP Upload to upload files to a simple document management application running on Windows Server 2003. At the moment I've set the OVERWRITEFILES property to FALSE so every...
3
kestrel
by: kestrel | last post by:
Hey, I have an 8 gb flash drive. ive been using it to transfer all of my music from one computer (linux) to another (windows xp, if it really matters). After all my transfers were completed, i stuck...
0
by: walsug | last post by:
hello, I'm engaged in some code migration work,in linux the EUC-jp and Shift-JIS encoding are supported and configurable by LANG. Does windows offer this support? -yogo
0
by: Studlyami | last post by:
I am trying to find how windows translate the input from a HID device to an actual windows message; specifically, the mouse. I am trying to figure out how when the mouse moves the process windows...
0
by: ivreddy | last post by:
I am new to qtp. Does anyone know whether windows7 supports qtp9.2 ?
0
by: Edmond Azaza | last post by:
I'm a rookie in Computer Science, please help me understand how Windows XP unlike UNIX stores user names and passwords in registry.
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: nemocccc | last post by:
hello, everyone, I want to develop a software for my android phone for daily needs, any suggestions?
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:
Most computers default to English, but sometimes we require a different language, especially when relocating. Forgot to request a specific language before your computer shipped? No problem! You can...
0
jinu1996
by: jinu1996 | last post by:
In today's digital age, having a compelling online presence is paramount for businesses aiming to thrive in a competitive landscape. At the heart of this digital strategy lies an intricately woven...
0
by: Hystou | last post by:
Overview: Windows 11 and 10 have less user interface control over operating system update behaviour than previous versions of Windows. In Windows 11 and 10, there is no way to turn off the Windows...

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.