-
-
Save anonymous/4a10643f1cf7d06594781a22f1ff8a5c to your computer and use it in GitHub Desktop.
DialogBoxIndirectParamW (programmatic dialog creation)
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
// I think I'm getting closer, but I still get 1813: (Resource Type Not Found) | |
typedef struct ControlData_Wine_s | |
{ | |
WORD DlgVer; | |
WORD Signature; | |
DWORD Style; | |
DWORD ExStyle; | |
WORD NbItems; | |
WORD PosX; | |
WORD PosY; | |
WORD SizeX; | |
WORD SizeY; | |
WORD Menu; | |
WORD Class; | |
LPWSTR TitleText; | |
// I'm writing this assuming a single control, need to extend to multiple controls | |
DWORD ControlStyle; | |
DWORD ControlExStyle; | |
WORD ControlPosX; | |
WORD ControlPosY; | |
WORD ControlSizeX; | |
WORD ControlSizeY; | |
WORD ControlID; | |
WORD ControlTypeCategory; | |
WORD ControlType; | |
LPWSTR ControlInitialText; | |
WORD InitialData; | |
} ControlData_Wine_t; | |
ControlData_Wine_t ControlData = { 0 }; | |
ControlData.DlgVer = 0x0000; // not extended | |
ControlData.Signature = 0x0000; // not extended | |
ControlData.Style = WS_VISIBLE | WS_CHILD | DS_MODALFRAME; | |
ControlData.ExStyle = 0; | |
ControlData.NbItems = 1; // 1 control | |
ControlData.PosX = 0; | |
ControlData.PosY = 0; | |
ControlData.SizeX = 200; | |
ControlData.SizeY = 200; | |
ControlData.Menu = 0x0000; // no menu | |
ControlData.Class = 0x0000; // use builtin dialog class | |
ControlData.TitleText = L"Testing Title"; | |
ControlData.ControlStyle = WS_VISIBLE | WS_CHILD; | |
ControlData.ControlExStyle = 0; | |
ControlData.ControlPosX = 15; | |
ControlData.ControlPosY = 15; | |
ControlData.ControlSizeX = 100; | |
ControlData.ControlStyle = 100; | |
ControlData.ControlID = 75; // button ID | |
ControlData.ControlTypeCategory = 0xFFFF; // use builtin type | |
ControlData.ControlType = 0x0080; // button control | |
ControlData.ControlInitialText = L"Button Text"; | |
ControlData.InitialData = 0x0000; | |
INT_PTR result = DialogBoxIndirectParamW(myInstance, &ControlData, hwnd, DlgProc, NULL); |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment