AGB  ·  Datenschutz  ·  Impressum  







Anmelden
Nützliche Links
Registrieren
Zurück Delphi-PRAXiS Programmierung allgemein Win32/Win64 API (native code) Delphi Monitor Name via Enumdisplaydevices
Thema durchsuchen
Ansicht
Themen-Optionen

Monitor Name via Enumdisplaydevices

Ein Thema von Razor · begonnen am 19. Feb 2009 · letzter Beitrag vom 20. Feb 2009
Antwort Antwort
Razor
(Gast)

n/a Beiträge
 
#1

Monitor Name via Enumdisplaydevices

  Alt 19. Feb 2009, 16:40
Ive tried many variations of it.Also Muetze's version.But that can only be used in a listbox.

Is it possible to get a name of monitor based on how many Video cards you have.

( eg. 1: generic monitor on ATI HD 3870 )
( eg. 2: generic monitor on ATI HD 3870 )
  Mit Zitat antworten Zitat
Muetze1
(Gast)

n/a Beiträge
 
#2

Re: Monitor Name via Enumdisplaydevices

  Alt 19. Feb 2009, 21:41
Zitat von Razor:
Ive tried many variations of it.Also Muetze's version.But that can only be used in a listbox.
You are unable to modify that source? You are unable to post or link that code here that anybody else can modify it for you?

The source is definitly not written to just use a TStrings descendant, it was just one possible way to ouptput all informations.

All the months or years it is still annoying to see, how your learning process goes (on).
  Mit Zitat antworten Zitat
Razor
(Gast)

n/a Beiträge
 
#3

Re: Monitor Name via Enumdisplaydevices

  Alt 20. Feb 2009, 14:56
You are still the same Muetze i can concur to that
  Mit Zitat antworten Zitat
Razor
(Gast)

n/a Beiträge
 
#4

Re: Monitor Name via Enumdisplaydevices

  Alt 20. Feb 2009, 16:41
I only needed string not so much as you showed.But tell me if its ok what i modifyed.


Delphi-Quellcode:
function tform4.monitorname(numberof:integer):string; //does cntr control wich outputs is it for couse i have 2 video DVI outputs.
Var
  Cntr : Cardinal;
  Info : TDisplayDevice;
  AdapterName : PChar;
  OldPos ,j,i : Integer;
  a:tstringlist;
Begin

  a:=tstringlist.create;
  Cntr := numberof;
  Info.cb := SizeOf(Info);
  While EnumDisplayDevices(Nil, Cntr, Info, 0) Do
  Begin


    AdapterName := StrAlloc(SizeOf(Info.DeviceName));
    StrCopy(AdapterName, Info.DeviceName);
    EnumDisplayDevices(AdapterName, 0, Info, 0);

    a.add(info.DeviceString);
   for I := 1 to a.count - 1 do begin
    a.Delete(i);

    result:=a.Strings[0];
    StrDispose(AdapterName);

    Inc(Cntr);

  End;

End;
End;
  Mit Zitat antworten Zitat
Antwort Antwort


Forumregeln

Es ist dir nicht erlaubt, neue Themen zu verfassen.
Es ist dir nicht erlaubt, auf Beiträge zu antworten.
Es ist dir nicht erlaubt, Anhänge hochzuladen.
Es ist dir nicht erlaubt, deine Beiträge zu bearbeiten.

BB-Code ist an.
Smileys sind an.
[IMG] Code ist an.
HTML-Code ist aus.
Trackbacks are an
Pingbacks are an
Refbacks are aus

Gehe zu:

Impressum · AGB · Datenschutz · Nach oben
Alle Zeitangaben in WEZ +1. Es ist jetzt 01:24 Uhr.
Powered by vBulletin® Copyright ©2000 - 2024, Jelsoft Enterprises Ltd.
LinkBacks Enabled by vBSEO © 2011, Crawlability, Inc.
Delphi-PRAXiS (c) 2002 - 2023 by Daniel R. Wolf, 2024 by Thomas Breitkreuz