Connecting Tech Pros Worldwide Forums | Help | Site Map

Showing an picture in a dialog box (WinAPI)

Joel ELISE
Guest
 
Posts: n/a
#1: Nov 14 '05
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:jelise@ifrance.com
alt e-mail : mailto:jelise@chez.com
ICQ # : 17405316
*************************************
GAGNEZ DE L'ARGENT EN LISANT DES EMAILS
http://www.sendmoreinfo.com/id/1563434
EARN MONEY READING EMAILS



Thomas Matthews
Guest
 
Posts: n/a
#2: Nov 14 '05

re: Showing an picture in a dialog box (WinAPI)


Joel ELISE wrote:[color=blue]
> 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
>[/color]
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
Alan Balmer
Guest
 
Posts: n/a
#3: Nov 14 '05

re: Showing an picture in a dialog box (WinAPI)


On Fri, 06 May 2005 17:04:08 -0400, Joel ELISE <j-elise@wanadoo.fr>
wrote:
[color=blue]
>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.[/color]

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.

--
Al Balmer
Balmer Consulting
removebalmerconsultingthis@att.net
Malcolm
Guest
 
Posts: n/a
#4: Nov 14 '05

re: Showing an picture in a dialog box (WinAPI)



"Joel ELISE" <j-elise@wanadoo.fr> wrote[color=blue]
>
> 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++.
>[/color]
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.


Emmanuel Delahaye
Guest
 
Posts: n/a
#5: Nov 14 '05

re: Showing an picture in a dialog box (WinAPI)


Malcolm wrote on 07/05/05 :[color=blue]
> What Microsoft do is write the basic calls for their operating system in C,[/color]

[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

Malcolm
Guest
 
Posts: n/a
#6: Nov 14 '05

re: Showing an picture in a dialog box (WinAPI)


"Emmanuel Delahaye" <emdel@YOURBRAnoos.fr> wrote[color=blue]
>[color=green]
>> What Microsoft do is write the basic calls for their operating system in
>> C,[/color]
>
> [way off-topic]
>[/color]
We're going a bit OT but the ng is quiet at the moment.[color=blue]
>
> This is a common misleading. The interface of a DLL function is more
> Pascal or Visual BASIC than C (forbidding variadics, for example).[/color]
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.


Richard Bos
Guest
 
Posts: n/a
#7: Nov 14 '05

re: Showing an picture in a dialog box (WinAPI)


Thomas Matthews <Thomas_MatthewsSpamBotsSuck@sbcglobal.net> wrote:
[color=blue]
> Yes it is, many applications do this.
> Get a good book on programming for Windows.
> Many people recommend Charles Petzold's books.[/color]

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
Closed Thread