Announcement

Collapse
No announcement yet.

Can you load start button?

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

  • Can you load start button?

    Fellow programmers,
    Is it possible to load the Windows start button as an icon or a bitmap,
    in the way the regular MsgBox icons can be retrieved?

    ------------------
    mailto:[email protected][email protected]</A>
    www.basicguru.com/zijlema/

    Egbert Zijlema, journalist and programmer (zijlema at basicguru dot eu)
    http://zijlema.basicguru.eu
    *** Opinions expressed here are not necessarily untrue ***

  • #2
    Sure... capture the desktop with PRINTSCREEN, and clip the button image, then use that image on an IMGBUTTON control...

    Or have I misinterpreted your request?


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

    Comment


    • #3
      Lance,

      You indeed dit'nt get the picture right. I mean one of the 2 methods as coded below.
      Can someone explain the difference (except from the order of appearance)? And which
      method is the preferred one? I can't find the values 100 thru 105 in WIN32API.INC,
      so obviously there are no meaningful equates for this method?

      Code:
      #COMPILE EXE
      #INCLUDE "WIN32API.INC"
       
      FUNCTION PbMain() AS LONG
        LOCAL hDlg AS LONG, hIcon AS LONG, cx AS LONG, count AS LONG
         
        cx = -10
        DIALOG NEW 0, " Default Windows icons", , , 140, 90, %WS_SYSMENU TO hDlg
        cx = -10
        FOR count = %IDI_APPLICATION TO %IDI_WINLOGO ' = 32512 - 32517
          cx = cx + 20
          CONTROL ADD LABEL, hDlg, count, "", cx, 10, 0, 0, %SS_ICON
          hIcon = LoadIcon(0, BYVAL count)
          IF count = %IDI_APPLICATION THEN
            SendMessage hDlg, %WM_SETICON, 1, hIcon
          END IF
          SendDlgItemMessage hDlg, count, %STM_SETIMAGE, %IMAGE_ICON, hIcon
        NEXT
         
        cx = -10
        FOR count = 100 TO 105
          cx = cx + 20
          CONTROL ADD LABEL, hDlg, count, "", cx, 40, 0, 0, %SS_ICON
          hIcon = LoadImage(BYVAL 0, BYVAL count, %IMAGE_ICON, 0, 0, 0)
          SendDlgItemMessage hDlg, count, %STM_SETIMAGE, %IMAGE_ICON, hIcon
        NEXT
        DIALOG SHOW MODAL hDlg
      END FUNCTION
      ------------------
      mailto:[email protected][email protected]</A>
      www.basicguru.com/zijlema/

      [This message has been edited by Egbert Zijlema (edited October 24, 2000).]

      Egbert Zijlema, journalist and programmer (zijlema at basicguru dot eu)
      http://zijlema.basicguru.eu
      *** Opinions expressed here are not necessarily untrue ***

      Comment


      • #4
        Well, it's 6 of one, half a dozen of the other...

        The LoadIcon() method is better documented for sure... LoadImage is using the ID of the icons, whereas LoadIcon() is using a set of predefined equates.

        IIRC, internally, LoadIcon() actually calls LoadImage(), so the latter may slightly reduce the overhead, but there is little advantage.

        I'd suggest you use whichever method is more comfortable for you. Personally I usually use the LoadIcon() API as there are fewer parameters to type.

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

        Comment

        Working...
        X