Jump to content
  • Advertisement
Sign in to follow this  
nuclear123

Obtaining Application Window Handle from .dll?

This topic is 2530 days old which is more than the 365 day threshold we allow for new replies. Please post a new topic.

If you intended to correct an error in the post then please contact us.

Recommended Posts

Advertisement
I think i found it it was FindWindow(). But i still have one problem. Basically im trying to create a transparent window. Then with this transparent window i want to have it lay overtop of another specified window. For some reason this isnt working all to well. If seems as if when i execute the following code, Minesweeper becomes partially transparent and i can see thru it like a fuzzy haze. All i want to do is create a clear see thru window and have it stay embedded into the client area of minesweeper. I dont want to make minesweeper see thru! just my window i create

http://imageshack.us/photo/my-images/94/q9akqu.png/

WNDCLASS wc;
wc.style = CS_HREDRAW | CS_VREDRAW;
wc.lpfnWndProc = MainWndProc;
wc.cbClsExtra = 0;
wc.cbWndExtra = 0;
wc.hInstance = m_hInstance;
wc.hIcon = LoadIcon(0, IDI_APPLICATION);
wc.hCursor = LoadCursor(0, IDC_ARROW);
wc.hbrBackground = (HBRUSH)GetStockObject(NULL_BRUSH);
wc.lpszMenuName = 0;
wc.lpszClassName = L"D3DWndClassName";
RegisterClass(&wc);

HWND m_hwndOverlay = CreateWindowEx(WS_EX_TOPMOST | WS_EX_COMPOSITED | WS_EX_TRANSPARENT | WS_EX_LAYERED, // dwExStyle
wc.lpszClassName, // lpClassName
L"hi", // lpWindowName
WS_OVERLAPPED, // dwStyle
CW_USEDEFAULT, CW_USEDEFAULT, // x, y
500, 500, // nWidth, nHeight
NULL, // hWndParent
NULL, // hMenu
m_hInstance, // hInstance
this); // lpParam

MARGINS dwmMargins = {-1, -1, -1, -1};

// Extend glass to cover whole window
DwmExtendFrameIntoClientArea(FindWindow( 0, L"Minesweeper" ), &dwmMargins);

// Show the window
ShowWindow(m_hwndOverlay, SW_SHOWDEFAULT);
UpdateWindow(m_hwndOverlay);

Share this post


Link to post
Share on other sites
Sign in to follow this  

  • Advertisement
×

Important Information

By using GameDev.net, you agree to our community Guidelines, Terms of Use, and Privacy Policy.

GameDev.net is your game development community. Create an account for your GameDev Portfolio and participate in the largest developer community in the games industry.

Sign me up!