Wrox Programmer Forums

Need to download code?

View our list of code downloads.

Go Back   Wrox Programmer Forums > C# and C > C# 1.0 > C#
Password Reminder
Register
| FAQ | Members List | Calendar | Search | Today's Posts | Mark Forums Read
C# Programming questions specific to the Microsoft C# language. See also the forum Beginning Visual C# to discuss that specific Wrox book and code.
Welcome to the p2p.wrox.com Forums.

You are currently viewing the C# section of the Wrox Programmer to Programmer discussions. This is a community of tens of thousands of software programmers and website developers including Wrox book authors and readers. As a guest, you can read any forum posting. By joining today you can post your own programming questions, respond to other developers’ questions, and eliminate the ads that are displayed to guests. Registration is fast, simple and absolutely free .
DRM-free e-books 300x50
Reply
 
Thread Tools Search this Thread Display Modes
  #1 (permalink)  
Old February 9th, 2007, 11:24 AM
Registered User
 
Join Date: Feb 2007
Location: , , .
Posts: 7
Thanks: 0
Thanked 0 Times in 0 Posts
Default Need Guidance

hi,

I have just started programming Windows. I have a background of programming C and Perl in Linux. I am absolutely new to Windows development. Now my new project (Networking, Multimedia included) need to be build in WinXP and with rich GUI design. So, I have chosen C# .NET as the platform. I am following Programming Windows with C# by Charles Petzold. Later I realised that using only Windows Forms, I might not be able to develop rich GUI and I have to learn and use basic Win API functions. So, please guide me in achieving the above. How should I start learning the basic API functions? Suggest a book plz.

Correct me if I am wrong.

Thanks,
Gopi.

Reply With Quote
  #2 (permalink)  
Old February 9th, 2007, 11:30 AM
joefawcett's Avatar
Wrox Author
Points: 9,763, Level: 42
Points: 9,763, Level: 42 Points: 9,763, Level: 42 Points: 9,763, Level: 42
Activity: 0%
Activity: 0% Activity: 0% Activity: 0%
 
Join Date: Jun 2003
Location: Exeter, , United Kingdom.
Posts: 3,074
Thanks: 1
Thanked 38 Times in 37 Posts
Default

How rich is rich? Unless you want something unusual everything you need will be in the Petzold book. Alternatively if you're targeting Vista you could plump for XAML, Petzold also has a book on that.

--

Joe (Microsoft MVP - XML)
Reply With Quote
  #3 (permalink)  
Old February 9th, 2007, 11:44 AM
Wrox Author
Points: 13,255, Level: 49
Points: 13,255, Level: 49 Points: 13,255, Level: 49 Points: 13,255, Level: 49
Activity: 0%
Activity: 0% Activity: 0% Activity: 0%
 
Join Date: Oct 2005
Location: Ohio, USA
Posts: 4,104
Thanks: 1
Thanked 64 Times in 64 Posts
Send a message via AIM to dparsons
Default

I am not sure what you mean by "Rich GUI Design" but interacting with the Windows APIs is fairly straight forward.

First you will need this namespace included in your probject:
using System.Runtime.InteropServices;

Then to work with the APIs you woudl do something like this:
[DllImport("User32.dll")]
public static extern Int32 FindWindow(String lpClassName,String lpWindowName);

The [DLLImport(<dll>)] directive does at it implies, it imports a specific DLL into your application.

FindWindow is a a function that exists inside of the User32.dll but, to be able to work with it in your code, you must define it as such. (extern keyword defines the function as being external)

Then to use this you would do something like
IntPtr someWindow = FindWindow("ClassName", null);

Obviously this particular funtion doesn't provide any useful functionality without using it in conjunction with other functions inside of the DLL but you get the point.

In so far as a book is concerned, I know that Petzold did a Win32 API Programming book, although the book focused on using Visual Basic, not C#. I suggest going to Amazon or the like and do a search for Win32 API Programming with C#.

hth.

================================================== =========
I will only tell you how to do it, not do it for you.
Unless, of course, you want to hire me to do work for you.
================================================== =========
Read this if you want to know how to get a correct reply for your question:
http://www.catb.org/~esr/faqs/smart-questions.html
^^Took that from planoie's profile^^
^^Modified text taken from gbianchi profile^^
================================================== =========
Reply With Quote
  #4 (permalink)  
Old February 9th, 2007, 11:58 AM
Registered User
 
Join Date: Feb 2007
Location: , , .
Posts: 7
Thanks: 0
Thanked 0 Times in 0 Posts
Default

Thanks for your reply.

The book doesn't mention Multimedia. Also it says that using Windows Forms, it couldn't be done. (Preface of the book)

"Rich":

For ex: I wish to have a Title bar different from the traditional one. (Something like what we see in gtalk, I wish to design my own.) The book doesn't have that example.

I mean, everything cannot be fit in the book. The book is indeed the best for learning C#. What I am looking for is different. I want to learn the basic API. I believe 'Form classes' isolate the user form API, by making some internal calls.

Correct me if I am wrong.

Does "Programming Windows" (1995, I believe) by Charles Petzold help?

Thanks,
Gopi.

Reply With Quote
  #5 (permalink)  
Old February 9th, 2007, 12:03 PM
Wrox Author
Points: 13,255, Level: 49
Points: 13,255, Level: 49 Points: 13,255, Level: 49 Points: 13,255, Level: 49
Activity: 0%
Activity: 0% Activity: 0% Activity: 0%
 
Join Date: Oct 2005
Location: Ohio, USA
Posts: 4,104
Thanks: 1
Thanked 64 Times in 64 Posts
Send a message via AIM to dparsons
Default

You want a book directly related to programming against the Win32 api. Also you are right in assuming that .NET does have classes that make internal calls to some API's which we have no control over. (Albeit I do not know which classes or which APIs)

I understand what you are trying to do, although I can't give you any extremely pointed advice as I have never had a reason to employ the kinds of requirements that you have.

================================================== =========
I will only tell you how to do it, not do it for you.
Unless, of course, you want to hire me to do work for you.
================================================== =========
Read this if you want to know how to get a correct reply for your question:
http://www.catb.org/~esr/faqs/smart-questions.html
^^Took that from planoie's profile^^
^^Modified text taken from gbianchi profile^^
================================================== =========
Reply With Quote
  #6 (permalink)  
Old February 9th, 2007, 02:52 PM
Authorized User
 
Join Date: Sep 2003
Location: Park City, UT, .
Posts: 24
Thanks: 0
Thanked 0 Times in 0 Posts
Default

Gopi,

Obviously, you have Petzold's book on programming windows using C#. So to concentrate on how to utilize the Win32 API in a C# environment, I recommend the following book:

  .NET Framework Solutions: In Search of the Lost Win32 API
  by John Paul Mueller
  ISBN-10: 078214134X

It has helped me on those occasions when I needed to to extend beyond the .NET framework. In my opionion, it does a nice job of explaining how to access WinAPI function calls, how to marshall objects, and what C# datatypes relate to WinAPI datatypes. Good luck.

Cheers.

- Roger Nedel
Reply With Quote
  #7 (permalink)  
Old February 9th, 2007, 04:57 PM
Registered User
 
Join Date: Feb 2007
Location: , , .
Posts: 7
Thanks: 0
Thanked 0 Times in 0 Posts
Default

Thanks everyone.

I have gone through the index of the book. This is exactly what I am looking for. Only thing is that I am not sure that I can find this book easily in India.

Any way, the next time, I will come back with a true C# question.

Regards,
Gopi.

Reply With Quote
Reply


Thread Tools Search this Thread
Search this Thread:

Advanced Search
Display Modes

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is Off
HTML code is Off
Trackbacks are Off
Pingbacks are On
Refbacks are Off


Similar Threads
Thread Thread Starter Forum Replies Last Post
Need guidance for PHP SOAP snowbydave1 Pro PHP 0 September 25th, 2008 07:16 AM
need guidance please samanta103 Intro Programming 2 March 16th, 2006 01:08 PM
Guidance required for Programming whyvenky Intro Programming 2 March 10th, 2006 05:39 AM
Guidance required whyvenky General .NET 0 February 26th, 2006 03:03 AM
Need guidance Newkid Classic ASP Components 4 July 27th, 2004 04:23 PM



All times are GMT -4. The time now is 12:42 PM.


Powered by vBulletin®
Copyright ©2000 - 2019, Jelsoft Enterprises Ltd.
© 2013 John Wiley & Sons, Inc.