[Need Help]Get the screen resolution
Hi
I got a little problem : I can't have the screen resolution.
I think what i'm doing can work, but wr crash.
I tried to use GetDeviceCaps() and GetSystemMetrics() but wr crash.
How to figure it out ?
Do I need detour ? Because I think Hackshield hook this functions.
See my code :
You have any idea to get these infos ? I hope i'm wrong about HS ..
EDIT : Sorry, i got it.
It was because of the MessageBox function.
I got a little problem : I can't have the screen resolution.
I think what i'm doing can work, but wr crash.
I tried to use GetDeviceCaps() and GetSystemMetrics() but wr crash.
How to figure it out ?
Do I need detour ? Because I think Hackshield hook this functions.
See my code :
Code:
void CheckScreen()
{
if (GetAsyncKeyState(VK_F5))
{
hDC = GetDC(NULL);
//ScreenX = GetSystemMetrics(SM_CXSCREEN) ;
//ScreenY = GetSystemMetrics(SM_CYSCREEN);
ScreenX = ScreenX / 2;
ScreenY = ScreenY / 2 - 22;
int tmp = ScreenX;
MessageBox(0, (LPSTR)tmp, "Infos", MB_OK); // Just to be sure of the value
}
}
EDIT : Sorry, i got it.
It was because of the MessageBox function.

