Sorry, I should of specified. It's just to get the pixel color of the pixel on the entire screen, doesn't matter what application or whatever, I could probably code it in VB or Java easier, but I want to make it professional. It's been a good 2 years since I've even touched C++, and it's a bit troubling. C++'s keywords and stuff throw me off, I find that it has no relation to a similar structure, and it's a bit confusing. I probably need more experience, but then again, I'm just 17. :/
arunforce
Posts
-
GetPixel() help -
GetPixel() helphdc = undeclared identifier.
-
GetPixel() helpThanks, I sorta understand what you mean, but can you tell me what additional code I need to use it/how to set it up?
-
GetPixel() helpI am trying to retrieve the RGB code of GetPixel() and I have a slight bit of understanding of C++, I'm pretty fluent in Java and VB.net, but the first parameter for the GetPixel function has to be some sort of HDC thing, how would I return it as RGB or hexadecimal, like using it as this: GetPixel(0,50,50); returns a number that is too large for an integer 42929... Can anyone help me? Please don't write a bunch of classes and constructors and stuff, just simple non-OOP code, best if its just one word, it's less confusing. Thanks alot.
-
2 Simple QuestionsThen how do people do things such as that, with programs? It opens their my documents, I can do %userprofile% fine, I just can't attach my documents to the end. I don't think you know much about that. And, how would I go about doing a class in VB.NET?
-
2 Simple QuestionsI got 2 quick questions: 1> System.Diagnostics.Process.Start("Explorer.exe", "%USERPROFILE%\My Documents\") returns folder doesn't exist because I have my documents in there, but I need to goto my documents, what should I do? 2> How do you set a global variable in .net that is accessable across multiple forms. Like Dim blah as Global? Thanks...
-
Help with Compiling ErrorOk this is my source: ----------------------------------------------------- void CTycoonDlg::OnList() { //Displays changes... extern CListBox* OnList; // Set the first visible item in the list box to be the middle item OnList->SetTopIndex(OnList->GetCount()/2); } ----------------------------------------------------- I put the code inbetween it just there, and now I can't compile it... OnList is a list box, and when I try to compile it I get this error... --------------------Configuration: Tycoon - Win32 Debug-------------------- Compiling... TycoonDlg.cpp Linking... TycoonDlg.obj : error LNK2001: unresolved external symbol "class CListBox * OnList" (?OnList@@3PAVCListBox@@A) Debug/Tycoon.exe : fatal error LNK1120: 1 unresolved externals Error executing link.exe. Tycoon.exe - 2 error(s), 0 warning(s) Any Ideas? I'm not that good at debugging errors. Anyways, please keep it simple, I don't really understand much to MFC, im new to it. I know a bit to C++.
-
Auto ScrollI rather not, (i'm making a game (closed source)) I just want a normal everyday listbox to scroll down everytime a message is put into it :( Any ideas?
-
Auto ScrollI could only make it CListBox::SetTopIndex, without the (). And I couldn't even add the GetItemCount()-1 Even the CListBox::SetTopIndex didnt work... What do I do?
-
Auto ScrollI didn't understand half the things you said. Could you simplify it. I already coded most of it, and it would break my heart to recode it. :( I just want it simply to autoscroll down :( Please help me.
-
Auto ScrollI have a list box, but I need it to auto scroll down, because everytime a message is posted, the box just stay where it is. I could have like 10 messages posted, but it would only show the first 5... Help me please, make it simple for me to understand I'm new to MFC. Thanks ALOT! Arun
-
Coloring TextI've already looked at that tutorial. The problem is I already have a list box set up, and if I try to change it to fixed or variable, my messages won't show up. Is there like a command like colorRGB[255,123,210] Uhh, thanks.
-
Coloring TextHow do I make a specific word inside an list box green? Source Code: -------------------------------------------------------- CString tempString = ""; tempString.Format("You currently have $%s%d with you.", tempString, cash); CListBox * tempBox = (CListBox *)(this->GetDlgItem(IDC_LIST)); tempBox->AddString(tempString); -------------------------------------------------------- I want the word you to be green, what do I do? Thanks.
-
Loading Variable in EditBoxI did that and this is how it shows up, 100000, I added a command which increases the value by 1, ak,; cash++. I hit the button, and it shows up as it has been changed in the list box, but not the edit box. The List Box's purpose is to show changes, like if you buy a car, it will say you lost $10,000, and the edit box display's how much money you currently have, and updates accordingly... If I delete the preset in the DDX section it turns into -858993460, and so i deleted it being set in the begining of the file where it says unsigned long cash = 100000; to long cash. (I changed the unsigned part also) The two problems are that 1. The edit box doesn't update. 2. The edit box doesnt have a $ before the number, how do i do that? Thanks alot for your help. Here is how the source beginning is: ------------------------------------------------------------------------- #include "stdafx.h" #include "Tycoon.h" #include "TycoonDlg.h" #include "BUY.h" #include "SELL.h" #ifdef _DEBUG #define new DEBUG_NEW #undef THIS_FILE static char THIS_FILE[] = __FILE__; #endif long cash; unsigned int day = 01; unsigned int month = 01; unsigned int year = 04; unsigned int chp; unsigned int mhp; ///////////////////////////////////////////////////////////////////////////// // CTycoonDlg dialog CTycoonDlg::CTycoonDlg(CWnd* pParent /*=NULL*/) : CDialog(CTycoonDlg::IDD, pParent) { //{{AFX_DATA_INIT(CTycoonDlg) cash = 100000; //}}AFX_DATA_INIT m_hIcon = AfxGetApp()->LoadIcon(IDR_MAINFRAME); } void CTycoonDlg::DoDataExchange(CDataExchange* pDX) { CDialog::DoDataExchange(pDX); //{{AFX_DATA_MAP(CTycoonDlg) DDX_Text(pDX, IDC_CASH, cash); //}}AFX_DATA_MAP } -------------------------------------------------------------------------
-
Loading Variable in EditBoxProblem is: I already made a value, and It's being read all across the program, im just trying to sorta make an active display in the MFC application on how much money I have... It's an edit box, displaying how much cash you have. This is part of the source: #include "stdafx.h" #include "Tycoon.h" #include "TycoonDlg.h" #include "BUY.h" #include "SELL.h" #ifdef _DEBUG #define new DEBUG_NEW #undef THIS_FILE static char THIS_FILE[] = __FILE__; #endif unsigned long cash = 100000; But Class Wizard makes a new variable, and I want to use my old variable.
-
Loading Variable in EditBoxHow do I load a variable inside an edit box? I have an edit box stated below, its called "OnCash", It's ID is "IDC_CASH". Source: ---------------------------------------------- void CTycoonDlg::OnCash() { //$cash(variable) } ---------------------------------------------- I want it to say in the editbox that is read only, $(cashvariable) so it would look like this inside the editbox: $100000 (default value for the cash, unsigned long) Can anyone help me?
-
Button to ListI tried implementing your code and I got errors. Do you think you can manually explain it? What did you mean make nice ans fluffy string? I get these errors -_- F:\Documents and Settings\Administrator\My Documents\Arun\Code\Tycoon\TycoonDlg.cpp(107) : error C2065: 'listbox' : undeclared identifier F:\Documents and Settings\Administrator\My Documents\Arun\Code\Tycoon\TycoonDlg.cpp(107) : error C2228: left of '.Add' must have class/struct/union type F:\Documents and Settings\Administrator\My Documents\Arun\Code\Tycoon\TycoonDlg.cpp(107) : error C2065: 'output' : undeclared identifier This is the code from my file. void CTycoonDlg::OnIncrease() { cash++; //On Click, Display in ListBox "You currently have $(cash) with you." CString str; CString output; str.Format("%i", cash);//make a string from your number output = "You have \"" + str + "\"dollars in your account.";//make nice ans fluffy string. (\" is a " character in your string) } void CTycoonDlg::OnList() { listbox.Add(output);//add to listbox (could be AddString or something don't know by heart) } I know I said "x" would be the variable, but I decided it was too confusing and changed it to "cash".
-
Button to ListWell, I am a newbie programmer. I need help with a lil project I am making. Lets say I have this button called increase, when I press this button I want it to add 1 to the variable x, and display the changes. So under the button "OnIncrease", I chose and put the command x++; Which lets me add 1 to the variable x which is an unsigned long. Once this button is clicked, I want to also make it display in the box called "OnList" which is a list box. Can anyone explain simply how to make it say, "You have "x" dollars in your account." Thanks, make sure it is simple for me to understand. Arun