ah ... it runs fine in Dev-cpp. Thank you SO much, Wolfpack.
Just one more question. I'm creating this program to do some bitmap displaying/manipulation ... so I'd like to have another window (a blank one with no windows style/border and NO menu) pop up over this window.
So right after this bit of code ...
WNDCLASSEX wincl; /* Data structure for the windowclass */
/* The Window structure */
wincl.hInstance = hThisInstance;
wincl.lpszClassName = szClassName;
wincl.lpfnWndProc = WindowProcedure; /* This function is called by windows */
wincl.style = CS_DBLCLKS; /* Catch double-clicks */
wincl.cbSize = sizeof (WNDCLASSEX);
/* Use default icon and mouse-pointer */
wincl.hIcon = LoadIcon (NULL, IDI_APPLICATION);
wincl.hIconSm = LoadIcon (NULL, IDI_APPLICATION);
wincl.hCursor = LoadCursor (NULL, IDC_ARROW);
wincl.lpszMenuName = NULL; /* No menu */
wincl.cbClsExtra = 0; /* No extra bytes after the window class */
wincl.cbWndExtra = 0; /* structure or the window instance */
/* Use Windows's default color as the background of the window */
wincl.hbrBackground = (HBRUSH) COLOR_BACKGROUND;
/* Register the window class, and if it fails quit the program */
if (!RegisterClassEx (&wincl))
return 0;
/* The class is registered, let's create the program*/
hwnd = CreateWindowEx (
0, /* Extended possibilites for variation */
szClassName, /* Classname */
"Windows App", /* Title Text */
WS_OVERLAPPEDWINDOW, /* default window */
CW_USEDEFAULT, /* Windows decides the position */
CW_USEDEFAULT, /* where the window ends up on the screen */
544, /* The programs width */
375, /* and height in pixels */
HWND_DESKTOP, /* The window is a child-window to desktop */
NULL, /* No menu */
hThisInstance, /* Program Instance handler */
NULL /* No Window Creation data */
);
... I tried the following:
1.
wincl.lpfnWndProc = ImageWindowProc();
registered wincl
created a new HWND imageHwnd using CreateWindowEx()
then used the ShowWindow method to display this new window as well.
2.
created a new WNDCLASSEX -- wincl2.
After the creation of the main window:
initialized wincl2
registered wincl2
created a new HWND imageHwnd using CreateWindowEx()
used ShowWindow method to display this new window as well.
The problem is that in both of the above cases, the new window (whether it is the child is created as the child window of the main window or not) ... appears with the same menu that was added to the main window. The new window appears to share the main window's WindowProcedure method, even though I have tried to set it otherwise.
(My ImageWindowProc does NOT yet respond to any messages, e.g. display menu, dialogbox etc.)