HomeUseful information for Helbreath beginnersStatistics overviewSearchMemberlistGalleryRulesRegisterLog in

 

 [CODE] Fix Windows 8 - 10

Go down 
5 posters
AuthorMessage
Zmoky


Zmoky

Civilian
Granted to members for high engagement.
10th Anniversary
Earned after being a member for 10 years.
Silver 2
Earned by having 36 posts & comments.

Likes : 23

[CODE] Fix Windows 8 - 10 Empty
#1PostSubject: [CODE] Fix Windows 8 - 10   [CODE] Fix Windows 8 - 10 999103/9/2024, 5:53 am

Es un fix basico que para los que estan empezando les va a servir bastante.

Agrega en 

Code:
wmain.cpp

esto:

Code:
bool IsWin8() {    OSVERSIONINFO osvi;
    
    ZeroMemory(&osvi, sizeof(OSVERSIONINFO));
    osvi.dwOSVersionInfoSize = sizeof(OSVERSIONINFO);


    GetVersionEx(&osvi);
    if (osvi.dwMajorVersion == 6 && osvi.dwMinorVersion >= 2) {
    
        return true;
    }
    return false;
}

luego buscar 

Code:
case WM_ACTIVATEAPP:

reemplazar todo por :

Code:
case WM_ACTIVATEAPP:
 if( wParam == 0 )
        {    G_pGame->m_bIsProgramActive = FALSE;
            G_pGame->m_DInput.SetAcquire(FALSE);
        }else
        {    G_pGame->m_bIsProgramActive = TRUE;
            G_pGame->m_DInput.SetAcquire(TRUE);
            G_pGame->m_bCtrlPressed = FALSE;
            if (IsWin8())            {
                G_pGame->m_bIsRedrawPDBGS = TRUE;
                G_pGame->m_DDraw.ChangeDisplayMode(G_hWnd);
            }
            if (G_pGame->bCheckImportantFile() == FALSE)
            {    MessageBox(G_pGame->m_hWnd, "File checksum error! Gyoet Update again please!", "ERROR1", MB_ICONEXCLAMATION | MB_OK);
                PostQuitMessage(0);
                return 0;
            }            
            if (__FindHackingDll__("CRCCHECK") != 1)
            {    G_pGame->ChangeGameMode(GAMEMODE_ONQUIT);
                return NULL;
        }    }
        return DefWindowProc(hWnd, message, wParam, lParam);

En


Code:
DXC_ddraw.cpp



Buscar

Code:
DXC_ddraw::ChangeDisplayMode(HWND hWnd)

y reemplazar todo por 

Code:
BOOL DXC_ddraw::ChangeDisplayMode(HWND hWnd)
{
    HRESULT        ddVal;
    DDSURFACEDESC2 ddsd;


    if (!m_init)
        return FALSE;


    if (m_lpBackB4flip != NULL)
    {
        m_lpBackB4flip->Release();
        m_lpBackB4flip = NULL;
    }
    if (m_lpBackB4 != NULL) m_lpBackB4->Release();
    if (m_lpFrontB4 != NULL) m_lpFrontB4->Release();
    if (m_lpDD4 != NULL)
    {
        if (m_bFullMode == TRUE) m_lpDD4->RestoreDisplayMode();
    }


    SetRect(&m_rcClipArea, 0, 0, 640, 480);


    if (m_bFullMode == TRUE)
    {
        DDSCAPS2       ddscaps;
        ddVal = m_lpDD4->SetCooperativeLevel(hWnd, DDSCL_EXCLUSIVE | DDSCL_FULLSCREEN);
        if (ddVal != DD_OK) return FALSE;


        ddVal = m_lpDD4->SetDisplayMode(640, 480, 16, 0, 0);
        if (ddVal != DD_OK) return FALSE;
        memset((VOID *)&ddsd, 0, sizeof(ddsd));
        ddsd.dwSize = sizeof(ddsd);
        ddsd.dwFlags = DDSD_CAPS | DDSD_BACKBUFFERCOUNT;
        ddsd.dwBackBufferCount = 1;
        ddsd.ddsCaps.dwCaps = DDSCAPS_PRIMARYSURFACE | DDSCAPS_FLIP | DDSCAPS_COMPLEX;


        ddVal = m_lpDD4->CreateSurface(&ddsd, &m_lpFrontB4, NULL);
        if (ddVal != DD_OK) return FALSE;


        ZeroMemory(&ddscaps, sizeof(ddscaps));
        ddscaps.dwCaps = DDSCAPS_BACKBUFFER;
        ddVal = m_lpFrontB4->GetAttachedSurface(&ddscaps, &m_lpBackB4flip);
        if (ddVal != DD_OK) return FALSE;
        SetRect(&m_rcFlipping, 0, 0, 640, 480); // our fictitious sprite bitmap is
    }
    else
    {
        int cx = GetSystemMetrics(SM_CXFULLSCREEN);
        int cy = GetSystemMetrics(SM_CYFULLSCREEN);


        ddVal = m_lpDD4->SetCooperativeLevel(hWnd, DDSCL_NORMAL);
        if (ddVal != DD_OK) return FALSE;


        cx = cx / 2;
        cy = cy / 2;
        if (cy > 280) cy -= 40;
        SetWindowPos(hWnd, HWND_TOP, cx - 320, cy - 240, 640, 480, SWP_SHOWWINDOW);
        memset((VOID *)&ddsd, 0, sizeof(ddsd));
        ddsd.dwSize = sizeof(ddsd);
        ddsd.dwFlags = DDSD_CAPS;
        //ddsd.dwBackBufferCount = 0;
        ddsd.ddsCaps.dwCaps = DDSCAPS_PRIMARYSURFACE;


        ddVal = m_lpDD4->CreateSurface(&ddsd, &m_lpFrontB4, NULL);
        if (ddVal != DD_OK) return FALSE;


        SetRect(&m_rcFlipping, cx - 320, cy - 240, cx + 320, cy + 240); // our fictitious sprite bitmap is
    }


    InitFlipToGDI(hWnd);
    m_lpBackB4 = pCreateOffScreenSurface(640, 480);
    if (m_lpBackB4 == NULL) return FALSE;


    // Pre-draw background surface
    m_lpPDBGS = pCreateOffScreenSurface(640 + 32, 480 + 32);
    if (m_lpPDBGS == NULL) return FALSE;


    ddsd.dwSize = sizeof(ddsd);
    if (m_lpBackB4->Lock(NULL, &ddsd, DDLOCK_WAIT, NULL) != DD_OK) return FALSE;
    m_pBackB4Addr = (WORD *)ddsd.lpSurface;
    m_sBackB4Pitch = (short)ddsd.lPitch >> 1;
    m_lpBackB4->Unlock(NULL);
}

Buscar :

Code:
DXC_ddraw::DXC_ddraw()
{

debajo agregar 

Code:
m_init = false;

Buscar:

Code:
DXC_ddraw::bInit(HWND hWnd)

al ultimo antes del 

Code:
return TRUE;

agregan

Code:
m_init = true;

Para terminar en 


Code:
wmian.h


definen 

Code:
bool IsWin8();

y en 



definen

Code:
bool m_init;

Espero y alguno les sirva.   Exclamation


Last edited by Zmoky on 5/8/2024, 2:02 pm; edited 1 time in total
Back to top Go down
Assax1


Assax1

Silver 4
Earned by having 12 posts & comments.

Likes : 12

[CODE] Fix Windows 8 - 10 Empty
#2PostSubject: Re: [CODE] Fix Windows 8 - 10   [CODE] Fix Windows 8 - 10 999103/9/2024, 3:16 pm

Graacias lindo aporte niice tty
Back to top Go down
obdb


obdb

Silver
Earned after your first post and comment.

Likes : 0

[CODE] Fix Windows 8 - 10 Empty
#3PostSubject: Re: [CODE] Fix Windows 8 - 10   [CODE] Fix Windows 8 - 10 999104/7/2024, 1:11 am

excelente aporte!!! Smile
a probar se ha dicho
Back to top Go down
obdb


obdb

Silver
Earned after your first post and comment.

Likes : 0

[CODE] Fix Windows 8 - 10 Empty
#4PostSubject: Re: [CODE] Fix Windows 8 - 10   [CODE] Fix Windows 8 - 10 999104/7/2024, 3:04 am

che.. no he logrado hacer que arranque en windows 10 (solo funciona si le pongo compatibilidad win98/me)
///////////// actualizo 
aparentemente es en mi pc el drama... usé otra con una instalación 0km de windows 10 y arrancó... 

/////// consulto
estará por ahi el fix para el 800 x 600 // 1024x768 
y tambien el de el ALT+TAB?

GRACIAS!!
Back to top Go down
Kazin


avatar

Full Hero
Granted to members for great contributions.
Silver
Earned after your first post and comment.
Moderator
Earned by becoming a board moderator.

Likes : 3

[CODE] Fix Windows 8 - 10 Empty
#5PostSubject: Re: [CODE] Fix Windows 8 - 10   [CODE] Fix Windows 8 - 10 999105/7/2024, 4:34 pm

Con este código ya debería funcionar el Alt + Tab
Back to top Go down
Celestials


Celestials

Silver
Earned after your first post and comment.

Likes : 0

[CODE] Fix Windows 8 - 10 Empty
#6PostSubject: Re: [CODE] Fix Windows 8 - 10   [CODE] Fix Windows 8 - 10 999109/18/2024, 10:07 pm

Thank you very much for this fix
Back to top Go down
Sponsored content






[CODE] Fix Windows 8 - 10 Empty
#7PostSubject: Re: [CODE] Fix Windows 8 - 10   [CODE] Fix Windows 8 - 10 99910

Back to top Go down
 
[CODE] Fix Windows 8 - 10
Back to top 
Page 1 of 1
 Similar topics
-
» Fix Windows 8
» FIX WINDOWS 8
» Compatibilidad con windows 10
» Get IP code
» [CODE] MP,HP,SP, EN COLORES

Permissions in this forum:You cannot reply to topics in this forum
Join Helbreath :: Development :: Code Posting-
Jump to: