Showing an picture in a dialog box (WinAPI)

  • Thread starter Thomas Matthews
  • Start date
T

Thomas Matthews

Joel said:
Hi,

I'd like to know if it's possible to show a picture in a dialog box. I'm
programming in C language using WinAPI (for MS Windows).
If it's possible, please, let me know how. Everything I tried failed and the
only solutions I found were for C++.

Thanks.
Yes it is, many applications do this.
Get a good book on programming for Windows.
Many people recommend Charles Petzold's books.
He explains how to program Windows using the C language
(with many platform specific function calls).

--
Thomas Matthews

C++ newsgroup welcome message:
http://www.slack.net/~shiva/welcome.txt
C++ Faq: http://www.parashift.com/c++-faq-lite
C Faq: http://www.eskimo.com/~scs/c-faq/top.html
alt.comp.lang.learn.c-c++ faq:
http://www.comeaucomputing.com/learn/faq/
Other sites:
http://www.josuttis.com -- C++ STL Library book
http://www.sgi.com/tech/stl -- Standard Template Library
 
J

Joel ELISE

Hi,

I'd like to know if it's possible to show a picture in a dialog box. I'm
programming in C language using WinAPI (for MS Windows).
If it's possible, please, let me know how. Everything I tried failed and the
only solutions I found were for C++.

Thanks.

--
Joel

*************************************
Joel Elisee
e-mail : mailto:[email protected]
alt e-mail : mailto:[email protected]
ICQ # : 17405316
*************************************
GAGNEZ DE L'ARGENT EN LISANT DES EMAILS
http://www.sendmoreinfo.com/id/1563434
EARN MONEY READING EMAILS
 
A

Alan Balmer

Hi,

I'd like to know if it's possible to show a picture in a dialog box. I'm
programming in C language using WinAPI (for MS Windows).
If it's possible, please, let me know how. Everything I tried failed and the
only solutions I found were for C++.

Thanks.

Your question is off-topic here, since it has nothing to do with the C
language. Try a newsgroup which discusses Windows programming. If you
research your question on Google groups, you should find an
appropriate newsgroup, and you might even find your answer already
there.
 
M

Malcolm

Joel ELISE said:
I'd like to know if it's possible to show a picture in a dialog box. I'm
programming in C language using WinAPI (for MS Windows).
If it's possible, please, let me know how. Everything I tried failed and
the
only solutions I found were for C++.
What Microsoft do is write the basic calls for their operating system in C,
and then build a C++ layer on top of it. Then they tend to write the
documentation with the assumption that the applications programmer is using
C++.
There is the additional problem that many automatic tools that ship with
Windows C/C++ compliers produce various support files, and so the program is
no longer really a C program.

I would tell you how to achieve this in C (I program Windows apps in C
regularly) but the other regs would be annoyed with me for answering an
off-topic query. Specific operating systems aren't topical here, and MS
Windows is more specific than most. All I can say is it is possible, and if
you root about in the API calls with C linkage (most of the plain functions)
you should work out how to do it.
 
E

Emmanuel Delahaye

Malcolm wrote on 07/05/05 :
What Microsoft do is write the basic calls for their operating system in C,

[way off-topic]

This is a common misleading. The interface of a DLL function is more
Pascal or Visual BASIC than C (forbidding variadics, for example). The
C compilers for Windows have to manage a special extension (PASCAL,
WINAPI etc.) to force the compiler to use another calling convention
(order of parameters, stack correction by the callee etc.) .

It happens that in Visual BASIC, there is nothing else to do than to
'naturally' declare the function interface. I guess that VB is the
native interface for DLL functions.

--
Emmanuel
The C-FAQ: http://www.eskimo.com/~scs/C-faq/faq.html
The C-library: http://www.dinkumware.com/refxc.html

..sig under repair
 
M

Malcolm

Emmanuel Delahaye said:
What Microsoft do is write the basic calls for their operating system in
C,

[way off-topic]
We're going a bit OT but the ng is quiet at the moment.
This is a common misleading. The interface of a DLL function is more
Pascal or Visual BASIC than C (forbidding variadics, for example).
I think the orignal version of Windows was written in assembly, with the
expectation that most programmers would use Pascal. I thought that, as
things developed, the vast majority of the subsequent code was written in C.
I may be wrong about this.

Most of the API functions can be called as normal C functions, but horrible
things are going on underneath. The C programmer gets hint of this when the
function pointer he passes to a window has to be tagged "CALLBACK". I didn't
want to go into that, nor to discourage someone from trying to write a
Windows program in C.
 
R

Richard Bos

Thomas Matthews said:
Yes it is, many applications do this.
Get a good book on programming for Windows.
Many people recommend Charles Petzold's books.

So do I, provided you already know a good bit about portable C
programming. The one book I have of him, while quite good where Windows
is concerned, contains certain misconceptions about ISO C, and about
solid code in particular, which could leave you with some rather unwise
practices if you don't already know better. I'm not sure how much of
this can be blamed to Petzold himself and how much is simply wrong-
headed ideas in the Windows programming culture in general.

Richard
 

Ask a Question

Want to reply to this thread or ask your own question?

You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.

Ask a Question

Members online

Forum statistics

Threads
473,768
Messages
2,569,574
Members
45,050
Latest member
AngelS122

Latest Threads

Top