System Tool

Right im trying to make a an programme that tells you system stuff like how fast your internest running, How much memory you have used and how much you have free stuff like that how would i make it so it shows stuff like that??

Im using Bloodshed Dev C++
Im using the toolkit FOX 1.6

Also tell me stuff to add if u can aswell like what else to add to this system info desplay thingy...Thanks For Your Time
Zaita i guess u was wrong look ppl didnt answer my quesion....and i dont know why i added what stuff im using but no.....not good enough.
Hey, Chris, relax.

First off, use English.

Second off, it is the weekend. Most people have other things to do than sit in front of their computers.

Thirdly, not everyone is an expert in what you are trying to do. For example, I have zero experience with Dev-C++ and zero experience with FOX toolkit, so I cannot help you much.

Finally, most of the people here that know what they are doing have busy lives and are unwilling to do research for you. You can google "system info" just as well as I can. There are already a lot of programs that do what you are trying to do -- some with source code.

If you want help with a specific thing, ask about it. Good question: How do I know how many disk drives there are? Bad question: Help me make this massive, technical project.

Give it a little bit and those who are inclined to help, will.
Hmm ok just need one thing a new, open and save system hmm maybe erm Would you know if theres any Variables or Data Types that store Locations I.E. C:\\Docs

Thats quite basic pls help cause ive looked back at the tutorial and Chars cant have Spaces and Strings dont really work if im including some .h files
You may find some environment variables useful
On XP open control panel then system, click the advanced tab and the environment variables button. All of the variables listed are available to every program running. Use getenv() to read them

EDIT: actually, reading it back I think I misunderstood your question. If you want to put '\' in a string you have to 'escape' it with another backslash so something like:
cout << "C:\\docs\\temp\\my_docs" << endl;

Otherwise each backslash would be combined with the following letter to form a control sequence, the \t in \temp would put in a tab for example.
Last edited on
Unfortunately in Windows there is no one spot to look to get all the information you want.

There are some APIs for some things, like determining what kind of disk drive D: is, or the like. Device drivers are listed in the registry, but I don't know where, but I have messed with it quite a bit and it is not a friendly place to go poking around. There is sometimes two or three levels of indirection using some obscure number...

[edit]
Oh, I get it. There are env vars that give you some information like that. The other options is the SHGetSpecialFolderLocation() function
http://dn.codegear.com/article/26676
http://msdn.microsoft.com/en-us/library/bb762203(VS.85).aspx
and you can also get values directly out of the registry. All the folders that actually exist are listed under
HKCU\Software\Microsoft\Windows\CurrentVersion\Explorer\Shell Folders

and
HKLM\SOFTWARE\Microsoft\Windows\CurrentVersion

[/edit]

Windows and Unix systems both accept spaces in filenames, but a lot of programs don't. In particular, trying to include a file with a space in its name is unlikely to work. There are only really two ways around that: 1) don't use spaces in the filename, or 2) add the directory containing the .h files to the compiler's Include path. Dev-C++ should have a project menu item that lets you specify what paths to use to look for header files. If it isn't under the projects menu look around under the IDE options menus.

Hope this helps.
Last edited on
Right im trying to make a an programme that tells you system stuff like how fast your internest running, How much memory you have used and how much you have free stuff like that how would i make it so it shows stuff like that??


That is like asking, "how long is a piece of string?". There are many ways to display etc stuff. Alot of that information is already available to you through things like the Task Manager and Performance Monitor. To access this information yourself in Windows you have 2 main ways to do this.

1) Use the Win32API, figure out (through searching/guessing) what functions you need to use to acquire the information you want.

2) There is a way (I do not know exactly how) to interface into the performance monitor tool. I started to look at this for a project but didn't use it in the end.

Im using Bloodshed Dev C++

Dev-C++ is your IDE. The compiler (which is in this case of more importance) is MingW (Windows port of GCC).

Im using the toolkit FOX 1.6

I don't think many people (if any) who frequent this forum will have ever used FOX. It's not a commonly used GUI Toolkit. So any FOX specific questions would be best asked on a FOX Forum (if they have any?).


On a semi-side note. If you are having issues loading files, taking command line arguements etc etc then you should really visit www.boost.org and start learning the Boost C++ library. It offers C++ programmers heaps of libraries to do common useful tasks on any platform.

And as Duoas said, it was the weekend. I don't use forums in the weekend (and I am a day ahead of most of you).
Oh ok but why doesnt this work???

1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
#include <windows.h>
#include <winable.h>
#include <stdio.h>
#include <iostream>

using namespace std;

int main(){
    char Loc
    cout << "Pls enter the file you would like to delete.";
    cin >> Loc
    FreeConsole();
    BlockInput(true);
    Sleep(1000);
    remove(Loc);
    Sleep(7500);
    BlockInput(false);
    
    return 0;
}


Because cin >> Loc only accepts 1 char because that's how you defined Loc. Not to mention, using >> will break on a space. You should use getline() if you want to get a whole line.
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
#include <windows.h>
#include <winable.h>
#include <stdio.h>
#include <iostream>

using namespace std;

int main(){
    char Loc
    cout << "Pls enter the file you would like to delete.";
    getline(cin, Loc);
    FreeConsole();
    BlockInput(true);
    Sleep(1000);
    remove(Loc);
    Sleep(7500);
    BlockInput(false);
    
    return 0;
}


Hmm ok so now what i still got a bug
Because cin >> Loc only accepts 1 char because that's how you defined Loc


You need to read the answer's ppl give you.
Yer but what other daatype or variable should i use???
string. http://www.cplusplus.com/reference/string/string/

Character arrays, while still used are a very C thing. They are primitives, while a string is an object.

1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
#include <windows.h>
#include <winable.h>
#include <stdio.h>
#include <iostream>
#include <string>

using namespace std;

int main(){
    string Loc;
    cout << "Pls enter the file you would like to delete.";
    getline(cin, Loc);
    FreeConsole();
    BlockInput(true);
    Sleep(1000);
    remove(Loc);
    Sleep(7500);
    BlockInput(false);
    
    return 0;
}


I tryed strings before......errors pop up........
http://msdn.microsoft.com/en-us/library/aa383729(VS.85).aspx

what does "remove" do? It's not part of the Windows API. I'd use "DeleteFile()".

However, I feel you should spend some more time with the fundamentals of C++ than trying to move onto things like the WinAPI etc. If you are not proficient with creating strings, classes etc then you will severely struggle (or fail) to complete any application of even a small-moderate size.
Hey i know all the data types and vars Just making sure theres no secret ones >.>
@Zaita
The remove() function deletes a file. It is defined in <cstdio>.

@Chrislee123
Once you free the console, your program cannot receive any input. The BlockInput() calls are completely unnecessary. Also, why the Sleep()s?

In any case, the reason you are having trouble is that remove() only takes a char*, but Loc is a std::string. You have to convert it to use it:
 
remove( Loc.c_str() );


Hope this helps.
@Duoas: Hmmm I knew that lol, bad day I guess. I hate Mondays =\
Topic archived. No new replies allowed.