Announcement

Collapse
No announcement yet.

disappearing bitmap in dialog

Collapse
X
 
  • Filter
  • Time
  • Show
Clear All
new posts

  • disappearing bitmap in dialog

    I have a really weird problem here. I have made a 'splash' screen using the resource editor from Visual C++. It's nothing more than a dialog with only a bitmap on it, and this works fine. But I thought: let's add a small text label below the bitmap, with the version number. I add the label, save the file as .rc and as .res, run pbres, compile the program, and guess what? The bitmap isn't visible anymore! Only the text label I added. When I remove the label (and save the file as .rc and as .res, run pbres, compile the program), the bitmap shows up again. Adding any control to the dialog makes the bitmap disappear.

    I use the following to display the splash screen:

    #RESOURCE "icon.pbr" 'contains the dialog, the used bitmap
    'and some icons

    %IDD_DIALOG1 = 101 'id of the dialog

    hSplash& = CreateDialog(CurInst, BYVAL CLNG(%IDD_DIALOG1), 0,_
    CODEPTR(Splash))

    ShowWindow hSplash&, %SW_SHOWNORMAL


    Am I doing something wrong?

    All the best,

    Harmen Mesker.

  • #2
    Can we see the .RC and .H files?

    Are you using PowerGEN? If so, did your rerun PowerGEN on the modified RC file or just recompile the existing (initial) template?

    ------------------
    Lance
    PowerBASIC Support
    mailto:[email protected][email protected]</A>
    Lance
    mailto:[email protected]

    Comment


    • #3
      Hi Lance,

      Thank you for your reply. I must admit to my embarrassment that I probably have found the error. Looking at the examples Petzold gives, I noticed it's best to put an UpdateWindow command after the first ShowWindow. And that's what I didn't do, and it caused the strange behavior.

      Best regards,

      Harmen.



      ------------------

      Comment


      • #4
        I'll use this subject heading for a related subject:

        I was just wondering about programmer comments concerning graphics statements that are in DOS Basic but not in the DLL compiler. Then there is the question of a mouse click of the graphic. Just looking for an over-view that does not include an application form to attend the University of Microsoft.

        ------------------

        Comment


        • #5
          Mr Hall,

          Drawing in the client area of a dialog/window is very easy - just handle the %WM_PAINT event in your dialog/window callback and use the API functions to do the drawing - these API's are more complex than you would be used to with DOS basic, but the API is incredibly more powerful!!!

          To detect a click in the client area of a dialog/window is also fairly easy to achieve but the technique involved will vary depending on whether you are using standard windows, dialogs or DDT. Essentially, you need to catch %WM_LBUTTONDOWN message.

          There is no way to fully explain these concepts in 1 paragraph, because a reasonable understanding of how windows processes messages and handles drawing is required. We could show you how to do it, but without the "background" on how it all works behind the scenes, it will just be confusing.

          On the other hand, you do not need to attend university either - just pick yourself up a good API book such as the Petzold book and start reading. See the FAQ forum for a list of recommended titles.



          ------------------
          Lance
          PowerBASIC Support
          mailto:[email protected][email protected]</A>
          Lance
          mailto:[email protected]

          Comment

          Working...
          X