Creating plain GUI WinAPI project

General questions regarding the usage of CodeLite
Fred
CodeLite Enthusiast
Posts: 43
Joined: Mon Jul 02, 2012 12:53 pm
Genuine User: Yes
IDE Question: C++
Contact:

Creating plain GUI WinAPI project

Post by Fred »

Hello,
thank you for providing codelite.
I just installed prebuilt 4.0.5589 incl. MinGW on Vista SP2 and tested building a console app without problems.
My question:
How can I create a new plain GUI Windows API C++ project (without qt, widgets etc.)?
I didn't find any selection for this in the create project dialog.

Thanks,
Fred
User avatar
eranif
CodeLite Plugin
Posts: 6375
Joined: Wed Feb 06, 2008 9:29 pm
Genuine User: Yes
IDE Question: C++
Contact:

Re: Creating plain GUI WinAPI project

Post by eranif »

Download the attached zip file
WinAPIProject.zip
and extract it to:

Code: Select all

C:\Program Files (x86)\CodeLite\templates\projects
(assuming that this is where you installed codelite)

Next, go to main menu:
Workspace | New Project | GUI | WinAPIProject

It will give you a basic Debug / Release configuration with a sample main.cpp file that creates a basic WIndow

Eran
You do not have the required permissions to view the files attached to this post.
Make sure you have read the HOW TO POST thread
Fred
CodeLite Enthusiast
Posts: 43
Joined: Mon Jul 02, 2012 12:53 pm
Genuine User: Yes
IDE Question: C++
Contact:

Re: Creating plain GUI WinAPI project

Post by Fred »

Hello Eran,
thank you for your fast reply!
This works as expected.
I added an icon.png to the directory, too.
I assume, that it is possible to change the code of the template main.cpp?
Is the syntax of CodeLite project xml-files documented somewhere, so that users can create their own project types?

Thanks,
Fred
User avatar
eranif
CodeLite Plugin
Posts: 6375
Joined: Wed Feb 06, 2008 9:29 pm
Genuine User: Yes
IDE Question: C++
Contact:

Re: Creating plain GUI WinAPI project

Post by eranif »

Fred wrote:I assume, that it is possible to change the code of the template main.cpp?
Once the project is created from the template, you can modify it, add new files , delete files etc.
Ofc, it will not affect the template.
Fred wrote:Is the syntax of CodeLite project xml-files documented somewhere, so that users can create their own project types?
There is no need to manually edit the XML files.

To create your own custom templates, create an empty project throw in a sample main.cpp file, edit the project settings to fit your needs.
Once you are done, right click on the project and select 'Save as template', give it a name, description and category

This is how I created the WinAPI template: I created a simple console application, added the '-mwindows' flag to the link options to avoid the black CMD window.
Replaced the the default main.cpp content with something I pulled out of the internet saved it as template and posted it on the forum ;)

Eran
Make sure you have read the HOW TO POST thread
Fred
CodeLite Enthusiast
Posts: 43
Joined: Mon Jul 02, 2012 12:53 pm
Genuine User: Yes
IDE Question: C++
Contact:

Re: Creating plain GUI WinAPI project

Post by Fred »

Thanks Eran,
'Save as template' is a useful feature!
Can a template be deleted by deleting its directory or does CL keep a reference to it somewhere?
Fred
User avatar
eranif
CodeLite Plugin
Posts: 6375
Joined: Wed Feb 06, 2008 9:29 pm
Genuine User: Yes
IDE Question: C++
Contact:

Re: Creating plain GUI WinAPI project

Post by eranif »

codelite does not keep a reference to it.
It simply scans the 'template' directory each time a the 'new project dialog' is loaded.
so if you delete that folder you will lose the template

Eran
Make sure you have read the HOW TO POST thread
Fred
CodeLite Enthusiast
Posts: 43
Joined: Mon Jul 02, 2012 12:53 pm
Genuine User: Yes
IDE Question: C++
Contact:

Re: Creating plain GUI WinAPI project

Post by Fred »

Hi Eran, thank you for your reply.
That's great, users can add and delete project types freely (if they have admin rights on Vista ++, as write access to a Programs subfolder is required).
I'll try this now for Win32 ANSI and Unicode exes and dlls with my standard code templates.
Thanks and regards,
Fred
Post Reply