20 ms·
Creating a Unix Application Using the Win32 API (1998)
- mellery451 11y agoI worked on a large to-UNIX migration using Mainsoft long ago. It was amazing how complete their win32 solution was, but it all felt so wrong. Using cross platform libraries from the get-go and NOT relying on single platform architectural components (like COM) is ultimately a better way to go.
- mathnode 11y agoAfter Avid acquired Softimage 3D from Microsoft, the next version, coined Softimage XSI, had a Linux version available through MainWin. It was diabolical. But it limped on; over the years maintaining an extremely tight version range of external library dependencies. Last version I used required Fedora 7 x64, a minor-version specific driver for FireGL/Quadro that just so happen to be on the CD that came with the HP XW workstation. Bite the head off a chicken, and boil snails with lizard tails, let it cool to room temperature, re-boil and simmer throughout use of softimage. Softimage is now declared dead by their current owners, Autodesk.
- oso2k 11y agoIn 1998, one could have also used Nano-X Windows (nee Microwindows)[0][1] for much of the same function GUI functionality. [0] https://en.wikipedia.org/wiki/Microwindows#Overview https://en.wikipedia.org/wiki/Microwindows#Overview [1] http://www.microwindows.org/ http://www.microwindows.org/
- userbinator 11y agoInteresting to note that WINE predates this by several years - 1993 - but apparently there were commercial Win32 UNIX layers available too at the time. On X-Windows, you can configure your system such that the focus follows the mouse. That is, when you move the mouse to a window, the focus automatically moves to that window. It seems most early UNIX systems I used were configured this way, and it was extremely irritating since I was accustomed to "parking" the pointer out of the way, somewhere else on the screen, when doing things like filling in text fields.
- rootbear 11y agoI, on the other hand, strongly prefer focus follows mouse. At least on Unix systems, one (usually) gets to choose. On Windows and the Mac, no such flexibility exists. It's the same with windows stacking order control. I routinely push a window to the bottom of the pile on Unix and greatly miss that ability on my Mac. The "native" way to do that would be to minimize the window, but that's not really the same thing.
- WorldWideWayne 11y agoOS X is the completely inflexible OS here, as usual - not Windows. This setting is built into Windows [1] and if you don't like the way it works, you can also do it with a few lines of AutoHotKey code. [1] - http://winaero.com/blog/turn-on-xmouse-active-window-tracking-focus-follows-mouse-pointer-feature-in-windows-8-1-windows-8-and-windows-7/ http://winaero.com/blog/turn-on-xmouse-active-window-trackin...
- Jtsummers 11y agoNice. Now if it'd work consistently. We have Microsoft Lync for work. I've enabled the feature, but it will only work on the contact list window, not the chat windows. It also only works for some windows (like IE) when pointing to certain parts of the window. Having the pointer on the text of a page doesn't seem to be good enough, it has to be on the chrome and toolbars.
- david-given 11y agoBeware: > They will also get auto raised, meaning the window on which the mouse hovers which be brought to the foreground. If you don't want autoraise you have to hack the registry. And even then it works very badly. A lot of apps, at least back when I was using XMouse on XP, assume that if they have the focus they're at the top of the stack, and some (mostly the Microsoft ones!) will autoraise themselves regardless of the registry setting. Focus-follows-mouse on Windows isn't, or at least wasn't, much of a success. It was marginally less annoying than click-to-focus, IMO, but only marginally.
- thwarted 11y agoGlobal variables in Win32 dynamic-link libraries (DLLs) are visible across processes, so it is important that developers are careful that these globals do not conflict with any variables within the Unix shared libraries. Does anyone have any more information on this? This is presented/worded as the nature of DLL globals being shared across processes is why they they have to ensure they don't conflict, but this seems somewhat obvious if the globals are not namespaced within the library in some sense. The more interesting question is how the DLLs' data was visible across processes such that this mattered at all, since this kind of sharing isn't available in the UNIX process or shared object model at all by default. How does WINE account for this?
- ctstover 11y agoShared libraries are mmap()ed share private. Imagine that one added library initialization code (load time) that mmap()ed a section as shared public for some values. That's the 'doz model. The win16 model is much more fascinating though.
- kazinator 11y agoGlobal variables in DLL's are definitely not visible across processes. Each process which attaches a DLL has its own instance, in its own protected address space. If the claim were true at face value, it would mean that if two programs use, say, MSVCRT.DLL (Microsoft's Visual C run-time), if one program reads from stdin or writes to stdout, it interferes with the other.
- ctstover 11y agoCorrect, normal globals no. There is a way to make some special values have this behavior though. It's been a long time, but I think the reason was to have some analog to the win16 behavior. In that shared-everything universe, there were these IPC through dll patterns.
- kazinator 11y agoWin32 has an API for shared memory that is straightforward to use. You use CreateFileMapping with an INVALID_HANDLE for the file to create a mapping which is like MAP_ANONYMOUS in mmap (not backed by a file). It is not literally anonymous because you can give the mapping a name (similar to, say, a POSIX semaphore name in sem_open). Other processes can attach to the mapping using the name. To actually instantiate the mapping in the address space, you use the MapViewOfFile function. MSDN: https://msdn.microsoft.com/en-us/library/windows/desktop/aa366551%28v=vs.85%29.aspx https://msdn.microsoft.com/en-us/library/windows/desktop/aa3... Been years since I used this stuff.
- slinkyavenger 11y agoThe point about WCHAR size reminded me of how little browser security mattered back then. Kinda interesting to think about how the internet was so fresh that there wasn't such a focus on a secure application. I wonder how many buffer over/underflow exploits were completely ignored.
- on_ 11y agoDanny Hillis gives a great talk called "The Internet could crash. We need a Plan B"[0]. In the talk, outside of security, he was talking about the culture of the early internet. It was really interesting, he said he still has a phonebook sized book of email addresses. He registered the 2nd domain on the entire internet (i think it was symbology but maybe that was the first) and he could have whatever he wanted. He summed up the culture of the time as, "then I realized it would be great to have a couple other domain names, but I thought that wouldn't be very nice"[approximated]. edit: Sorry forgot to make the point. Paul Graham says it in the Pycon 08' talk, it was built for guys at Bell labs to ask one another to get lunch. The people on the early internet were often scientists, engineers and academics and thus had mutual respect for one another. Stallman talks about not even having passwords on stuff, these were academics who were personally or professionally friendly so security wasn't at the forefront of the design. [0]https://www.ted.com/talks/danny_hillis_the_internet_could_crash_we_need_a_plan_b?language=en https://www.ted.com/talks/danny_hillis_the_internet_could_cr...
- hga 11y ago[Danny Hillis] registered the 2nd domain on the entire internet (i think it was symbology but maybe that was the first) That would be Symbolics, the best known Lisp Machine company: https://en.wikipedia.org/wiki/Symbolics https://en.wikipedia.org/wiki/Symbolics Which he personally did not like at all due to its role in suppressing use of Macsyma outside of its machines. Per Wikipedia his Thinking Machines "think.com" was 3rd, per http://interwebs.top5.com/then-and-now-5-oldest-domain-names/ http://interwebs.top5.com/then-and-now-5-oldest-domain-names... BBN, which helped build a lot of the ARPANET and Internet was 2nd, think.com was followed by the MMC consortium and DEC. As for the security, it was actually quite unusual that the ITS operating system machines he, Stallman, etc. used had essentially no security, just obscurity, although a password system did have to be added by the end of the '70s. The threat environment was certainly much much less back then, but computer time was very dear, and the most common paradigm required explicit budgeting, accounts that kept track of each CPU second used, etc. One reason PCs became so popular, their bigger engineering workstation brothers, etc. And plenty of people were thinking about security, e.g. see the Multics project.
- angersock 11y agoNote that the author is Nancy Winnick Cluts. Not a total boys club in application programming!
- kazinator 11y agoAround that time frame, maybe a few years later, I ported some Windows middleware to Linux. The middleware was some COM objects written in C++, configured using the registry. I ported all those functions: CoInitializeEx, CoCreateClass, RegThis, RegThat, you name it. The framework nicely looked for DllMain and DllCanUnloadNow functions in the shared objects, and such. The registry mapped to a hierarchical directory structure. Today, if you want to write Unix applications using Win32, the obvious choice would be WINE.
- pcunite 11y agoGoing the other way, Microsoft once maintained a "Windows Services for UNIX" package. https://en.wikipedia.org/wiki/Windows_Services_for_UNIX https://en.wikipedia.org/wiki/Windows_Services_for_UNIX
- linkydinkandyou 11y agoEven today, using intermediate libraries like Cygwin, I have an easier time building FOSS that was meant for Linux on Windows than I do on MacOS!
- mrpippy 11y agoThere was also a commercial Mac-Toolbox-on-UNIX layer created: Quorum Latitude. Adobe used it to bring Photoshop 3, Illustrator 5.5, and Premiere to SGI IRIX. They were later purchased by Metrowerks, and saw an opportunity to be a porting layer to bring classic Mac apps to Rhapsody. Of course Apple later relented, and created Carbon to be that transitionary layer. The MacTech archives have some interesting historical info: http://www.mactech.com/articles/mactech/Vol.13/13.06/Jun97FactoryFloor/index.html http://www.mactech.com/articles/mactech/Vol.13/13.06/Jun97Fa... http://www.macmod.com/articles/mactech/Vol.14/14.01/Jan98FactoryFloor/index.html http://www.macmod.com/articles/mactech/Vol.14/14.01/Jan98Fac... http://www.mactech.com/articles/mactech/Vol.14/14.02/Feb98FactoryFloor/index.html http://www.mactech.com/articles/mactech/Vol.14/14.02/Feb98Fa...