Code Monkey home page Code Monkey logo

Comments (5)

ghaerr avatar ghaerr commented on May 18, 2024

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.

from microwindows.

rofl0r avatar rofl0r commented on May 18, 2024

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...

from microwindows.

ghaerr avatar ghaerr commented on May 18, 2024

Just change

wc.hCursor   = LoadCursor(NULL, IDC_ARROW);

to

wc.hCursor   = 0; //LoadCursor(NULL, IDC_ARROW);

for now, same with LoadIcon.

from microwindows.

rofl0r avatar rofl0r commented on May 18, 2024

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 ?

from microwindows.

ghaerr avatar ghaerr commented on May 18, 2024

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.

from microwindows.

Related Issues (20)

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. 📊📈🎉

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.