Sir, I have a problem in creating some buttons in my main window.
I have no errors and no warnings in creating a button but I cannot see my button on my main window,
HWND button1;
button1 = CreateWindow(L"button", L"Run Timer", WS_CHILD | WS_VISIBLE | BS_DEFPUSHBUTTON | BS_FLAT, 0, 180, 197, 90, button1, (HMENU)IDC_VS_TIME, hInst, NULL);
ShowWindow(button1, nCmdShow);
UpdateWindow(button1);
What I have tried:
Since I am learning I am not sure of spotting the bug,
I see my main window displaying so I tried copying its HWND variable hWnd to my button 1 like this,
button1 = CreateWindow(L"button", L"Run Timer", WS_CHILD | WS_VISIBLE | BS_DEFPUSHBUTTON | BS_FLAT, 0, 180, 197, 90, hWnd, (HMENU)IDC_VS_TIME, hInst, NULL);
ShowWindow(hWnd, nCmdShow);
UpdateWindow(hWnd);
I changed button1 to hWnd and my button gets displayed I did also compared both the code but I can't find anything.