Hacker Newsnew | past | comments | ask | show | jobs | submitlogin

Do you have some directions on the WinAPI in Nim?

I felt a bit overwhelmed with the whole wrapping thing.



You don't have to wrap anything. It's exactly like using it from C, except maybe a bit easier/safer. Just import windows. Then you can write code like this:

    hWndMain = CreateWindowEx(
        WS_EX_TOPMOST,              # Optional window styles.
        CLASS_NAME,                 # Window class
        WINDOWNAME,                 # Window text
        windowStyles,               # Window style

        # Size and position
        centerX, centerY,
        APP_WIDTH, APP_HEIGHT,

        cast[HWND](nil),        # Parent window    
        cast[HMENU](nil),       # Menu
        hInstance,              # Instance handle
        cast[LPVOID](nil)       # Additional application data
        );




Guidelines | FAQ | Lists | API | Security | Legal | Apply to YC | Contact

Search: