Continue to Site

Welcome to EDAboard.com

Welcome to our site! EDAboard.com is an international Electronics Discussion Forum focused on EDA software, circuits, schematics, books, theory, papers, asic, pld, 8051, DSP, Network, RF, Analog Design, PCB, Service Manuals... and a whole lot more! To participate you need to register. Registration is free. Click here to register now.

WIN32 API PROGRAMMING FOR C++

Status
Not open for further replies.

john2020

Full Member level 5
Full Member level 5
Joined
Nov 13, 2005
Messages
292
Helped
12
Reputation
24
Reaction score
8
Trophy points
1,298
Activity points
4,911
I AM DEVELOPING A DIALOG BASED APPLICATION WHICH NEEDS TO BE WRITTEN USING WIN32 APIS USING VS2005 AND WINDDK7. I NEED TO IMPLEMENT SROLL BAR, RADIO BUTTON, PUSH BUTTON,LIST CONTROL, COMBPO BOX ETC IN WIN32 PROGRAMMING. I AM NEW TO WIN32 USING C++.

ANY LINKS OR HELPFUL TUTORIALS WITH SOURCE CODE FOR DEMO WILL BE HELPFUL.



TYPING IN CAPS MEANS SHOUTING IN THIS FORUM
 

hi

i need win32 programming api for c++ and not MFC, since i need to do hard coding, which is not possible in MFC
 

WIN32 APIs I know are in C and they can be used within C++ with no problems.
--
Amr Ali
 

hi

i am new to gui programming using win32 c++ api.is there any samples available?
 

Why it needs to be in win32 api? Why don't you use .net?
 

hi

i cannot use .net, only win32 progamming can be used, since target device supports only win32 and nothing else.
 

ljudsko said:
Why it needs to be in win32 api? Why don't you use .net?
.net programs can also use windows API directly!! But the only problem is, codes in .net are not native.


john2020 said:
hi

i cannot use .net, only win32 progamming can be used, since target device supports only win32 and nothing else.
Here is a useful link. With 17 sample projects.
http://www.winprog.org/tutorial/files/source.zip

Hope this helped u.
 

thanks but i asked for c++ win32 api programming. i am not a .net developer, hence its very difficult for me to understand the concepts.
 

Hello,

First of all, if your intention is to write a Win-Application by using the pure API you can do this in pure C and the simplest Compiler you can find. There are some concepts built in within the Win-API, you have to know if you want to do the job in this way.
The best source avaliable if it comes to ressources is as far as I know: WIN32 Programming, written by Richard J. Simon.
By the way the book lay in front of me at this very moment. Its the so called API-Bible and has 1350 pages.
The very basic concepts delivers the well known Petzolds "Windows Programming".

If you own Visual C/C++ which includes the MFC you can make life easier because you are able to create your application 10 times faster without any restrictions in terms of hardware access.
You are so much faster in virtue of the provided class-Infrastructure delivered by the whole MFC concept. Building up Dialog Boxes and so on is supported by the Ressource-Editor, so one is completely relieved from thinking about the switches inside the API-Functions and the issue to get the right appearence if it comes to Dialog Boxes and other so called Ressources.
Mixing MFC and API is not a problem at all.
E.G. one of the easiest basic functions <<peep()>> which animates the pc-speaker to send out a peep, isn't wrapped into a class but have to be called as peep() simply.

If you want to use MFC, study Jeff Prosises "Windows Programming with MFC"

Hope that helps

Robby
 

cannot use MFC anymore since the target device supports only WIN32 api, hence everything n eds to be developed from the scratch. i have visual studio 2005, hence developing win32 applications using c++. any help would be appreciated as am new to win32 api programming, eventhough am a c++ programmer. i need samples in win32 for GUI development, that would work with VS 2005. anyone please help me?

Added after 5 minutes:

1)how to program group radio button using win32 apis?which are the event handlers to be called?any samples are available?
2)how to create a button and load image to it using win32 api?
3)how to create a list control and add columns to it using win32 apis?
 

1) a radio button is a button control with the BS_RADIOBUTTON style applied. To create a group of buttons you need to individually create them and intercept the BN_CLICKED notification in the parent window, you could manually handle the check state of the buttons in the group or you could use CheckRadioButton()
2) look up owner draw button
3) one of the styles of a list view control does what you need
 

By using Use the resource editor, i created dialog window and added all the controls. Now i need to write handler for all these controls like, radio button, push button, combo box, list control,group radio button etc.It will be of great help if you could give me some WIN32 C++ code snippets for these controls.

Added after 2 minutes:

here's the snapshot of the image. can anyone please help me with win 32 c++ source code to add handler for these controls?
 

Hello,

There is no need for a Handler but a piece of C++ or C Code realizing the right functionality if a mouseclick occours for example onto a Button you have created by using the Ressource Editor.
The mouseclick will create a message inside the WIN-OS automaticaly. Therefore that is a part which has not to be considered. You only have to creae a function inside your application which is able to react if exactly this message occours.

like this:

switch (message)
{
case WM_SAVEIMAGE : X=2;
break;
.
.
.
}

If there is no appropriate case inside the switch construct, the message will get lost without any reaction.
Windows is a message driven OS.

Hope that helps

Robby
 

Status
Not open for further replies.

Part and Inventory Search

Welcome to EDABoard.com

Sponsor

Back
Top