-
|
|
Fully Transparent Fullscreen Windows in D3d10
|
Now, what i am striving for is a fullscreen window, that will stay on top of other windows, and is completly Clear. Im not sure if it has been done for dx10, though i am assuming It has. Only thing is that, i want the user input to pass though this window, but i also want it to be read by other windows. example: lets say i have a hotkey in this window, lets say it is "shift", and i an writing in notepad, and i press the shift key, i want my hotkey to activate, and i want to be writing in caps in notepad. Does that make sense?
I am expecting i will probably end up using CreateWindowEx(...) rather then CreateWindow(...)?
Current code:
#include "windows.h"
#include "d3d10.h"
bool Keep = true;
LRESULT WINAPI MsgProc( HWND hWnd, UINT msg, WPARAM wParam, LPARAM lParam )
{
switch( msg )
{
case WM_DESTROY:
PostQuitMessage( 0 );
Keep = false;
return 0;
}
return DefWindowProc( hWnd, msg, wParam, lParam );
}
INT WINAPI WinMain( HINSTANCE hInst, HINSTANCE, LPSTR, INT )
{
WNDCLASSEX wc = { sizeof(WNDCLASSEX), CS_CLASSDC, MsgProc, 0L, 0L,
GetModuleHandle(NULL), NULL, NULL, NULL, NULL,
"Winclass", NULL };
RegisterClassEx( &wc );
HWND hWnd = CreateWindow( "Winclass", "Windows Title",
WS_OVERLAPPEDWINDOW, 100, 100, 400, 400,
GetDesktopWindow(), NULL, wc.hInstance, NULL );
ShowWindow(hWnd,SW_SHOW);
DXGI_SWAP_CHAIN_DESC sd;
ZeroMemory( &sd, sizeof(sd) );
sd.BufferCount = 1;
sd.BufferDesc.Width = 640;
sd.BufferDesc.Height = 480;
sd.BufferDesc.Format = DXGI_FORMAT_R8G8B8A8_UNORM;
sd.BufferDesc.RefreshRate.Numerator = 60;
sd.BufferDesc.RefreshRate.Denominator = 1;
sd.BufferUsage = DXGI_USAGE_RENDER_TARGET_OUTPUT;
sd.OutputWindow = hWnd;
sd.SampleDesc.Count = 1;
sd.SampleDesc.Quality = 0;
sd.Windowed = TRUE;
IDXGISwapChain* cpSwapC = NULL;
ID3D10Device* cpDevice = NULL;
if( FAILED( D3D10CreateDeviceAndSwapChain( NULL,
D3D10_DRIVER_TYPE_REFERENCE,
NULL,
0,
D3D10_SDK_VERSION,
&sd,
&cpSwapC,
&cpDevice ) ) )
{
return FALSE;
}
ID3D10Texture2D *pBackBuffer = NULL;
ID3D10RenderTargetView *cpRenWin = NULL;
if( FAILED( cpSwapC->GetBuffer( 0, __uuidof( ID3D10Texture2D ), (LPVOID*)&pBackBuffer ) ) )
return FALSE;
HRESULT hr = cpDevice->CreateRenderTargetView( pBackBuffer, NULL, &cpRenWin );
pBackBuffer->Release();
if( FAILED( hr ) )
return FALSE;
cpDevice->OMSetRenderTargets( 1, &cpRenWin, NULL );
D3D10_VIEWPORT view;
view.Width = 800;
view.Height = 600;
view.MinDepth = 0.0f;
view.MaxDepth = 1.0f;
view.TopLeftX = 0;
view.TopLeftY = 0;
cpDevice->RSSetViewports( 1, &view );
MSG WinMsg;
while( Keep )
{
cpSwapC->Present( 0, 0 );
TranslateMessage( &WinMsg );
DispatchMessage( &WinMsg );
PeekMessage(&WinMsg, 0, 0, 0, PM_REMOVE);
}
cpSwapC->Release();
cpSwapC = NULL;
cpRenWin->Release();
cpRenWin = NULL;
cpDevice->Release();
cpDevice = NULL;
return 0;
}
|
|
|
-
|
|
Re: Fully Transparent Fullscreen Windows in D3d10
|
are you trying to make a keyloger?
I belive MS even have rule in their terms when using any of their programs that they are not meant to create any harmfull software.
But to your respons. Dx10 dose not have control over the window. you have to manuly code this with win32 api.
Whow, thats a big memory leak... It sure is! and we are sinking!
kartflygaren675@hotmail.com
|
|
-
|
|
Re: Fully Transparent Fullscreen Windows in D3d10
|
TordinBjorn:are you trying to make a keyloger?
I belive MS even have rule in their terms when using any of their programs that they are not meant to create any harmfull software.
But to your respons. Dx10 dose not have control over the window. you have to manuly code this with win32 api.
no i am not making a keylogger, i am trying create an overlay, hotkeys will be used to bring up menu controlling functions of windows and other things, including messenger software.
|
|
|