Categories
Mastering Development

Port Win32/WinAPI application to wxWidgets

I’m currently using Windows 10, MSVC v142 (with VS2019) and wxWidgets 3.1.3. I have an old Windows C++ application that uses WinAPI for its GUI features, i.e Windows message loop, using "CreateWindow", and having to "manually" create all window procedures and event handling. I want to improve this application by gradually replacing the UI using […]

Categories
Mastering Development

I don’t know how to use codeblocks win32 gui

I used win32 GUI and managed to make some sort of interface after some googling but i don’t know how to make a button do something or to make an integer get value from a textbox in the GUI. This is the main #include <windows.h> #include <commctrl.h> #include <stdio.h> #include “resource.h” HINSTANCE hInst; BOOL CALLBACK […]

Categories
Mastering Development

OpenGL context creation with the ARB extetion is not working

I want to create an OpenGL context using the ARB extention, but it doesn’t works. The error messages printed in the console at runtime ( my puts() calls ) are : “Choosing the final window pixel format failed.” and “Creating the final rendering context failed.”. And the window doesn’t dispalys. When I remove the 3 […]

Categories
Development

Why does SetWindowRgn not work for static controls?

I have some problems with making static controls rounded. I can’t understand why SetWindowRgn doesn’t work for a static control here. Also I’ve tried SelectClipRgn and it works. But nevertheless why SetWindowRgn doesn’t? The Microsoft documentation states that The system does not display any portion of a window that lies outside of the window region. […]

Categories
Development

Is there a way I can pass another parameter to use inside this window callback function?

LRESULT CALLBACK WindowProc(HWND hwnd, UINT uMsg, WPARAM wParam, LPARAM lParam) So, this is the function prototype for a Window Procedure of some window created using the Windows API (win32). It is used to process some window messages like when the user clicks the Close button, or resize the window. WNDCLASSA window_class = {0}; window_class.style = […]

Categories
API Development

WinAPI timer callback not called while child window is in focus

I’m working on a 3D editor app using Direct3D and WinAPI. I create a main window, which has a child window that takes up a portion of the main window’s client area. This is used by D3D as the render target. I then also create a separate window with CreateWindow, which is built the same […]

Categories
Development

How to repaint a child window only once every frame using WinAPI?

I’m using Direct3D and WinAPI to create windows and render 3D objects in the client area. I use the standard Windows message loop to invalidate the rectangle of the render window, and in the message handler of the render window, I perform a render call in Direct3D when processing the WM_PAINT message: BOOL bRet; HWND […]