Sign Up

Sign Up to our social questions and Answers Engine to ask questions, answer people’s questions, and connect with other people.

Have an account? Sign In

Have an account? Sign In Now

Sign In

Login to our social questions & Answers Engine to ask questions answer people’s questions & connect with other people.

Sign Up Here

Forgot Password?

Don't have account, Sign Up Here

Forgot Password

Lost your password? Please enter your email address. You will receive a link and will create a new password via email.

Have an account? Sign In Now

You must login to ask a question.

Forgot Password?

Need An Account, Sign Up Here

Please briefly explain why you feel this question should be reported.

Please briefly explain why you feel this answer should be reported.

Please briefly explain why you feel this user should be reported.

Sign InSign Up

The Archive Base

The Archive Base Logo The Archive Base Logo

The Archive Base Navigation

  • SEARCH
  • Home
  • About Us
  • Blog
  • Contact Us
Search
Ask A Question

Mobile menu

Close
Ask a Question
  • Home
  • Add group
  • Groups page
  • Feed
  • User Profile
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Buy Points
  • Users
  • Help
  • Buy Theme
  • SEARCH
Home/ Questions/Q 8558425
In Process

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: June 11, 20262026-06-11T15:48:31+00:00 2026-06-11T15:48:31+00:00

#include <Windows.h> #include <stdlib.h> #include <tchar.h> #pragma comment(linker,\/manifestdependency:type=’win32’name=’Microsoft.Windows.Common-Controls’\ version=’6.0.0.0′ processorArchitecture=’*’\ publicKeyToken=’6595b64144ccf1df’ language=’*’\) LRESULT WINAPI

  • 0
#include <Windows.h>
#include <stdlib.h>
#include <tchar.h>

#pragma comment(linker,"\"/manifestdependency:type='win32'name='Microsoft.Windows.Common-Controls'\
                version='6.0.0.0' processorArchitecture='*'\
                publicKeyToken='6595b64144ccf1df' language='*'\"")

LRESULT WINAPI WndProc(HWND hWnd,UINT msg,WPARAM lParam,LPARAM wParam)
{
    return DefWindowProc(hWnd,msg,wParam,lParam);
}

int WinMain(HINSTANCE hInst,HINSTANCE hpInst,LPSTR cmdLine,int cmdshow)
{
    static TCHAR classname[]=_T("SCONF");
    static TCHAR wTitle[]=_T("Server Configurator");

    WNDCLASSEX wClass;
    wClass.cbClsExtra=NULL;
    wClass.cbSize=sizeof(WNDCLASSEX);
    wClass.cbWndExtra=NULL;
    wClass.hbrBackground=(HBRUSH)(CTLCOLOR_SCROLLBAR);
    wClass.hCursor=LoadCursor(NULL,IDC_ARROW);
    wClass.hIcon=LoadIcon(hInst,IDI_APPLICATION);
    wClass.hIconSm=LoadIcon(hInst,IDI_APPLICATION);
    wClass.hInstance=hInst;
    wClass.lpfnWndProc=WndProc;
    wClass.lpszClassName=classname;
    wClass.lpszMenuName=NULL;
    wClass.style=CS_HREDRAW|CS_VREDRAW;
    if(!RegisterClassEx(&wClass))
    {
        MessageBox(NULL,L"Could not register class!", L"ERROR",MB_ICONERROR|MB_OK);
    }
    RECT wr={0,0,200,250};
    AdjustWindowRect(&wr,WS_CAPTION,false);

    HWND hWnd=CreateWindow(
        classname,
        wTitle,
        WS_CAPTION,
        GetSystemMetrics(SM_CXSCREEN)/2-100,
        GetSystemMetrics(SM_CYSCREEN)/2-125,
        wr.right-wr.left,//width
        wr.bottom-wr.top,//height
        NULL,
        NULL,
        hInst,
        NULL);

    if(!hWnd)
    {
        MessageBox(NULL,_T("Could not create window!"),_T("ERROR!"),MB_ICONERROR);
        return 1;
    }
    ShowWindow(hWnd,cmdshow);
    MSG msg;
    while(GetMessage(&msg,0,0,0))
    {
        TranslateMessage(&msg);
        DispatchMessage(&msg);
    }
    return (int)msg.wParam;
}

this is the full code, when I try to compile, the hWnd always returns false…I even tried copying the code from a working program and it did not work…What’s going on here? It always worked before…

  • 1 1 Answer
  • 0 Views
  • 0 Followers
  • 0
Share
  • Facebook
  • Report

Leave an answer
Cancel reply

You must login to add an answer.

Forgot Password?

Need An Account, Sign Up Here

1 Answer

  • Voted
  • Oldest
  • Recent
  • Random
  1. Editorial Team
    Editorial Team
    2026-06-11T15:48:33+00:00Added an answer on June 11, 2026 at 3:48 pm

    you are twisting/crossing over your wParam and lParam in The WndProc function –

    LRESULT WINAPI WndProc(HWND hWnd,UINT msg,WPARAM lParam,LPARAM wParam) 
    {
        return DefWindowProc(hWnd,msg,wParam,lParam);
    }
    
    LRESULT WINAPI WndProc(HWND hWnd,UINT msg,WPARAM lParam,LPARAM wParam) {
        return DefWindowProc(hWnd,msg,wParam,lParam);
    }
    

    and I think this is not helping.

    LRESULT WINAPI WndProc(HWND hWnd,UINT msg,WPARAM lParam,LPARAM wParam) //check your parameter names!!!!!!!!!!!!!!!!!!!!!!!
    {
        return DefWindowProc(hWnd,msg,wParam,lParam);
    }
    
    • 0
    • Reply
    • Share
      Share
      • Share on Facebook
      • Share on Twitter
      • Share on LinkedIn
      • Share on WhatsApp
      • Report

Sidebar

Related Questions

#include <stdlib.h> #include <Windows.h> #include <Tchar.h> HANDLE wHnd; // Handle to write to the
Here is my code: #include <stdio.h> #include <string.h> #include <windows.h> #include <tchar.h> #define MAX_KEY_LENGTH
I wrote this code and compiled it, #include <windows.h> #include <stdio.h> #include <stdlib.h> #include
Functions.h #include <iostream> #include <windows.h> #include <conio.h> #include <limits> #include <stdexcept> #include <stdlib.h> #include
#ifndef UNICODE #define UNICODE #endif #include <stdlib.h> #include <stdio.h> #include <time.h> #include <Windows.h> int
I just needed to include windows office 2010 Ribbon bar into my C# application(Not
.386 .model flat, stdcall option casemap:none include windows.inc include kernel32.inc include user32.inc includelib user32.lib
I'm looking to include a Windows .exe in my gem and call on that
windows.h is included, code: #include <windows.h> int main() { HANDLE hToken; DWORD dwSize; TOKEN_ELEVATION_TYPE
My sytem: Windows, Python 2.7 I downloaded a package and want to include it

Explore

  • Home
  • Add group
  • Groups page
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Users
  • Help
  • SEARCH

Footer

© 2021 The Archive Base. All Rights Reserved
With Love by The Archive Base

Insert/edit link

Enter the destination URL

Or link to existing content

    No search term specified. Showing recent items. Search or use up and down arrow keys to select an item.