Click here to Skip to main content
15,867,308 members
Please Sign up or sign in to vote.
1.00/5 (2 votes)
See more:
Sir or Madam, I want to make a gui application in C in windows platform. When i google about it , i found that its a totally different language.

Please help me. tell me ,to make a GUI i have to study the win32 api programming , but i can't find any similarity between c and win32 api except preprocessing commands.

please .. tell me..
Posted
Updated 9-Aug-17 10:26am
v2

I'm not sure I believe your assertion that they're "a totally different language." A simple hello world app in C using the standard runtime library might look like:

XML
#include <stdio.h>

int main()
{
    puts( "Hello World!" );
}


while using the windows API it looks like:

#include <windows.h>

int main()
{
    MessageBoxA( NULL, "Hello World!", "Hello", MB_OK );
}


The only difference there is the function you use to do the output.

Write a standard C program that needs to dispatch a set of nested commands and you'll see that Windows programming using the Windows API is very much C programming. I'd suggest reading "Programming Windows" by Charles Petzold as a good first start on becoming a proficient GUI programmer on Windows. You want the 5th edition which came out about 2000. It's an old book and some of the programming techniques grate a bit but it's a very good introductory book.

Cheers,

Ash
 
Share this answer
 
Comments
Espen Harlinn 9-Aug-17 16:30pm    
Agree, I didn't read your entire answer until after I made the same recommendation with regard to Petzolds book ...
Quote: "but i can't find any similarity between c and win32 api except preprocessing commands."

This is not true, if you create a new Windows application from the Visual Studio or Visual C++ Express IDE you will find that it is all written in C. For more information on the API see here[^].

However, if you create an application using MFC it is in C++, which is different.
 
Share this answer
 
Comments
Member 11367269 11-Jan-15 14:21pm    
How r we create a simple application in c for used gui
Richard MacCutchan 12-Jan-15 3:50am    
Sorry I don't understand. If you have a technical problem then please post a question with full details.
Have a look at Programming Windows, 5th Edition, by Charles Petzold[^]

This is perhaps the best available introduction to Win32 programming.

Good luck :-)

Espen Harlinn
 
Share this answer
 
Comments
CPallini 9-Aug-17 16:38pm    
Hey Espen, in the meantime the OP has become the smartest Win32 developer of the world.
I was caught in the same trap :-)
Espen Harlinn 9-Aug-17 16:49pm    
Oops - didn't notice the date :laugh:
Quote:
Please help me. tell me ,to make a GUI i have to study the win32 api programming , but i can't find any similarity between c and win32 api except preprocessing commands.

Unfortunately GUI programming on Windows using the C programming language doesn't look simple, at first. However that depends on the OS complexity, not on the language used. Have a look at Walkthrough: Creating Windows Desktop Applications (C++)[^] (even if marked as C++ is essentially pure C code).
 
Share this answer
 
Comments
Kats2512 8-Aug-17 9:12am    
7 years ago?
CPallini 8-Aug-17 11:31am    
A bit dated? :-D
Kats2512 8-Aug-17 17:38pm    
yeah

This content, along with any associated source code and files, is licensed under The Code Project Open License (CPOL)



CodeProject, 20 Bay Street, 11th Floor Toronto, Ontario, Canada M5J 2N8 +1 (416) 849-8900