0

This worked perfectly in a different project but I get this error after moving it over to a different project

https://i.stack.imgur.com/lrPY1.png https://i.stack.imgur.com/nbHgh.png

I am compiling in x86 & Release

int WINAPI WinMain(HINSTANCE hInstance, HINSTANCE hSecInstance, LPSTR nCmdLine, INT nCmdShow)

{

CreateThread(0, 0, (LPTHREAD_START_ROUTINE)SetWindowToTarget, 0, 0, 0);

WNDCLASSEX wClass;
wClass.cbClsExtra = NULL;
wClass.cbSize = sizeof(WNDCLASSEX);
wClass.cbWndExtra = NULL;
wClass.hbrBackground = (HBRUSH)CreateSolidBrush(RGB(0, 0, 0));
wClass.hCursor = LoadCursor(0, IDC_ARROW);
wClass.hIcon = LoadIcon(0, IDI_APPLICATION);
wClass.hIconSm = LoadIcon(0, IDI_APPLICATION);
wClass.hInstance = hInstance;
wClass.lpfnWndProc = WinProc;
wClass.lpszClassName = lWindowName;
wClass.lpszMenuName = lWindowName;
wClass.style = CS_VREDRAW | CS_HREDRAW;

if(!RegisterClassEx(&wClass))
    exit(1);

tWnd = FindWindow(0, tWindowName);
if (tWnd)
{
    GetWindowRect(tWnd, &tSize);
    Width = tSize.right - tSize.left;
    Height = tSize.bottom - tSize.top;
    hWnd = CreateWindowEx(WS_EX_TOPMOST | WS_EX_TRANSPARENT | WS_EX_LAYERED, lWindowName, lWindowName,  WS_POPUP, 1, 1, Width, Height, 0, 0, 0, 0);
    SetLayeredWindowAttributes(hWnd, 0, 1.0f, LWA_ALPHA);
    SetLayeredWindowAttributes(hWnd, 0, RGB(0, 0, 0), LWA_COLORKEY);
    ShowWindow( hWnd, SW_SHOW);
}

DirectXInit(hWnd);

for (;;)
{
    if(PeekMessage(&Message, hWnd, 0, 0, PM_REMOVE))
    {
        DispatchMessage(&Message);
        TranslateMessage(&Message);
    }
    Sleep(1);
}
return 0;

}

Cow Nation
  • 71
  • 9
  • 2
    Possible duplicate of [What is an undefined reference/unresolved external symbol error and how do I fix it?](https://stackoverflow.com/questions/12573816/what-is-an-undefined-reference-unresolved-external-symbol-error-and-how-do-i-fix) – Retired Ninja May 13 '18 at 04:17
  • 1
    Your errors belong in the question as text, not images. Neither of your issues relates to DirextX in any way. https://msdn.microsoft.com/en-us/library/windows/desktop/dd183518(v=vs.85).aspx – Retired Ninja May 13 '18 at 04:19
  • You should link to ``Gdi32.lib``: ``#pragma comment(lib, "Gdi32.lib")`` – Asesh May 13 '18 at 04:22
  • @Asesh That worked!! Thanks so much! – Cow Nation May 13 '18 at 04:36

0 Answers0