Hello to everyone!
I'm just new with code block and have the following question:
I created a few projects and they all work normally
but I have problems when I use a trackbar.
The dialog is not displayed, the program will be terminated immediately,
and I can not embed this code :
INITCOMMONCONTROLSEX ICC;
ICC.dwSize = sizeof(ICC);
ICC.dwICC = ICC_WIN95_CLASSES;
InitCommonControlsEx(ICC);
||=== TrackBar, Debug ===|
X:\TrackBar\main.cpp||In function 'int WinMain(HINSTANCE__*, HINSTANCE__*, CHAR*, int)':|
X:\TrackBar\main.cpp|42|error: 'INITCOMMONCONTROLSEX' was not declared in this scope|
X:\TrackBar\main.cpp|42|error: expected ';' before 'ICC'|
X:\TrackBar\main.cpp|44|error: 'ICC' was not declared in this scope|
X:\TrackBar\main.cpp|46|error: 'InitCommonControlsEx' was not declared in this scope|
||=== Erstellen beendet: 4 Fehler, 0 Warnungen===|
#define WIN32_LEAN_AND_MEAN
#include <windows.h>
#include <commctrl.h>
#include "resource.h"
HINSTANCE hInst;
BOOL CALLBACK DialogProc(HWND hwndDlg, UINT uMsg, WPARAM wParam, LPARAM lParam)
{
switch(uMsg)
{
case WM_INITDIALOG:
return TRUE;
case WM_CLOSE:
EndDialog(hwndDlg, 0);
return TRUE;
case WM_LBUTTONDOWN:
SendMessage(hwndDlg, WM_CLOSE, 0, 0);
return TRUE;
case WM_COMMAND:
switch(LOWORD(wParam))
{
//Button schliessen
case IDC_cmdSchliessen:
SendMessage(hwndDlg,WM_CLOSE,0,0);
return TRUE;
}
}
return FALSE;
}
int APIENTRY WinMain(HINSTANCE hInstance, HINSTANCE hPrevInstance, LPSTR lpCmdLine, int nShowCmd)
{
INITCOMMONCONTROLSEX ICC;
ICC.dwSize = sizeof(ICC);
ICC.dwICC = ICC_WIN95_CLASSES;
InitCommonControlsEx(ICC);
hInst = hInstance;
// The user interface is a modal dialog box
return DialogBox(hInstance, MAKEINTRESOURCE(DLG_MAIN), NULL, DialogProc);
Can someone tell me how I can incorporate these controls?
Thanks!