Hello to all,
As written in the title, I use the win32 API EXCLUSIVELY to create my application (not MFC).
My problem is to create a dialog box, then insert a new component, ie a HWND that would call for a new class WNDCLASS with its own callback.
I have therefore two callback, one for the dialog box and one for my new code.So I wrote the following code:
# include "resource.h"
# include <windows.h>
# include <commctrl.h>
# include <richedit.h>
/ / Dialog resources
IDD_DIALOG1 DIALOG 0, 0, 275, 222
STYLE DS_3DLOOK | DS_CENTER | DS_MODALFRAME | DS_SHELLFONT | WS_VISIBLE | WS_BORDER | WS_CAPTION | WS_DLGFRAME | WS_POPUP | WS_SYSMENU
FONT 8, "MS Shell Dlg 2"
DEFPUSHBUTTON "OK" idők, 220, 203, 50, 14
PUSHBUTTON "Cancel", IDCANCEL, 165, 203, 50, 14
PUSHBUTTON "Load ...", IDC_BUTTON1, 220, 184, 50, 14
EDITTEXT IDC_EDIT1, 5, 184, 210, 14, ES_AUTOHSCROLL
CONTROL "", IDC_SLIDER1, TRACKBAR_CLASS, WS_TABSTOP | TBS_BOTH | TBS_NOTICKS, 5, 133, 210, 15
But then, my dialog box does not my new component and the program enters an infinite loop, it's very disappointing ...
# ifndef IDC_STATIC
# define IDC_STATIC (-1)
# define IDD_DIALOG1 100
# define IDC_SLIDER1 1000
# define IDC_BUTTON1 1001
# define IDC_EDIT1 1002
# define IDC_CUSTOM1 1003
I think the problem comes from the callback of the dlg that returns TRUE when it should return FALSE or vice versa, but I am not of course me ... I tried different configuration of TRUE or FALSE in my switch (uMsg), but I do not get better results.
So, if anyone can tell me how I do that I will be very grateful.