|
You can use
1. to hook DirectX
2. get address of graphics card and read bitmap in it
|
|
|
|
|
Interesting, do you know a resource about how to hook to directx and gain access to its surface buffer?
|
|
|
|
|
Have you tried printscreen when the game is running if so it would be possible in external application i think. probably you might have choosen wrong window handle to capture when in fullscreen. Have you tried to run the game in windowed mode.
Some Games have inbuilt feature for screen capture check that too.
|
|
|
|
|
Thanks for the fast reply,
The game responds to printscreen in full mode and saves a screenshot in JPG format in a directory, however printscreen works fine when it is windowed mode. I think this can solve the problem just when the game window has focus. My intention is to write a bot to control the game while running in the background. I think I'll need to access the game's screen while it is in the background. I wonder how that would be possible since the game might not render its screen at all. I have a feeling that i have to trick it into rendering or something like that
|
|
|
|
|
|
|
Hey everyone,
I create an empty dialog and add an activex control names ms flex grid 6.0. I create a class which inherited from CDialog and when I say create it fails and gives no information:
<br />
class CTry : CDialog<br />
{<br />
public: <br />
CTry ();<br />
};<br />
<br />
CTry ::CTry ()<br />
{<br />
if (!Create(DialogID))<br />
{ <br />
exit(-1);<br />
} <br />
};<br />
When I remove flex grid from dialog it suceeds...
I also know there was a liecense problem in design time with flex grid, but it says nothing when I am using it in design time
So any idea why this happens?
(Actually it happens when I try to add rich text box also.. seems like I cannot add an outside activex control)
Thanks everyone.
modified on Wednesday, May 7, 2008 1:31 AM
|
|
|
|
|
try initializing rich edit control with AfxInitRichEdit once in your application
BOOL <yourapp>::InitInstance()
{
AfxInitRichEdit( );
...
if you are not able to load flex grid,
try also, AfxEnableControlContainer() in InitInstance
|
|
|
|
|
I need to use Flex Grid, I just tried to use richedit also but didn't work.
So do you have any idea why flex grid didn't work??
here's code:
<br />
BOOL Appl::InitInstance()<br />
{<br />
AfxOleInit();<br />
thanks...
|
|
|
|
|
Have you tried the code which i given, because i tested AfxOleInit did't work but
AfxInitRichEdit for richedit control and AfxEnableControlContainer for Flex grid it worked.
|
|
|
|
|
Hey there,
I just tried AfxEnableControlContainer and it did work!
I didn't saw this code in your previous message, sorry for being careless
Thank you very much!
|
|
|
|
|
try adding AfxOleInit in your program! i believe in the InitInstance function of the Application!
"Opinions are neither right nor wrong. I cannot change your opinion. I can, however, change what influences your opinion." - David Crow Never mind - my own stupidity is the source of every "problem" - Mixture
cheers,
Alok Gupta
VC Forum Q&A :- I/ IV
Support CRY- Child Relief and You/codeProject$$>
|
|
|
|
|
I have added the function but still did not work..
When I press test button on dialog, it works and seems ok.
got any idea???
<br />
BOOL Appl::InitInstance()<br />
{<br />
AfxOleInit();<br />
<br />
Works fine using AfxEnableControlContainer
Here's what msdn says about it:
If you did not enable ActiveX control support when you used AppWizard to generate your application, you will have to add this support manually. This article describes the process for manually adding ActiveX control containment to an existing OLE container application
modified on Wednesday, May 7, 2008 9:11 AM
|
|
|
|
|
sorry i confused between both of function
|
|
|
|
|
Helo,
I m writing win32 client socket using openssl.
my code for receive is like
static int lsSocketRecv(SSL* ssl, char* buf, int len)
{
int nRecv = 0;
char* p = buf;
int nRest = len;
do {
//nRecv = recv (sock, p, nRest, 0);
nRecv = SSL_read (ssl, p, nRest);
if (nRecv < 0)
{
printf("error");
}
}
when my control come to SSL_read(), it will blocks there only.
I mean control is not going ahead from SSL_read().
I already add all dependency regarding openssl and I m able to sucessfully connect with the server.
one more thing is that is there any way so that i can make it nonblocking mode in SSL.
Regards,
Amit
modified on Wednesday, May 7, 2008 2:13 AM
|
|
|
|
|
Dear All,
I am currently working on a C project.I need to port the code into Win Mobile 5.0 which is currently working in Win 32.I need to implement ctime( ),gmtime( ),strptime( ),localtime( ),mktime( ).Please help me to implement these in Win Mobile 5.0.
|
|
|
|
|
Wow! New user id? Cool. Please ask it in the Mobile Development forum, as I already said yesterday. Or is that you've asked it there too?
Nobody can give you wiser advice than yourself. - Cicero
.·´¯`·->Rajesh<-·´¯`·.
Codeproject.com: Visual C++ MVP
|
|
|
|
|
Spying on the User
"Opinions are neither right nor wrong. I cannot change your opinion. I can, however, change what influences your opinion." - David Crow Never mind - my own stupidity is the source of every "problem" - Mixture
cheers,
Alok Gupta
VC Forum Q&A :- I/ IV
Support CRY- Child Relief and You/codeProject$$>
|
|
|
|
|
I want to pass text of a combobox in my form to crystal report to use as header title.
How can I do this?
|
|
|
|
|
Hi,
I am trying to understand "__declspec(thread)" and where it is declared
My situation is I have a DLL which is implicitly bound (hope that is the right term) many threads access the DLL
I do some processing in the DLL_THREAD_ATTACH message
Lets say I declare a pointer with __declspec(thread) attribute in the Global Section of the DLL
e.g. __declspec(thread) char *thread_ptr;
In the process that calls the DLL there exists a function which is multithreaded (many threads execute this function)
lets call it funca() How do I access thread_ptr in funca or better yet how do I declare it
e.g. extern __declspec(thread) char *thread_ptr not sure
|
|
|
|
|
see the guidelines in the remark section of [__declspec( thread ) declarator^]
how ever your example is correct, extern keyword is not required if the declaration is in the same file of funca() definition
|
|
|
|
|
I guess the Linker would know that the __declspec(thread) char *threadptr in the DLL and the__declspec(thread) char *threadptr in main->funca() are one and the same if the DLL is implictly (hope that is the right term) Loaded by the process/.exe
|
|
|
|
|
I am not very mych expert in VC++. i need to draw some airplane like shape and need to move it. or simply just moveit to new coordinates. right now i am generating the new coordinatees and drawing a circle in the new position. but i need to dwaw some 2 d aircraft like shape.
here is a part of my code
for (i=0;i<m_SizeOfArray;i++)
{
GraphRegion->Ellipse(Points[i].x-5,Points[i].y+5,5+Points[i].x,Points[i].y-5);
}
it generates circle in new positions.or can anyone tell me how u can load an image to new positions.
i badly need the solution.
|
|
|
|
|
I guess you can use CDC of your frame. When dragging you image you have to clear it and redraw it in new position. Clear your image by using XOR at same coordinates. Do not clear the entire area for performance.
|
|
|
|
|
Mmmm,
If the "plane" is always the same... why don't you try to draw it right first, without movements... then get the first point (let's say the front of the cabine) and take it like "point_start" then base all the other points to this one in a function.
Then a loop with invalidate / erase background and the call to your function with the new "start_point".
an example in "grosso modo":
The static figure
dc.MoveTo (100, 100);
dc.LineTo (125, 125);
dc.LineTo (100, 150);
dc.LineTo (100, 100);
The dinamic function
void draw_shape (int x, int y);
{
dc.MoveTo (x, y);
dc.LineTo (x + 25, y + 25);
dc.LineTo (x, y + 50);
dc.LineTo (x, y);
}
for (int i = 0; i < 10; i++)
draw_shape (0 + i, 100);
Or the other possibility...
You can draw your plane in a bitmap using resource editor, give it a name and then use it with BitBlt
CClientDC dc(this);
CDC dcNewMem;
dcNewMem.CreateCompatibleDC (&dc);
CBitmap bmPlane;
BITMAP bmTemp;
if (bmPlane.m_hObject != NULL)
bmPlane.DeleteObject();
bmNewIn.LoadBitmap (IDB_PLANE);
bmNewIn.GetObject(sizeof(bmTemp), &bmTemp);
dcNewMem.SelectObject(&bmPlane);
dc.BitBlt(x, y, bmTemp.bmWidth, bmTemp.bmHeight, &dcNewMem, 0, 0, SRCCOPY);
}
Greetings.
--------
M.D.V.
If something has a solution... Why do we have to worry about?. If it has no solution... For what reason do we have to worry about?
Help me to understand what I'm saying, and I'll explain it better to you
“The First Rule of Program Optimization: Don't do it. The Second Rule of Program Optimization (for experts only!): Don't do it yet.” - Michael A. Jackson
|
|
|
|