473,506 Members | 9,749 Online
Bytes | Software Development & Data Engineering Community
+ Post

Home Posts Topics Members FAQ

Showing an picture in a dialog box (WinAPI)

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

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
Nov 14 '05 #2
On Fri, 06 May 2005 17:04:08 -0400, Joel ELISE <j-*****@wanadoo.fr>
wrote:
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.

--
Al Balmer
Balmer Consulting
re************************@att.net
Nov 14 '05 #3

"Joel ELISE" <j-*****@wanadoo.fr> wrote

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.
Nov 14 '05 #4
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

Nov 14 '05 #5
"Emmanuel Delahaye" <em***@YOURBRAnoos.fr> wrote
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.
Nov 14 '05 #6
Thomas Matthews <Th*************************@sbcglobal.net> wrote:
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
Nov 14 '05 #7

This thread has been closed and replies have been disabled. Please start a new discussion.

Similar topics

6
1788
by: Patrick | last post by:
How do you insert a jpg picture from file on to an area of a dialog box I can do this using picturebox to insert a jpg picture onto a form, but the picturebox control is not available for a...
2
14539
by: Geoff Turner | last post by:
Hi all, I have an application that requires me to load an image into a picture or image or picclip control.Picture will be JPG format and of size 800 X 600 pixels. It will be displayed as say, 200...
1
1888
by: blazingmavrick | last post by:
My problem consits of the following:- i am creating mulitple picturebox's, when the user double clicks on the picture box it opens the opendialog box to load a picture (jpeg only) into the picture...
6
13470
by: kdikert | last post by:
I have a worker thread, and when the worker is done I want it to show a popup dialog. The sample application below demonstrates this. There are two buttons: a "Show dialog" button which immediately...
0
7371
jinu1996
by: jinu1996 | last post by:
In today's digital age, having a compelling online presence is paramount for businesses aiming to thrive in a competitive landscape. At the heart of this digital strategy lies an intricately woven...
1
7023
by: Hystou | last post by:
Overview: Windows 11 and 10 have less user interface control over operating system update behaviour than previous versions of Windows. In Windows 11 and 10, there is no way to turn off the Windows...
0
7479
tracyyun
by: tracyyun | last post by:
Dear forum friends, With the development of smart home technology, a variety of wireless communication protocols have appeared on the market, such as Zigbee, Z-Wave, Wi-Fi, Bluetooth, etc. Each...
0
5617
agi2029
by: agi2029 | last post by:
Let's talk about the concept of autonomous AI software engineers and no-code agents. These AIs are designed to manage the entire lifecycle of a software development project—planning, coding, testing,...
1
5037
isladogs
by: isladogs | last post by:
The next Access Europe User Group meeting will be on Wednesday 1 May 2024 starting at 18:00 UK time (6PM UTC+1) and finishing by 19:30 (7.30PM). In this session, we are pleased to welcome a new...
0
3188
by: TSSRALBI | last post by:
Hello I'm a network technician in training and I need your help. I am currently learning how to create and manage the different types of VPNs and I have a question about LAN-to-LAN VPNs. The...
0
3178
by: adsilva | last post by:
A Windows Forms form does not have the event Unload, like VB6. What one acts like?
1
757
muto222
by: muto222 | last post by:
How can i add a mobile payment intergratation into php mysql website.
0
410
bsmnconsultancy
by: bsmnconsultancy | last post by:
In today's digital era, a well-designed website is crucial for businesses looking to succeed. Whether you're a small business owner or a large corporation in Toronto, having a strong online presence...

By using Bytes.com and it's services, you agree to our Privacy Policy and Terms of Use.

To disable or enable advertisements and analytics tracking please visit the manage ads & tracking page.