motobizio
July 20th, 2009, 07:45 AM
Hello to all.
I would like to make a toolbar with one button. I wrote some code, and all seems to work corectly.
I only have 3 little questions:
1. Why my cursor is in "wait state" (hourglass) when is placed over my toolbar?
2. I created an image list for managing bitmaps. Could I manage one bitmap for the "default" state of the button, and another bitmap for the "disabled" status of the same button?
3. My sysmenu don't exist: why?
This is my code:
// main window class
ATOM MyRegisterClass(HINSTANCE hInstance)
{
WNDCLASSEX wcex;
wcex.cbSize = sizeof(WNDCLASSEX);
wcex.style = CS_HREDRAW | CS_VREDRAW;
wcex.lpfnWndProc = WndProc;
wcex.cbClsExtra = 0;
wcex.cbWndExtra = 0;
wcex.hInstance = hInstance;
wcex.hIcon = LoadIcon(hInstance, MAKEINTRESOURCE(IDI_PROVA_STAMPA));
wcex.hCursor = LoadCursor(NULL, IDC_ARROW);
wcex.hbrBackground = (HBRUSH)(COLOR_WINDOW+1);
wcex.lpszMenuName = MAKEINTRESOURCE(IDC_PROVA_STAMPA);
wcex.lpszClassName = szWindowClass;
wcex.hIconSm = LoadIcon(wcex.hInstance, MAKEINTRESOURCE(IDI_SMALL));
return RegisterClassEx(&wcex);
}
// Creating main window
hWnd = CreateWindow(szWindowClass, szTitle, WS_OVERLAPPEDWINDOW, CW_USEDEFAULT, 0, CW_USEDEFAULT, 0, NULL, NULL, hInstance, NULL);
// Creating toolbar
hTool = CreateWindowEx(0, TOOLBARCLASSNAME, TEXT("TOOL"), WS_CHILD | CCS_ADJUSTABLE,
0, 0, 160, 140, hWnd, NULL, hInstance, WndProc);
Thank you soo much for any reply!
I would like to make a toolbar with one button. I wrote some code, and all seems to work corectly.
I only have 3 little questions:
1. Why my cursor is in "wait state" (hourglass) when is placed over my toolbar?
2. I created an image list for managing bitmaps. Could I manage one bitmap for the "default" state of the button, and another bitmap for the "disabled" status of the same button?
3. My sysmenu don't exist: why?
This is my code:
// main window class
ATOM MyRegisterClass(HINSTANCE hInstance)
{
WNDCLASSEX wcex;
wcex.cbSize = sizeof(WNDCLASSEX);
wcex.style = CS_HREDRAW | CS_VREDRAW;
wcex.lpfnWndProc = WndProc;
wcex.cbClsExtra = 0;
wcex.cbWndExtra = 0;
wcex.hInstance = hInstance;
wcex.hIcon = LoadIcon(hInstance, MAKEINTRESOURCE(IDI_PROVA_STAMPA));
wcex.hCursor = LoadCursor(NULL, IDC_ARROW);
wcex.hbrBackground = (HBRUSH)(COLOR_WINDOW+1);
wcex.lpszMenuName = MAKEINTRESOURCE(IDC_PROVA_STAMPA);
wcex.lpszClassName = szWindowClass;
wcex.hIconSm = LoadIcon(wcex.hInstance, MAKEINTRESOURCE(IDI_SMALL));
return RegisterClassEx(&wcex);
}
// Creating main window
hWnd = CreateWindow(szWindowClass, szTitle, WS_OVERLAPPEDWINDOW, CW_USEDEFAULT, 0, CW_USEDEFAULT, 0, NULL, NULL, hInstance, NULL);
// Creating toolbar
hTool = CreateWindowEx(0, TOOLBARCLASSNAME, TEXT("TOOL"), WS_CHILD | CCS_ADJUSTABLE,
0, 0, 160, 140, hWnd, NULL, hInstance, WndProc);
Thank you soo much for any reply!