Announcement

Collapse
No announcement yet.

icon on status bar/status bar on dialog.

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

  • icon on status bar/status bar on dialog.

    Hello all!

    I have been able to get an icon on the status bar of a window, however the icon always shows up 32x32 (reallyBIG). Are there any constants that force the icon to show up as 16x16?

    I used LoadIcon(%NULL, byval %IDI_APPLICATION) for the test icon.

    just another oddity: when I supplied LoadIcon with the current window instance no icon showed up, but when I supplied %NULL it did. I don't know why but maybe somebody has come accross the same thing and could tell me why.

    Cheers!

  • #2
    Mark --
    You can use LoadImage and to set necessary sizes during hicon creation.

    Sample:
    In Skeleton.bas

    after Case %WM_MOUSEMOVE insert:
    Static Al As Long
    If Al = 0 Then Al = 1: SendMessage hStatus, %WM_USER + 15, 0, LoadImage(ByVal hInst,"PROGRAM", %IMAGE_ICON, 16, 16, 0)


    [This message has been edited by Semen Matusovski (edited February 19, 2000).]

    Comment


    • #3
      Extract from WIN32.HLP:
      hInstance
      Identifies an instance of the module whose executable file contains the icon to be loaded. This parameter must be NULL when a standard icon is being loaded.
      As Semem says: use LoadImage() instead of LoadIcon().



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

      Comment


      • #4
        Hi all,

        From Win32.hlp:


        The application must call the DeleteObject function to delete each bitmap handle returned by the LoadBitmap function.
        What about LoadImage, anyone have any info, does the returned handle need to be deleted?

        Thanks,

        ------------------
        Kev G Peel
        KGP Software
        Bridgwater, UK.
        mailto:[email protected][email protected]</A>

        [This message has been edited by K Peel (edited February 19, 2000).]

        Comment


        • #5
          Not according to the the API books I have here... the image is automatically released at app termination.


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

          Comment


          • #6
            Quote -- "automatically released at app termination".
            And this means that it's necessary to call LoadImage only one time (per each picture) and to remember the handle in static/global variable.


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

            Comment

            Working...
            X