|
Windows Managment Instrumentation will give you that information.
See http://msdn.microsoft.com/library/en-us/wmisdk/wmistart_5kth.asp
Cheers!
Colin Bowern, Consultant
Enterprise Platform Solutions
Microsoft Services (Canada)
|
|
|
|
|
Search for DISPLAY_DEVICE in your help.
Then,
BOOL EnumDisplayDevices(
PVOID Unused, // not used; must be NULL
DWORD iDevNum, // specifies display device
PDISPLAY_DEVICE lpDisplayDevice, // pointer to structure to
// receive display device information
DWORD dwFlags // flags to condition function behavior
);
Will fill the structure with device information.
typedef struct _DISPLAY_DEVICE {
DWORD cb;
WCHAR DeviceName[32];
WCHAR DeviceString[128];
DWORD StateFlags;
} DISPLAY_DEVICE, *PDISPLAY_DEVICE, *LPDISPLAY_DEVICE;
Please note that these are marked as 'Preliminary' on my system so check with the microsoft developers site to ensure there have not changed. Specifically on a Win2000/NT.
We do it for the joy of seeing the users struggle.
|
|
|
|
|
I decided I had better add a warning.
These 'DisplayDevice' functions will link you to the DEVMODE structure and it's functions. Don't play arround with these unless you really know what you are doing, its quite possible to blow your monitor by using incorrect settings.
Though at the same time there is some information contained here that can be used by 'precision graphics' programmers. If you do look at this area then treat it as a source of information rather than a place to change things.
We do it for the joy of seeing the users struggle.
|
|
|
|
|
Hi anyone have the source code on log out in asp.
Thanz
|
|
|
|
|
as there r different types of food in my menu.In order to display it in the browser wat the customer had ordered,i need to program it in the sense that it was sent to their respective columns.For example,when he chose steak,steak was inserted into the field "steak".how m i going to make the program to insert the food into their respective field???
|
|
|
|
|
I don't understand your question. What kind of input form? Are you trying to insert data from a form into a database? You'll need to provide a clearer defintion of your problem if you want to get any useful help.
Michael
|
|
|
|
|
how to compare whether the item is of the same name as the field name...i need to insert the item to the field name which both r the same
aaa
|
|
|
|
|
Come on ginny, we need a bit more of a clue to answer your questions. But I like a challenge so I'll have a go at what I think you were asking.
I guess that you are writing a database application and do not know how to decide what field that data ought to go into from, say an edit box. So, from that I suspect you basically want to know how to design a database.
A database consists of,
the data - a means of receiving/writing the data - one or more views/interfaces.
Lets create a data table first. This is a list of fields and the type of data that field can hold, so we might create a table such as,
Table name = People
Field1 Name=ItemID Type=Long
Field2 Name=Name Type=Text
Field3 Name=Age Type=Integer
In row/column form this looks like
ItemID Name Age
100 Bob 43
101 Sharon 25
The means of receiving/writting to the database can be simple 'hardcoded' or SQL/ODBC. Hardcoded is obviously dependent upon the language you are using.
In VBA (Access) it can be just,
dim dbs as database
dim rst as recordset
set dbs = CurrentDB
set rst = dbs.OpenRecordSet("People",dbOpenDynaset)
with rst
{move to the record you want or .AddNew}
.Edit
!ItemID = NextAvailableID() (or use AutoNumber in Access)
!Name = "Sally"
!Age = 56
.Update
wend
Thats only to give you a starting point. Actually I think Excel/Lotus123 are very good places to learn database techniques in code.
In the 'data input' view, lets assume a simple form view, you would have an edit box for each field that the user can edit.
Edit Box 1 = Name
Edit Box 2 = Age
In this case you wouldn't want the user entering the ItemID since you want to ensure this is unique.
On pressing Enter (or selecting a button) your code updates or creates a new record in the data.
A good way to learn how databases work if your in C++ is to work with your own tables/queries/views. So that you write and experiment with each area in a place where you have full control over it.
So you might start with a simple structure such as,
class CDataNode
{
long m_ItemID;
char m_Name[30];
int m_Age;
};
Then write a class that takes care of lists of this type, avoid making use of the ready made list templates at this point since the whole purpose is to learn how to manipulate the data yourself. But of cause the likes of CMap (and its children) are extreemly usefull later.
class CDataList
{
public:
int AddNode(CDataNode* NewNode);
CDataNode GetNode(int NodeRefference);
{other functions that manipulate your data}
private:
CDataNode **m_ptrToptrOfDataNodeType;
{or for the purposes of the excercise simplify it to}
CDataNode m_MyData[SOME_MAX_NUMBER_OF_ITEMS];
};
Then you would write a view class (or rather put it into a ready made View class.
class CMyView : public CFormView
{
CDataList m_MyDataList;
//other functions that control the interface between the data and the user.
};
As you are working with this you will inevitably come across areas where your unsure if a function is part of the data or part of the view. For example in an accounts program you might have to add TAX to the user edited value. The resulting value goes into the database, but where does the calculation belong, in CDataList or in CView? I'm not going to say, it is up to you, the budding programmer, to work this out.
I obviously haven't written this in full, but you have to do some of the work yourself. Learning how to code is not programming, thats just learning a language. Programming is turning physical ideas in to programatic form, for that you need to excercise your own logic.
We do it for the joy of seeing the users struggle.
|
|
|
|
|
as i m not going to send the data together,how m i able to send the data column by column but still stays at the same row????
|
|
|
|
|
hi u know ip phone can u send mi some example
|
|
|
|
|
You question isn't clear. What IP phone are you trying to program? You need post the code you are having problem with or provide more details. Most IP Phones have different methods of use. More info is needed.
Michael
|
|
|
|
|
Can someone tell me how to easily delete a non-empty directory. I am aware of the 'RemoveDirectory' api but it states in its documentation that it only deletes an empty directory. Is there an easy way to do this. I was thinking of using the ShellExecutre API and calling the 'RD' or 'RMDIR' dos commands, but I cant path to these programs.
Thank you.
|
|
|
|
|
Why ShellExecute? You can use system , defined in process.h
I vote pro drink
|
|
|
|
|
Classic recursion. Here's some pseudo code:
RecursiveDelete(directory)
If f = GetFirstFile(directory)
do
If f is a directory
RecursiveDelete(sub-directory)
else
DeleteFile(file)
while (f = GetNextFile())
RemoveDirectory(directory)
|
|
|
|
|
SHFileOperation() will do it. I have a wrapper class in the Shell section here on CP to make it easier to use, as well.
--Mike--
http://home.inreach.com/mdunn/
"....." -- Silent Bob
your with and
|
|
|
|
|
BOOL ClearDirectory(const char *path, BOOL recurs, BOOL deldirs)
{
if(!path)
return FALSE;
char xpath[512]="";
strcpy(xpath,path);
HANDLE hFile;
WIN32_FIND_DATA findData;
BOOL Go=TRUE;
char fullp[500]="";
char pattern[500]="";
if(xpath[strlen(xpath)-1]!='\\')
strcat(xpath,"\\");
if(!IsDirectory(xpath))
return FALSE;
strcpy(pattern,xpath);
strcat(pattern,"*.*");
hFile=FindFirstFile(pattern,&findData);
while((hFile!=INVALID_HANDLE_VALUE)&&(Go))
{
if((strcmp(findData.cFileName,".")!=0)&&(strcmp(findData.cFileName,"..")!=0))
{
strcpy(fullp,"");
sprintf(fullp,"%s%s",xpath,findData.cFileName);
if(IsDirectory(fullp))
{
ClearDirectory(fullp,recurs,deldirs);
strcat(fullp,"\\");
if(deldirs)
RemoveDirectory(fullp);
}
else
{
SetFileAttributes(fullp,128);
DeleteFile(fullp);
}
}
ZeroMemory((void*)&findData,sizeof(findData));
Go=FindNextFile(hFile,&findData);
}
FindClose(hFile);
if(deldirs)
RemoveDirectory(xpath);
return TRUE;
}
//rate me or hate
I am the mighty keeper of the book on knowledge . Contact me to get your copy .
|
|
|
|
|
Hi Folks,
this problem:
I have a filled CRect:
kind of: dc.FillRect(MyRect, &MyBrush);
Thow I want to create a Progressbar.
Can somebody explain me, how to make shaded one ?
Or more general how to make a gradient flow, from e.g. black to white?
thx a lot
bye
murphman;P
|
|
|
|
|
As FillRect is so fast you could fill different sized Rect's. Example,
int iWidth;
CRect MyRect;
MyRect.Left = 0;
MyRect.top = 0;
MyRect.bottom = 50;
for( MyRect.right = 1; MyRect.right < SOME_VALUE ; MyRect.right++)
{
dc.FillRect,MyRect,&MyBrush);
//do some of whatever your progress bar is monitoring
}
Now then. I'm not one to pass up an opertunity to add a thing or two so,
Once you have got the idea of a progress bar written like this, and assuming you don't want to use a ready made one, you now want to turn your progress bar into something you never have to write again. There are two ways, you could write an ActiveX control, which is fine if you like that sort of thing. Or you could simply keep it as a class (help in your library of classes).
Ex
class CMyProgressBar : public CObject
{
Create(int FromValue, int ToValue, int NumberOfSteps,CRect PossitionAndSize);
StepProgress(CDC* pDC);
};
etc
We do it for the joy of seeing the users struggle.
|
|
|
|
|
how to insert variable into database.For example,there r 4 food in the menu,how am i going to insert the chosen food into my database???is there other alternative besides using hardcoding???
|
|
|
|
|
|
Does anyone have an example of how to make those little animated Desktop pals.
They are little windows that sit ontop of the Active window.
I would love to see how this works.
Anyone ?
|
|
|
|
|
Has anyone developed a Visual C++ module to automatically report feedback on bugs, program exceptions (call stack and other program details), etc.. back to a developers web-site? IE6 has this behaviour, if the program crashes, the user can submit the info back to Microsoft. This would be a great addition to our software, but I wondered whether anyone has already developed a great utility to do this, including uploading the info to a web-site?
|
|
|
|
|
|
Hi,
Please tell me of sites where I can find an overview of Sequent Calculus. Also if you know some good books on this subject then let me know.
Thanks,
Mike.
|
|
|
|
|
I am calling an API function that returns an Integer. MSDN documentation states 'The only valid bits in the return value are those that correspond to the bits set in the mask parameter' How do I read these individual bit values.
Regards,
SAK
|
|
|
|