Showing an picture in a dialog box (WinAPI)

Discussion in 'C Programming' started by Thomas Matthews, May 6, 2005.

  1. 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
     
    Thomas Matthews, May 6, 2005
    #1
    1. Advertising

  2. Thomas Matthews

    Joel ELISE Guest

    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:
    alt e-mail : mailto:
    ICQ # : 17405316
    *************************************
    GAGNEZ DE L'ARGENT EN LISANT DES EMAILS
    http://www.sendmoreinfo.com/id/1563434
    EARN MONEY READING EMAILS
     
    Joel ELISE, May 6, 2005
    #2
    1. Advertising

  3. Thomas Matthews

    Alan Balmer Guest

    On Fri, 06 May 2005 17:04:08 -0400, 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.


    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
     
    Alan Balmer, May 6, 2005
    #3
  4. Thomas Matthews

    Malcolm Guest

    "Joel ELISE" <> 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.
     
    Malcolm, May 7, 2005
    #4
  5. [OT] Re: Showing an picture in a dialog box (WinAPI)

    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
     
    Emmanuel Delahaye, May 7, 2005
    #5
  6. Thomas Matthews

    Malcolm Guest

    Re: [OT] Re: Showing an picture in a dialog box (WinAPI)

    "Emmanuel Delahaye" <> 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.
     
    Malcolm, May 8, 2005
    #6
  7. Thomas Matthews

    Richard Bos Guest

    Thomas Matthews <> 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
     
    Richard Bos, May 9, 2005
    #7
    1. Advertising

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

It takes just 2 minutes to sign up (and it's free!). Just click the sign up button to choose a username and then you can ask your own questions on the forum.
Similar Threads
  1. Henry Lee
    Replies:
    1
    Views:
    8,972
    =?ISO-8859-1?Q?G=F6ran_Andersson?=
    May 3, 2006
  2. R

    WinAPI and data box

    R, May 20, 2004, in forum: C Programming
    Replies:
    1
    Views:
    356
    Joona I Palaste
    May 20, 2004
  3. Husam

    Showing The Download Dialog Box?

    Husam, Mar 17, 2008, in forum: ASP .Net
    Replies:
    5
    Views:
    2,760
    André de Sousa Araujo
    Oct 7, 2009
  4. tw
    Replies:
    3
    Views:
    562
  5. Replies:
    8
    Views:
    1,291
    Mick White
    Apr 19, 2005
Loading...

Share This Page