Build a GUI Application for Windows in C [closed] - c

Closed. This question needs to be more focused. It is not currently accepting answers.
Want to improve this question? Update the question so it focuses on one problem only by editing this post.
Closed 9 years ago.
Improve this question
I'm fairly new to C programming.
My program is running at the console as expected, but now I want to build a really simple Windows GUI application for it, sticking to C (just a window showing some text and a file menu).
So far, I have built everything in a single .c source code and used MinGW gcc in my Windows PC as the compiler.
I just downloaded Visual Studio 2013, but trying to use it was a bit overwhelming. I tried to look for alternatives but I'm confused with all the terminology (IDE, SDK, API etc.) and what I really need to do what I want to.
I'll be really satisfied if you just point something for me to read in order to clear my mind.
Thanks a lot in advance and sorry if this was a bad question.

A very simple GUI application is possible sticking with C and Windows API only.
In short, you have to register your own Window class (RegisterClassEx), then create the window (CreateWindowEx). Note that your window class main element is its (WindowProc) that receive the messages and that you have to implement to act as you want. After that, your C program should run the message pump (PeekMessage and DispatchMessage) for Windows to do its stuff and allow interacting with your window.
See the MSDN documentation for these functions to get help and examples.

YOu can start learning GTK for developing GUI using C language . you can get the same at
http://www.gtk.org/development.php

Related

How can I turn my code into an actual aplication for windows? [closed]

Closed. This question needs details or clarity. It is not currently accepting answers.
Want to improve this question? Add details and clarify the problem by editing this post.
Closed 2 years ago.
Improve this question
I developed a program written in C language using Gtk+ 3 for visual interface, and to run it I always use the comand line (Im using cygwin), but I would like to know how can i make my program an aplication, witch can be installed in windows and function like any other aplication (launch it throught files explorer or even throught the desktop enviroment)?
Thank you for your answers!
Provided that you have written the code portable, you basically have two options.
Install GTK on Windows. You can find instructions here: https://www.gtk.org/docs/installations/windows/
Rewrite the whole application for Windows API. This is NOT trivial.
On top of that, use windows installer

How do i create an interface for C Game [closed]

Closed. This question needs to be more focused. It is not currently accepting answers.
Want to improve this question? Update the question so it focuses on one problem only by editing this post.
Closed 4 years ago.
Improve this question
I just created the "Hangman game" using C language, i used GCC to compile it and worked in the terminal.
Let's say that i started with C a week ago, and this is the only programming language i know (Html & CSS arn't programming languages even if i know them). I'm a complete beginner so.
My question is, from the code source i have, how can i create an interface, an app that i'd start on windows (instead of linux terminal), with "buttons" or something like that ?
If i can't do this from the code source, what wold u recommend ?
What would be the software i should use instead of visual studio code to write code (because i guess i'll need a specific software if i want an interface or if i want to compile it in order to ceate a windows app ?)
I'm not english native so i may did some languages mistakes, sorry in advance.
Let me know if i can be more precise and explain something using other words.
There are numerous libraries and frameworks which can provide a GUI for your games.
Qt
Dear IMGUI
libsdl with widgets
and many more, depending on your requirements
Related posts:
https://gamedev.stackexchange.com/questions/1086/what-c-gui-library-can-you-suggest
Game GUI framework
http://samirsinha.com/choosing-a-gui-framework/
It's probably best to study existing games and how they are designed, what libraries people use, and so on, before embarking on building your own from scratch.
Also try reading some of the resources in the GameDev Stack Exchange.

Using C to output a key on a web page [closed]

Closed. This question needs to be more focused. It is not currently accepting answers.
Want to improve this question? Update the question so it focuses on one problem only by editing this post.
Closed 5 years ago.
Improve this question
Is there any way I can use ANSI C to output words onto a web page? Or if I'm completely off, what language (or script) is used to do this sort of stuff?
I wanna try this since I just found a website (virtualpiano), and now I want to make some kind of programming that can read out the "notes" and play it on the virtual piano.
Thanks a bunch!
You should probably look at JavaScript instead. You can write C programs that are run on the web server, and the output from the C program will be the text of the web page, but that is not a very modern way of doing it, and for a thing like a virtual piano you need to run the program on the client, i. e. in the user's web browser, and then JavaScript will be a better choice.
Javascript should have been a better option for you, maybe you might want to check Soundslice, this have something similar to what you need or this SO post creating sheet music with piano or even this github repo abcjs which gives some close to what you're trying to archive.
I hope this helps.

Plotting a graph in C (ubuntu) [closed]

Closed. This question needs to be more focused. It is not currently accepting answers.
Want to improve this question? Update the question so it focuses on one problem only by editing this post.
Closed 6 years ago.
Improve this question
i would like to ask a question,because i have been searching for 2 hours.
I have a project in a game development course and i have arrays of some map elements,positions,and lines that connect them.And i need to draw a graph from them.But I don't have the slightest idea.Do i include some header file?
Do i download that? If i had the commands i could work with that,but i don't see graphics command anywhere in code blocks.
Please inform me on what i can use to draw a simple graph,and possibly the installation process in general if it's not too much trouble
There is no such a thing as a "graphics command" somewhere in Code::Blocks. In order to create graphical interfaces and to be able to draw things, you have to use a GUI library (like GTK, Qt, SFML, wx... etc).
Since your requirement is to use C I'd recommand you then to go with GTK. Since it's one of the best and most documented library with C language at it's base.
Note: Please be careful that what I mentioned above are only GUI libraries, i.e. mainly used to create graphical user interfaces. Since you are following a game development course, you may rather want to take a look at game engines such as SDL or Unity, which are quite different things, and enable to perform a lot more (serious) gaming stuff.
Here's a Wikipedia list with a thorough listing of GUI libraries.

Build an interface using only the SDL and the C standard library [closed]

Closed. This question needs to be more focused. It is not currently accepting answers.
Want to improve this question? Update the question so it focuses on one problem only by editing this post.
Closed 7 years ago.
Improve this question
I need to make a program using only the C standard library and the SDL. I can't use the Windows API or any other library. I need to use only the C language i.e. no C++, no C# etc.
I have really no idea on how to achieve that since I only know to output to the standard output device (console) and files. So I hope you can give me an example on how to open a window with two buttons (custom built): one to exit and one to perform any task.
To create a window: https://wiki.libsdl.org/SDL_CreateWindow?highlight=%28%5CbCategoryVideo%5Cb%29%7C%28CategoryEnum%29%7C%28CategoryStruct%29
About the buttons, you gotta compare the mouse coords and if the user is clicking on the desired spot to do whatever you want. To get this user input data you gotta use the sdl event handling system. You can learn about it trought sdl's wiki or you check this tutorial http://lazyfoo.net/SDL_tutorials/lesson04/index.php (i'm sure that there are other tutorials out there if you google it).
To draw the buttons to the sccreen you have to use SDL's rendering system.
Your question is not that specific, so that is the best i can do for you.

Resources