|
Ive been using SetPixel alot, where i feed it seperate R G B values, but now im playing with GetPixel, but it only seems to return one big bitwise value, so how can i most cpu friendly wise convert this big number into 3 sperate ints?
thanks
/Johannes
|
|
|
|
|
Johpoke wrote: so how can i most cpu friendly wise convert this big number into 3 sperate ints?
Why not just use GetRValue() , GetGValue() , and GetBValue() ?
"Approved Workmen Are Not Ashamed" - 2 Timothy 2:15
"Judge not by the eye but by the heart." - Native American Proverb
|
|
|
|
|
That sounds right, but how do i connect them or use them correctly? i just get out weird characters, no numbers..
:/
/Johannes
|
|
|
|
|
Johpoke wrote: ...but how do i connect them...
Huh?
Johpoke wrote: i just get out weird characters, no numbers..
How are you using those functions?
"Approved Workmen Are Not Ashamed" - 2 Timothy 2:15
"Judge not by the eye but by the heart." - Native American Proverb
|
|
|
|
|
im not sure if im using them correctlt, msdn didnt explain alot, first i tried geting pixel, and sening the int to getrbvale, i also tried some other data types, and last i tied:
cout<<getrvalue(getpixel(hdc, pos.x,="" pos.y));
how="" do="" i="" get="" the="" rvalue="" g="" and="" b="" for="" pixel="" seperate??
thanks!
=""
<div="" class="ForumSig">/Johannes
|
|
|
|
|
Johpoke wrote: cout<<getrvalue(getpixel(hdc, pos.x,="" pos.y));<="" blockquote="">
This is doing exactly what it is supposed to (i.e., printing the character equivalent of the red value). Since your red value is likely not a printable character (e.g., some value less than 33 or greater than 127), that's why you're not seeing a number. Cast it to an int instead.
Johpoke wrote: how do i get the Rvalue G and B for the pixel seperate??
By using the three functions I mentioned earlier.
"Approved Workmen Are Not Ashamed" - 2 Timothy 2:15
"Judge not by the eye but by the heart." - Native American Proverb
|
|
|
|
|
yep feeding it into int, or doing int(GetR... works great
thanks for the help!
/Johannes
|
|
|
|
|
Hi,
I'm trying to control another application (Acrobat 5 print settings) and I'm telling it to check a checkbox which is working ok, but when I click OK button and go back in the setting is lost. (unchecked)
If I do it manually with mouse then it saves the information, so my question is:-
is there any further window messages to send to the checkbox or window to save the information in the app, I've tried sending UpdateData and UpdateWindow without any luck.
currently doing code:
if(childWnd->GetDlgCtrlID( )==0x63686B39)
{
CButton *btn = (CButton *) wnd2->GetDlgItem(0x63686B39);
btn->SetCheck(TRUE);
}
Thanks,
Lee.
|
|
|
|
|
leemidgley wrote: btn->SetCheck(TRUE);
Checking a checkbox in this manner does not call the OnClickXXX() handler function, which is most likely what saves the checkbox's state.
"Approved Workmen Are Not Ashamed" - 2 Timothy 2:15
"Judge not by the eye but by the heart." - Native American Proverb
|
|
|
|
|
Hi everyone,
Sorry if this is the wrong forum to post this question.
I am looking for an API or DLL that can help me with a system benchmark program. I would like to write a little program that rate the performance of the system; processor, memory, primary hard disk (r/w) and graphics. Any help pointing me to the right direction or tips are greatly apprcicated. It would be nice to do this in c/c++. Thanks again for your help.
-hdpc
|
|
|
|
|
hdpc wrote: ...a little program that rate the performance of the system...
What exactly does this mean?
"Approved Workmen Are Not Ashamed" - 2 Timothy 2:15
"Judge not by the eye but by the heart." - Native American Proverb
|
|
|
|
|
|
I don't think there is a way in un-managed code, but managed code there are performance counter which are part of WMI (Windows Management Interface)
http://www.codeproject.com/dotnet/perfcounter.asp[^]
I'd love to help, but unfortunatley I have prior commitments monitoring the length of my grass. :Andrew Bleakley:
|
|
|
|
|
WMI existed long before managed code was a concept for Microsoft.
|
|
|
|
|
Sam Hobbs wrote: WMI existed long before managed code
It would seem your right.
From WIKI
Under Windows NT 4.0, Microsoft had roughly 15 WMI providers available once WMI was installed.
I'd love to help, but unfortunatley I have prior commitments monitoring the length of my grass. :Andrew Bleakley:
|
|
|
|
|
I'd like to be able to read the results from the listview that I've outlined in blue in the attached photo. Spy shows the class as Afx:400000:28:10011 . It appears to be a listview however I've had no luck with sending standard messages such as LVM_GETITEMCOUNT, LVM_GETITEMTEXT. Just wanted to see if anyone here had any ideas? Thanks for your help!
http://img296.imageshack.us/img296/8471/pstarstourneylobft3.jpg[^]
Also watching the window messages on spy shows that it updates using WM_PAINT.
-- modified at 13:20 Friday 8th December, 2006
|
|
|
|
|
I can tell by looking at it that isn't not a regular list view control.
|
|
|
|
|
it looks more like a grid than a listview.
|
|
|
|
|
The data in the center column is not aligned with it's header which show's that it's not a list view. Does Spy show you any of the messages that it may be processing?
You may also want to try using a resource editor to go snooping through the dll's for the exe. It may give you a better idea about what class is being used.
|
|
|
|
|
When clicking on the headers (Player, Chips, Rank) to sort the list or scrolling spy shows it as processing WM_PAINT and that's it.
|
|
|
|
|
Given that info and the name of the class, I would guess the control is custom. It could very well be a C++ class ( not MFC ) which draws everything to an offscreen buffer. The has hampered your ability to read the items.
Improbable, but you may want to snoop into some of the exported functions in the dlls, there could very well be a function there to get/add/remove the items. If so, you could hook the function.
I would hazard a guess that the list items is actually a bitmap, it may be possible to get a handle to it, but that would again be difficult.
Being that it's an online game, the list will be sent to the exe, you may want to start sniffing packets. It's doubtfull the full list will be sent each time, more like item by item possibly with a flag to add/remove/update. Also the list would probably be stored in the exe's memory as an array, you may want to snoop around for that.
We are now going into the world of reverse engineering, you could try debugging the exe. To do that though you will need to unpack/decrypt it somehow. There are a lot of tools to do this, but good luck trying to find one that will do it for you!
Out of curiosity, does the cursor change at all?
|
|
|
|
|
Packet sniffing was actually my first thought however I don't have much experience with reverse engineering so that left me a little short. Each time you open the window it recieves encrypted packets containing the information I'm trying to get (in full as far as I can tell). So I would imagine somewhere between being recieved as packets and coming up on the screen it has to be decrypted and stored somewhere, most likely as you pointed out in array form, so that the list can easily be sorted. I really don't have much of an idea as to how i'd go about finding that array or gathering the data from it though.
Nope the cursor doesn't change.
Also you can highlight individual names in the list (but not multiple names) and if you click the Player Info button (or just double click on the list) it pops up a seperate small window with the information i'm trying to read (albeit on a player by player basis). If I can't read the list directly perhaps there's a way I could enumerate each item in the list and read this small window that pops up?
-- modified at 14:46 Friday 8th December, 2006
|
|
|
|
|
Bump. Still haven't figured this out. I know there must be a way to do it as I've found a few commercial applications that seem to have no trouble with it (and don't use OCR). Any other ideas?
|
|
|
|
|
Hello,
I got a file (.INI) and it's filled with a lot of hexa numbers:
00000000
00000000
FFFFFC24
00000000
00000000
FFFFFC2C
00000000
FFFFFC70
FFFFFC24
I must convert these strings hex to real hex number, obviously they must be unsigned.
I tried a lot of ways, and got only trash
each line must be a row in an array, for example "unsigned int myArray[200];"
this array must be filled with hexa from the string (INI File).
Cuold anyone help me??
Thanks
|
|
|
|
|
suguimoto wrote: I tried a lot of ways, and got only trash
Have you tried strtol( const char *nptr, char **endptr, int base ) ?
--
Roger
"It's supposed to be hard, otherwise anybody could do it!" - selfquote
"No one remembers a coward!" - Jan Elfström 1998 "...but everyone remembers an idiot!" - my lawyer 2005 when heard of Jan's saying above
|
|
|
|