home *** CD-ROM | disk | FTP | other *** search
- Path: mail2news.demon.co.uk!topic.demon.co.uk
- From: Mark Paddock <mark@topic.demon.co.uk>
- Newsgroups: comp.sys.amiga.programmer
- Subject: Re: How to get ModeID from it's name?
- Date: Fri, 1 Mar 96 21:04:07 GMT
- Organization: Home
- Message-ID: <9603012104.AA000q1@topic.demon.co.uk>
- References: <4h6puc$21p@leofric.coventry.ac.uk>
- X-NNTP-Posting-Host: topic.demon.co.uk
- X-Newsreader: TIN [version 1.2 PL3]
- X-Mail2News-Path: disperse.demon.co.uk!post.demon.co.uk!topic.demon.co.uk
-
- Dave Jackson (dj@coventry.ac.uk) wrote:
-
- : Ok, I've tried everything! How can I get the ModeID from a string like:
-
- : "MULTISCAN:Productivity"
- : or
- : "DBLNTSC:Low Res"
-
- : There must be something I'm missing!
-
- The following "should" do it:
-
- ULONG id = (ULONG)INVALID_ID;
- ULONG myid = (ULONG)INVALID_ID;
- struct NameInfo buff;
-
- id = NextDisplayInfo(id);
- while ((id != INVALID_ID) && (myid == INVALID_ID)) {
- if (GetDisplayInfoData(NULL,(UBYTE *)&buff,
- sizeof(struct NameInfo),DTAG_NAME,id)) {
- if (!Stricmp(Name,buff.Name)) { // Name is the string
- myid = id;
- }
- }
- id = NextDisplayInfo(id);
- }
-
- However sometimes it does not seem to work. Can anyone fix it?
-
- Mark
-