I have some really basic Direct3D code here that I can't debug.
It's basically just copied from "The Zen of Direct3D Game Programming" except for it is supposed to display a bitmap, but it displays nothing but just the blank window.
If it replace the bitmap displaying code with something displays some random pixels or something along those lines it works.

#define WIN32_LEAN_AND_MEAN
#define g_DeviceHeight 768
#define g_DeviceWidth 1024
#include <windows.h>
#include <mmsystem.h>
#include <d3d8.h>
#include <d3dx8.h>

int GameState = 1;
LPDIRECT3D8 g_pD3D = 0;
LPDIRECT3DDEVICE8 g_pDevice = 0;
HWND g_hWndMain;
LPDIRECT3DSURFACE8 pSurfaceMenu = 0;
D3DSURFACE_DESC d3dsdMenu;

void SetError( char* String);
int Render();
int InitDirect3DDevice( HWND hWndTarget, int Width, int Height, BOOL bWindowed, D3DFORMAT FullScreenFormat, LPDIRECT3D8 pD3D, LPDIRECT3DDEVICE8*ppDevice);
int GameShutdown();
int GameLoop();
int GameInit();
long CALLBACK WndProc( HWND hWnd, UINT uMessage, WPARAM wParam, LPARAM lParam);
int LoadBitmapToSurface( char* PathName, LPDIRECT3DSURFACE8* ppSurface, LPDIRECT3DDEVICE8 pDevice );

int WINAPI WinMain( HINSTANCE hInstance, HINSTANCE hPrevInstanec, PSTR pstrCmdLine, int iCmdShow )
{
HWND hWnd;
MSG msg;
WNDCLASSEX wc;
static char strAppName[] = "The Basic Application";
wc.cbSize = sizeof( WNDCLASSEX );
wc.style = CS_HREDRAW | CS_VREDRAW | CS_OWNDC;
wc.cbClsExtra = 0;
wc.cbWndExtra = 0;
wc.lpfnWndProc = WndProc;
wc.hInstance = hInstance;
wc.hbrBackground = (HBRUSH)GetStockObject( DKGRAY_BRUSH );
wc.hIcon = LoadIcon( NULL, IDI_APPLICATION );
wc.hIconSm = LoadIcon( NULL, IDI_APPLICATION );
wc.hCursor = LoadCursor( NULL, IDC_ARROW );
wc.lpszMenuName = NULL;
wc.lpszClassName = strAppName;
RegisterClassEx( &wc );
hWnd = CreateWindowEx( NULL, strAppName, strAppName, WS_OVERLAPPEDWINDOW, CW_USEDEFAULT, CW_USEDEFAULT, 1024, 768, NULL, NULL, hInstance, NULL);
g_hWndMain = hWnd;
ShowWindow( hWnd, iCmdShow );
UpdateWindow ( hWnd );
if ( FAILED( GameInit() ) )
{
SetError( "Initialization Failed" );
GameShutdown();
return E_FAIL;
}
while ( TRUE )
{
if ( PeekMessage( &msg, NULL, 0, 0, PM_REMOVE ) )
{
if (msg.message == WM_QUIT )
{
break;
}
TranslateMessage( &msg );
DispatchMessage( &msg );
}
else
{
GameLoop();
}
}
GameShutdown();
return msg.wParam;
}

void SetError( char* String)
{
OutputDebugString( String );
OutputDebugString( "\n" );
}

long CALLBACK WndProc( HWND hWnd, UINT uMessage, WPARAM wParam, LPARAM lParam )
{
switch( uMessage )
{
case WM_CHAR:
{
switch (wParam)
{
case VK_ESCAPE:
PostQuitMessage( 0 );
return 0;
default:
return 0;
}
}
//WM_LBUTTONDOWN
//WM_MOUSEMOVE
case WM_CREATE:
{
return 0;
}
case WM_PAINT:
{
ValidateRect( hWnd, NULL);
return 0;
}
case WM_DESTROY:
{
PostQuitMessage( 0 );
return 0;
}
default:
{
return DefWindowProc( hWnd, uMessage, wParam, lParam );
}
}
}

int InitDirect3DDevice( HWND hWndTarget, int Width, int Height, BOOL bWindowed, D3DFORMAT FullScreenFormat, LPDIRECT3D8 pD3D, LPDIRECT3DDEVICE8* ppDevice )
{
D3DPRESENT_PARAMETERS d3dpp;
D3DDISPLAYMODE d3ddm;
HRESULT r = 0;
if( *ppDevice )
(*ppDevice)->Release();
ZeroMemory( &d3dpp, sizeof( D3DPRESENT_PARAMETERS ) );
r = pD3D->GetAdapterDisplayMode( D3DADAPTER_DEFAULT, &d3ddm );
if ( FAILED( r ) )
{
SetError( "Could not get display adapter info" );
return E_FAIL;
}
d3dpp.BackBufferWidth = Width;
d3dpp.BackBufferHeight = Height;
d3dpp.BackBufferFormat = bWindowed ? d3ddm.Format : FullScreenFormat;
d3dpp.BackBufferCount = 1;
d3dpp.MultiSampleType = D3DMULTISAMPLE_NONE;
d3dpp.SwapEffect = D3DSWAPEFFECT_DISCARD;
d3dpp.hDeviceWindow = hWndTarget;
d3dpp.Windowed = bWindowed;
d3dpp.EnableAutoDepthStencil = TRUE;
d3dpp.AutoDepthStencilFormat = D3DFMT_D16;
d3dpp.FullScreen_RefreshRateInHz = 0;
d3dpp.FullScreen_PresentationInterval = bWindowed ? 0 : D3DPRESENT_INTERVAL_IMMEDIATE;
d3dpp.Flags = D3DPRESENTFLAG_LOCKABLE_BACKBUFFER;
r = pD3D->CreateDevice( D3DADAPTER_DEFAULT, D3DDEVTYPE_HAL, hWndTarget, D3DCREATE_SOFTWARE_VERTEXPROCESSING, &d3dpp, ppDevice );
if ( FAILED( r ) )
{
SetError( "Could not create the render device" );
return E_FAIL;
}
return S_OK;
}

int GameInit()
{
HRESULT r = 0;
g_pD3D = Direct3DCreate8( D3D_SDK_VERSION );
if( g_pD3D == NULL )
{
SetError( "Could not create IDirect3D8 object" );
return E_FAIL;
}
r = InitDirect3DDevice( g_hWndMain, 1024, 768, FALSE, D3DFMT_X8R8G8B8, g_pD3D, &g_pDevice );
if ( FAILED( r ))
{
SetError( "Initialization of the device failed" );
return E_FAIL;
}
LoadBitmapToSurface( "Graphics\\Menu.bmp", &pSurfaceMenu, g_pDevice );
pSurfaceMenu->GetDesc( &d3dsdMenu );
return S_OK;
}

int GameLoop()
{
Render();
return S_OK;
}

int GameShutdown()
{
if ( g_pDevice )
{
g_pDevice->Release();
}
if ( g_pD3D )
{
g_pD3D->Release();
}
if ( pSurfaceMenu )
{
pSurfaceMenu->Release();
pSurfaceMenu = 0;
}
return S_OK;
}

int Render()
{
HRESULT r;
D3DLOCKED_RECT LockedRect;
LPDIRECT3DSURFACE8 pBackSurf = 0;
if( !g_pDevice )
{
SetError( "Cannot render because there is no device" );
return E_FAIL;
}
g_pDevice->Clear( 0, 0, D3DCLEAR_TARGET, D3DCOLOR_XRGB( 0, 0, 0 ), 1.0f, 0 );
r = g_pDevice->GetBackBuffer( 0, D3DBACKBUFFER_TYPE_MONO, &pBackSurf );
if ( FAILED( r ) )
{
SetError( "Couldn't get backbuffer" );
}
r = pBackSurf->LockRect( &LockedRect, NULL, 0 );
if (FAILED( r ) )
{
SetError( "Couldn't lock the back buffer" );
}
DWORD* pData = (DWORD*)(LockedRect.pBits);
//----------Draw Here---------
POINT DestPoint = { 100, 100 };
RECT rect = { 0, 0, d3dsdMenu.Width, d3dsdMenu.Height };
g_pDevice->CopyRects( pSurfaceMenu, &rect, 1, pBackSurf, &DestPoint );
//----------Draw Here---------
pBackSurf->UnlockRect();
pData = 0;
pBackSurf->Release();
pBackSurf = 0;
g_pDevice->Present( NULL, NULL, NULL, NULL );
return S_OK;
}

int LoadBitmapToSurface( char* PathName, LPDIRECT3DSURFACE8* ppSurface, LPDIRECT3DDEVICE8 pDevice )
{
HRESULT r;
HBITMAP hBitmap;
BITMAP Bitmap;
hBitmap = (HBITMAP)LoadImage( NULL, PathName, IMAGE_BITMAP, 0, 0, LR_LOADFROMFILE | LR_CREATEDIBSECTION );
if (hBitmap == NULL )
{
SetError( "Unable to load bitmap" );
return E_FAIL;
}
GetObject( hBitmap, sizeof( BITMAP ), &Bitmap );
DeleteObject( hBitmap );
r = pDevice->CreateImageSurface( Bitmap.bmWidth, Bitmap.bmHeight, D3DFMT_X8R8G8B8, ppSurface );
if ( FAILED( r ) )
{
SetError( "Unable to create surface for bitmap load" );
return E_FAIL;
}
r = D3DXLoadSurfaceFromFile( *ppSurface, NULL, NULL, PathName, NULL, D3DX_FILTER_NONE, 0, NULL );
if( FAILED( r ) )
{
SetError( "Unable to load file to surface" );
return E_FAIL;
}
return S_OK;
}
EDIT
Dang it, it's messing up the spacings