在此记录
#define CreateCentralWindowEx(dwExStyle, lpClassName, lpWindowName, dwStyle, nWidth, nHeight,\
hWndParent, hMenu, hInstance, lpParam)\
CreateWindowExW(dwExStyle, lpClassName, lpWindowName, dwStyle, \
(GetSystemMetrics(SM_CXSCREEN) - (nWidth)) / 2, \
(GetSystemMetrics(SM_CYSCREEN) - (nHeight)) / 2, \
nWidth, nHeight, hWndParent, hMenu, hInstance, lpParam)
直接使用该CreateCentralWindowEx
宏替代CreateWindow(Ex)
函数即可直接创建屏幕居中窗口。