I triple checked but yes, CHOOSECOLOR.hInstance is an HWND...
diff --git a/include/commdlg.h b/include/commdlg.h index 43216ef..adf8ac7 100644 --- a/include/commdlg.h +++ b/include/commdlg.h
@@ -123,7 +123,7 @@ typedef struct { DWORD lStructSize; HWND hwndOwner; - HWND hInstance; + HWND hInstance; /* Should be an HINSTANCE but MS made a typo */ DWORD rgbResult; LPDWORD lpCustColors; DWORD Flags; @@ -136,7 +136,7 @@ typedef struct { DWORD lStructSize; HWND hwndOwner; - HWND hInstance; + HWND hInstance; /* Should be an HINSTANCE but MS made a typo */ DWORD rgbResult; LPDWORD lpCustColors; DWORD Flags;
diff --git a/programs/cmdlgtst/cmdlgtst.c b/programs/cmdlgtst/cmdlgtst.c index 442153a..864f30d 100644 --- a/programs/cmdlgtst/cmdlgtst.c +++ b/programs/cmdlgtst/cmdlgtst.c
@@ -152,7 +152,7 @@ cc.lStructSize = sizeof(CHOOSECOLOR); cc.hwndOwner = hWnd; - cc.hInstance = g_hInstance; + cc.hInstance = (HWND)g_hInstance; /* Should be an HINSTANCE but MS made a typo */ cc.rgbResult = RGB(0,0,0); cc.lpCustColors = cc_cr; cc.Flags = 0;