|
First,thank a lot for your reply.I have checked it as you said.But for winxp and win2000,the usage of function updateDriverForPlugAndPlayDevice() is same.
|
|
|
|
|
I was looking for a code snippet to read the temperature of a CPU. I have a project that trashes the machine and watching the CPU temp seems prudent.
I speculate there is a Winbond chip integrated into the motherboard. So the is obviously direct calls to the chip.
Perhaps there is an API I can call?
Direct reading of the hardware is less desirable than an API as the chip may not be the same in all machines.
http://www.contract-developer.tk
|
|
|
|
|
I personally doubt there is a common API to perform what you want, if i were you i'd try to search for OpenSource motherboard/system monitoring software (e.g. on SourceForge[^]) and study it to learn how they are doing it, it's probably not simple if you want to provide support for multiple systems. If you DO find such an API do tell us, please, good luck.
> The problem with computers is that they do what you tell them to do and not what you want them to do. <
> "It doesn't work, fix it" does not qualify as a bug report. <
> Amazing what new features none of the programmers working on the project ever heard of you can learn about when reading what the marketing guys wrote about it. <
|
|
|
|
|
If needed I guess another template/class can act as an API. When in doubt, drop down to assembler. Then the whole machine is accessible.
http://www.contract-developer.tk
|
|
|
|
|
Assembler or not, different manufacturers give different ways to access such information, if any, even different versions of the same motherboard might give you different ways, sadly. I wonder if there is some kind of a standard for such an information that is just not ingegrated into Windows / no manufacturer really follows, or no such thing exists at all. I mean, graphic card manufacturers provide DirectX compatible drivers for their cards (they ought to, noone would buy their card if they wouldn't...), why not providing drivers for motherboards with such a compatibility...*sigh*, well, one can dream, can one not?
> The problem with computers is that they do what you tell them to do and not what you want them to do. <
> "It doesn't work, fix it" does not qualify as a bug report. <
> Amazing what new features none of the programmers working on the project ever heard of you can learn about when reading what the marketing guys wrote about it. <
|
|
|
|
|
Looks like a glaring omission, as I have searched MSDN and found nothing, Google, no good and on Soureforge the stuff is specific to certain boards only.
I guess I will have to ask users to watch the temps manually when using my benchmarks.
http://www.contract-developer.tk
|
|
|
|
|
When i was googling for this temperature monitoring API thing i saw a link about using Motherboard Monitor to gain temperature information (Motherboard Monitor is a freeware app. that can give you temp and voltage informations afaik), maybe try googling for it, it could be an option, i think the google hit mentioned something about using shared memory to communicate with MBM, if you think, check it.
> The problem with computers is that they do what you tell them to do and not what you want them to do. <
> "It doesn't work, fix it" does not qualify as a bug report. <
> Amazing what new features none of the programmers working on the project ever heard of you can learn about when reading what the marketing guys wrote about it. <
|
|
|
|
|
I looked through the WMI classes and didn't find anything relevant.
|
|
|
|
|
You may want to have a look at this : http://en.wikipedia.org/wiki/System_Management_BIOS[^]
It is the wikipedia page for the SMBIOS or System Management BIOS standard. Hopefully that has something of value. If nothing else, you have another term to search for. 
|
|
|
|
|
I want to finish functions which can download music files from the internet,
such as: I want to search the song named "yesterday once more",
the I can get many links which can download this song.
so it will be difficult for me to search the song and get the url of it.
can anyone tell me how to accomplish this task?
|
|
|
|
|
Try using a search engine.
|
|
|
|
|
Hi all.
File delete action in windows, display a window with "Confirm file delete" title. How can I get full path of file from this window?
image
thanks a'lot.
modified on Sunday, July 11, 2010 3:12 AM
|
|
|
|
|
I am trying to interact programmatically with another application, and have succeeded in finding the handle of the correct edit box in the application's dialog. However, I can't seem to find a way to send text to the dialog control. The MSDN documetation for ::SetWindowText() states that it cannot be used to modify the text in another application. What other means is there to achieve the text transfer ?
Doug
|
|
|
|
|
I have now managed to copy the text to the clipboard, and then send a WM_PASTE message to the other application. This works, but is it the only way to achieve this transfer ?
Doug
|
|
|
|
|
Personally, I'd use WM_SETTEXT[^]. It's what SetWindowText uses internally.
|
|
|
|
|
WM_SETTEXT is used to set the text of a window.
|
|
|
|
|
Which is precisely why I'd use it.
Recall that an edit control may be created thusly:
hwndEdit = CreateWindowEx(0, WC_EDIT, 0, WS_VISIBLE | WS_CHILD | WS_TABSTOP | WS_BORDER | ES_AUTOHSCROLL, 11, 11, 147, 23, hwnd, (HMENU)IDC_EDIT1, hInst, 0);
Where
- hwndEdit is derclared of type HWND
- hwnd holds the parents HWND
- hInst holds HINSTANCE of the program
- IDC_EDIT has been defined as an integer used to identify messages from this control
|
|
|
|
|
Yes, I originally made an error in using SendMessage in the way that I set up lParam !!! I've got it working now ! (Much neater than using the clipboard !) So, if ::SetWindowText() ultimately uses WM_SETTEXT, then it begs the question as to why MS doe not allow it to act on "other applications" windows ??
Doug
|
|
|
|
|
Probably because SETTEXT needs a pointer to the text, and that pointer must be valid in the destination app's address space.
|
|
|
|
|
<< Probably because SETTEXT needs a pointer to the text, and that pointer must be valid in the destination app's address space. >>
But if SetWindowText() ends up using SendMessage, the text is in lParam. I'm confused ......... !!
Doug
|
|
|
|
|
you're welcome.
FYI: there are Win32 system calls that help you pass arbitrary amounts of data from one process to another; my LP#TrayIconBuster[^] article has an LP_Process class that shows how it's done in C#; similar techniques could be used in C/C++.
|
|
|
|
|
lParam holds the pointer to the text, and is assumed to be a valid pointer within the process' address space. It can not be an address in some other process.
|
|
|
|
|
>>Param holds the pointer to the text, and is assumed to be a valid pointer within the process' address space. It can not be an address in some other process.<<
Thanks for your patience, Luc !!
So that I can just FULLY understand this, let me describe it back to you with a few extra words (!!):-
The issuer of SendMessage() holds the variable containing the text (my app, in this case), and lParam is set up containing an address to this variable (within the senders address space ?). The receiver of SendMessage()(the 3rd party app, with which i'm endeavouring to interact) has access to lParam which contains the address of the original text, but as I'm alluding to above, is this address within the sender's address space ? I suspect that somewhere within the process, the text is COPIED to some global address space and it is THIS address that is contained within lParam. I can't see how else the process can work whilst protecting each app's memory space.
I await your words of wisdom, and to be "sorted out" !!
Again, thanks for your patience !
Doug
|
|
|
|
|
Hey, Iam looking for a function i could use that is just as easy to use as UrlDownloadToFile() on windows.
C or C++ doesnt matter.
Thanks.
|
|
|
|
|