Open rofl0r opened 3 years ago
Hi @rofl0r,
It would not be a big deal to implement WNDCLASSEX, its just an expanded window class structure that has a few more fields (like hIconSm to support small icons as well as normal icons), that aren't used by Microwindows anyways.
For now, probably easier to just edit simple_window.c and change all WNDCLASSEX to WNDCLASS, and then the following:
//wc.cbSize = sizeof(WNDCLASSEX);
//wc.hIconSm = LoadIcon(NULL, IDI_APPLICATION);
if(!RegisterClassEx(&wc)) -> change to RegisterClass
That should compile and run.
thanks for your suggestion.
now i get
simple_window.c: In function 'WinMain':
simple_window.c:36:15: warning: implicit declaration of function 'LoadIcon' [-Wimplicit-function-declaration]
wc.hIcon = LoadIcon(NULL, IDI_APPLICATION);
^~~~~~~~
simple_window.c:36:30: error: 'IDI_APPLICATION' undeclared (first use in this function)
wc.hIcon = LoadIcon(NULL, IDI_APPLICATION);
^~~~~~~~~~~~~~~
simple_window.c:36:30: note: each undeclared identifier is reported only once for each function it appears in
simple_window.c:37:17: warning: implicit declaration of function 'LoadCursor' [-Wimplicit-function-declaration]
wc.hCursor = LoadCursor(NULL, IDC_ARROW);
^~~~~~~~~~
simple_window.c:37:34: error: 'IDC_ARROW' undeclared (first use in this function)
wc.hCursor = LoadCursor(NULL, IDC_ARROW);
^~~~~~~~~
trying to disable those too...
Just change
wc.hCursor = LoadCursor(NULL, IDC_ARROW);
to
wc.hCursor = 0; //LoadCursor(NULL, IDC_ARROW);
for now, same with LoadIcon.
thanks, that works and i get a working window. cool stuff!
regarding cursor: the default cursor which is almost horizontal in shape looks really 80ies, like in openmotif. is it possible to use the standard X11 cursor instead, or at least a windows-xp style cursor ?
The (80's style) Win32 cursor is declared in src/mwin/winmain.c:
static MWCURSOR arrow = { /* default arrow cursor*/
16, 16,
0, 0,
RGB(255, 255, 255), RGB(0, 0, 0),
{ 0xe000, 0x9800, 0x8600, 0x4180,
0x4060, 0x2018, 0x2004, 0x107c,
0x1020, 0x0910, 0x0988, 0x0544,
0x0522, 0x0211, 0x000a, 0x0004 },
{ 0xe000, 0xf800, 0xfe00, 0x7f80,
0x7fe0, 0x3ff8, 0x3ffc, 0x1ffc,
0x1fe0, 0x0ff0, 0x0ff8, 0x077c,
0x073e, 0x021f, 0x000e, 0x0004 }
};
You can look up the format of MWCURSOR in include/mwtypes.h, but basically its a 16x16 bitmap, with the first array being the cursor bits, and the second array being the mask bits. If you rearrange those hex numbers into a better column, or even better yet, arrange them as C binary numbers (0111111000111b, etc), you should be able to visually play with a replacement cursor.
hi, today i wanted to try out the MW_FEATURE_RESIZEFRAME feature (#26) so i went looking for some win32 sample programs and found this http://www.winprog.org/tutorial/
here is a small sample program i wanted to compile against microwindows (simple_window.c)
but it seems WNDCLASSEX isn't implemented in microwindows. are there any plans to add this ?