Announcement

Collapse
No announcement yet.

*.Res-Datei verwenden?

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

  • *.Res-Datei verwenden?

    Hallo.<br><br>Ich Habe mal wieder ein Problem...<br><br>Wie Kann man ein Icon/ einen Cursor in einer *.res-Datei (also eine Ressourcendatei) in Delphi 5 verwenden? <br><br>Konkret: ich habe in einer solchen Datei einige Bitmaps, einige Symbole und Cursoren untergebracht. <br>Wie Die bitmaps geladen werden, habe ich rausgefunden:<br>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nb sp;&nbsp;<b>BitBtn.Glyph.LoadFromResourceName(0, 'NameDerBitmap');</b><br><br>Gibt es sowas auch für Icons bzw. Cursoren, also z.B.:<br>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp ;<b>Form1.Icon.LoadFromResourceName(0, 'NameDesIcons');</b><br><br>oder<br>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&n bsp;&nbsp;<b>BitBtn.Cursor.LoadFromResourceName(0, 'NameDesCursors);</b><br><br>Vielen Dank schonmal im Voraus.<br><br><i>PS: Kennt jemand einen guten Editor für rc-Dateien?</i>
    If it's there and you can see it – it's REAL
    If it's there and you can't see it – it's TRANSPARENT
    If it's not there and you can see it – it's VIRTUAL
    If it's not there and you can't see it – it's GONE!

  • #2
    Hallo Christian,
    .
    für Cursor habe ich es folgendermaßen gelöst:
    .
    Screen.Cursors[5] := LoadCursor(hInstance,'NameDesCursors');
    BitBtn.Cursor := 5;
    .
    Hans

    Comment


    • #3
      Danke.
      und wie ist das mit den Icons?
      <br>
      Gruß, Christian
      If it's there and you can see it – it's REAL
      If it's there and you can't see it – it's TRANSPARENT
      If it's not there and you can see it – it's VIRTUAL
      If it's not there and you can't see it – it's GONE!

      Comment


      • #4
        In der Win32-Hilfe habe ich eine Routine LoadIcon(), welche analog zu LoadCursor() verwendbar sein sollte, gefunden. Ich habe es aber selber noch nicht ausprobiert.
        .
        Hans

        Comment


        • #5
          Vielen Dank!
          <br>
          So funktionierts mit den icons:
          <br><b>
          procedure TForm1.FormCreate(Sender: TObject);
          var Icon: TIcon;
          begin
          Icon := TIcon.Create;
          Icon.Handle := LoadIcon(hInstance, 'IconName');
          Form1.Icon := Icon;
          end;</b>
          <br>
          Danke
          If it's there and you can see it – it's REAL
          If it's there and you can't see it – it's TRANSPARENT
          If it's not there and you can see it – it's VIRTUAL
          If it's not there and you can't see it – it's GONE!

          Comment

          Working...
          X