Allegro.cc - Online Community

Allegro.cc Forums » Off-Topic Ordeals » WinAPI.. wtf were they thinking!?

This thread is locked; no one can reply to it. rss feed Print
 1   2 
WinAPI.. wtf were they thinking!?
Michael Jensen
Member #2,870
October 2002
avatar

I really hate the win api, and never bothered to learn mfc -- .net forms are very simple, and even creating an application without windows or with multiple windows or even an MDI is pretty damn easy.

Quote:

in MS-Windows, applications are windows

umm, well most applications have main windows, but applications don't need them of course, and there's nothing to stop a windows application from having many different windows with no apparent parent window, a process can create and own as many windows as it wants -- it's just a usability thing, why would you create a user interface like that? It makes no sense to me.

It's much nicer to have everything in a single container window -- take for instance using adobe photoshop, or macromedia fireworks, and vs 2005 at the same time -- one window to do all of your coding, and another to do your imaging -- they both can have 10 or 20 sub windows, and you could drag them around to fit them both on your desktop and open at once (especially if you have two monitors) and all the child windows move, and they keep their correct relative positions, both main menus are open at the same time;

Why on earth would you trade that for just one main menu being displayed at a time, and having to manually drag all of the child windows around one at a time so that all of your adobe crap was on one side and all of your ide crap on the other?

that's just headache inducing.

CGamesPlay
Member #2,559
July 2002
avatar

Quote:

Why on earth would you trade that for just one main menu being displayed at a time, and having to manually drag all of the child windows around one at a time so that all of your adobe crap was on one side and all of your ide crap on the other?

Photoshop's "utility" windows disappear when Photoshop loses focus.

--
Tomasu: Every time you read this: hugging!

Ryan Patterson - <http://cgamesplay.com/>

Michael Jensen
Member #2,870
October 2002
avatar

why should they have to? why should the ui of a program change because it loses focus?

CGamesPlay
Member #2,559
July 2002
avatar

Quote:

why should they have to? why should the ui of a program change because it loses focus?

Well, the logic is that you won't need those windows if you aren't working with Photoshop. But the better answer to your question is "why shouldn't the ui of a program change because it loses focus?"

--
Tomasu: Every time you read this: hugging!

Ryan Patterson - <http://cgamesplay.com/>

Hard Rock
Member #1,547
September 2001
avatar

Quote:

Uhm, there's no SQL Server 2007, so is WPF replacing that too?

I'm sorry thats a stupid argument. WPF is Microsoft's new UI frameworks. Why would a UI framework replace a Database product? Had Microsoft released a completely different relational database engine product then i suppose you could try to use that as point, here it doesn't make sense. Sorry for the harsh words, but really even if what I'm saying is still wrong, what you said makes absolutely no sense.

Quote:

I should clarify something. Please correct me if I'm wrong, but WPF seems to have been marketed, at least in my experience, as a sort of Flash-esque replacement

Here this link should be helpful, Its a general introduction to wpf and explains its purposes as well as some sample code.

http://msdn2.microsoft.com/en-us/library/aa663364.aspx
Quote from the article:

Quote:

By providing a unified platform for modern user interfaces, helping make designers active participants in creating those interfaces, and allowing a common programming model for standalone and browser applications, WPF aims at significantly improving the Windows user experience. Some of the technologies it supplants had a twenty-year run as the foundation for Windows user interfaces. The intent of WPF is to lay the foundation for the next twenty years.

The exciting thing i guess about the new setup, is in XAML you can have an artist create your programs UI, and then you simply write code on top of it. No longer do you need an artist to do a mock up for an application and have the programmer attempt to program an identical interface, rather the artist creates the interface and the programmer just creates it's functionality.

There is a large part of web stuff as well, which is i guess where your getting the flash stuff? and tons of additional features and additional shit, and yes you can do all that stuff as well

I guess the biggest reason WPF is not mainstream, is its brand new, its not really finished yet and there has yet to be a killer app to showcase it's potential. But time will tell what will happen. Perhaps it will just be used as an added supplement to existing MFC and .NET forms apps (which will be likely for the immediate future anyway, as developers will want to experiment with it without relying on yet unproven tech) or it will take over completely.

[edit]

Quote:

He says System.Windows.Forms is worth investing in still, even before the crushing of ideas due to time constraints kicked in.

I do agree that for smaller projects that windows forms is an ideal replacement for now, and will still be for some time. However for large applications and commercial products, Windows forms does not make sense when there is such a drastic change on the horizon. Of course non of us have the commercial problem, so uh, carry on.

_________________________________________________
Hard Rock
[ Stars Dev Company ][ Twitter ][Global Warming: ARA My TINS 07 Entry][Pong Ultra Website][GifAllegS Ver 1.07]
"Well there's also coolwebsearch but we'll let that be an IE exclusive feature" - arielb on the New Browser Plugins "What's better, HTML or Variables?"

Thomas Fjellstrom
Member #476
June 2000
avatar

Quote:

in XAML you can have an artist create your programs UI

You mean how in Qt4 and now KDE4, the apps are starting to use SVG for their interfaces? And Apple uses PDF? It was exciting ;)

I can't wait to see MS's version of KDE4s Plasma features. The most apparent features (applets and eyecandy) are already done in OSX, Vista and KDE for a while now, but I'm looking forward to what it'll let you do... hmmm plasma...

--
Thomas Fjellstrom - [website] - [email] - [Allegro Wiki] - [Allegro TODO]
"If you can't think of a better solution, don't try to make a better solution." -- weapon_S
"The less evidence we have for what we believe is certain, the more violently we defend beliefs against those who don't agree" -- https://twitter.com/neiltyson/status/592870205409353730

CGamesPlay
Member #2,559
July 2002
avatar

Quote:

I'm sorry thats a stupid argument.

Okay, you're right. I was misdirected about what WPF is.

As far as being used professionally, I'm sure The next version of Visual Studio will have support for it. I wouldn't dream of making a UI without the dialog editor from that app :) Maybe that's why I don't code Qt apps :)

--
Tomasu: Every time you read this: hugging!

Ryan Patterson - <http://cgamesplay.com/>

Hard Rock
Member #1,547
September 2001
avatar

Actually if you want to test it... (It's code named orcas).

http://www.microsoft.com/downloads/details.aspx?familyid=1FF0B35D-0C4A-40B4-915A-5331E11C39E6&displaylang=en

Not sure if its in the beta yet. Wikipedia claims there should be one. I think you can also download the standalone designer trial as well somewhere.

The visual designer can also be purchased stand alone.

_________________________________________________
Hard Rock
[ Stars Dev Company ][ Twitter ][Global Warming: ARA My TINS 07 Entry][Pong Ultra Website][GifAllegS Ver 1.07]
"Well there's also coolwebsearch but we'll let that be an IE exclusive feature" - arielb on the New Browser Plugins "What's better, HTML or Variables?"

Thomas Fjellstrom
Member #476
June 2000
avatar

Quote:

I wouldn't dream of making a UI without the dialog editor from that app

I like the Qt designer just fine ;)

--
Thomas Fjellstrom - [website] - [email] - [Allegro Wiki] - [Allegro TODO]
"If you can't think of a better solution, don't try to make a better solution." -- weapon_S
"The less evidence we have for what we believe is certain, the more violently we defend beliefs against those who don't agree" -- https://twitter.com/neiltyson/status/592870205409353730

CGamesPlay
Member #2,559
July 2002
avatar

Assuming WPF completely changes the way the Windows windowing system works, then it looks like it will be very good for inter-system operability.

--
Tomasu: Every time you read this: hugging!

Ryan Patterson - <http://cgamesplay.com/>

Goalie Ca
Member #2,579
July 2002
avatar

Windows API not only includes graphics but everything else as well. In .NET though they did the sane thing and put a lot of those outside of System.windows.forms. But that still leaves the c/c++ api's with much to be desired.

And gtk/gnome has been using cairo now for quite some time.

-------------
Bah weep granah weep nini bong!

Thomas Harte
Member #33
April 2000
avatar

Quote:

it's just a usability thing, why would you create a user interface like that? It makes no sense to me.

To make one point before delving more thoroughly into your post, an advantage of the OS X way of doing things is that it ends Window's arbitrary distinction between things that go on the taskbar and "normal" programs. Take iTunes as an example. I have it on my dock, so when I click it it launches and the main window appears. If I shut the main window then it remains loaded and potentially playing music despite at that point having no windows whatsoever. If I left click it in the dock again then the main window recreates itself. If I right click it in the dock I get some context specific information, specifically the currently playing song/artist, forward/back/pause/play controls and the option to rate the current song.

Compare and contrast with something like MSN Messenger, which doesn't really seem to know what it wants to be doing. It acts like a normal application until you try and close it, when it suddenly becomes a taskbar application.

Quote:

It's much nicer to have everything in a single container window

Most people disagree, and Microsoft are amongst them. It's the same example I always raise, but look at the development of Microsoft Word over the years.

In Office 95 and earlier, you get one Word window and all the documents you open are child windows of it. In Office 97 you can have that behaviour or you can have each document open in a separate window. At least as of Office 2000, that's the default behaviour. So you can either have (a) lots of documents in one window, which means that alt+tab doesn't work and you can't select individual documents from anything like the start bar, or (b) lots of windows, in which case each document has its own duplicate of the various document layout/etc controls and you end up paying heavily in screen real estate.

Quote:

take for instance using adobe photoshop

Photoshop on Mac puts each palette in its own window. It's really a matter of taste.

Quote:

Why on earth would you trade [a single parent window] for just one main menu being displayed at a time, and having to manually drag all of the child windows around one at a time so that all of your adobe crap was on one side and all of your ide crap on the other?

OS X is generally more flexible with window management than Windows. Besides Exposeé, there is also the capacity to "hide" applications — every application has a "Hide <application name>" and a "Hide others" entry on the menu bar. If you click the first one then all windows for that app are removed from the desktop. Not minimised, but completely invisible. They come back when you click the app in the dock. "Hide others" does exactly what you think.

Don't misunderstand me: I really don't think there is a clear cut case for either way being objectively better. It isn't really valid to just write off either way.

CGamesPlay
Member #2,559
July 2002
avatar

Quote:

At least as of Office 2000, that's the default behaviour.

I think if you examine closely, at least with Excel, that while each document has a taskbar entry, they share one MDI window.

--
Tomasu: Every time you read this: hugging!

Ryan Patterson - <http://cgamesplay.com/>

Thomas Harte
Member #33
April 2000
avatar

Quote:

I think if you examine closely, at least with Excel, that while each document has a taskbar entry, they share one MDI window.

I don't know about Excel, I really only know about Word — though I admit that I didn't make that 100% clear.

Anyway, on the topic of user interfaces generally I have to say that I've really liked my experiences of the ribbon in Office 2007 so far.

Michael Jensen
Member #2,870
October 2002
avatar

Quote:

If I shut the main window then it remains loaded and potentially playing music despite at that point having no windows whatsoever. If I left click it in the dock again then the main window recreates itself. If I right click it in the dock I get some context specific information, specifically the currently playing song/artist, forward/back/pause/play controls and the option to rate the current song.

you can get that behavior in windows via the winapi, there's nothing that forces your program closed because a window got closed or didn't get closed, it's just what people who use that OS are familiar with and has become a common coding pattern, and you can also check to see, when the application launches, is it already open? if so then just send it a message to display the window again, and close this instance.

Really, what it sounds like this pattern (the one you describe) prevents you from, is having multiple instances of the same application open, which seems silly.

Quote:

Compare and contrast with something like MSN Messenger, which doesn't really seem to know what it wants to be doing. It acts like a normal application until you try and close it, when it suddenly becomes a taskbar application.

MSN messenger is a POS (not: point-of-sale) though, so you'd expect it to behave as such, I'm sure there's badly written software for the apple that exists too (not that I would know of any, but if I did, I wouldn't judge the whole apple-ui by them).

Quote:

Most people disagree,

I'm not most people -- infact, I don't think anybody is. ;) -- ha, I'm done hijacking this thread for now. ;D

edit: I don't know enough about XAML, but what about animations, moving controls, and other things that would have to be done programatically, how can this be accomplished with a static xml document that defines the interface? or does the XAML just happen declaritively, and still give you .net forms objects to work with on the backside?

Thomas Harte
Member #33
April 2000
avatar

Quote:

you can get that behavior in windows via the winapi, there's nothing that forces your program closed because a window got closed or didn't get closed

Obviously let's not lose sight of what we're talking about. I was just explaining why some of the OS X conventions that might appear odd on first meeting are actually beneficial to the way the OS works and that several of the OS X conventions are reasonably different to the Windows conventions. That's the complete depth of the conversation.

That all said, I thought entries on the task bar/start bar/whatever it's called were only given to programs with windows?

BAF
Member #2,981
December 2002
avatar

Quote:

Compare and contrast with something like MSN Messenger, which doesn't really seem to know what it wants to be doing. It acts like a normal application until you try and close it, when it suddenly becomes a taskbar application.

What? Most chat applications act the same way, and I like it. You close your contacts list and it goes to the tray. Nothing to not be known here...

HoHo
Member #4,534
April 2004
avatar

A rather nice alternative to loads of subwindows of same type is tabs. In KDE, almost every application that could benefit from them has them (Konqueror, Kate, KDevelop, Konsole, Kopete, ...) and you can use shortcut keys to traverse between them.

__________
In theory, there is no difference between theory and practice. But, in practice, there is - Jan L.A. van de Snepscheut
MMORPG's...Many Men Online Role Playing Girls - Radagar
"Is Java REALLY slower? Does STL really bloat your exes? Find out with your friendly host, HoHo, and his benchmarking machine!" - Jakub Wasilewski

Arthur Kalliokoski
Second in Command
February 2005
avatar

I'd say that the windows api has been purposely designed to be incompatible with everything else, to make it hard to port programs to/from anything else. Why else is there a WinMain() instead of just main()?

They all watch too much MSNBC... they get ideas.

axilmar
Member #1,204
April 2001

Quote:

It is a shock how nasty it is.

...welcome to the terrordome!

For the last 8 years, one of the evolving applications I am into is an MFC/Win32 application! sheer horror! The bad thing with this project was that it was my first Windows project so I selected MFC as the platform...I was not aware back then that our customer would require so many evolutions.

For the 2nd app I was called to make for Windows, I dumped MFC and coded my own C++ API over Win32, complete with signals and slots. The API wrapped Windows controls. It started very small, with the necessary widgets only, and it has grown to a full blown API covering most of Windows controls...it's head and shoulders above MFC.

The fun part was when our customer asked me why I decided not to use MFC...we then had a very long conversation about how MFC is a complete disaster, and the customer walked away extremely surprised about that!

Goalie Ca
Member #2,579
July 2002
avatar

Got a question Axilmar.. how did you get around the whole issue of using a member function as a CALLBACK. I tried the usual std::mem_fun (borked!) and boost::mem_fn (worked but then couldn't get it cast as DWORD_PTR as needed)... I decided to give up and make it a singleton class.... (edit: with a static method)

I've seen so called solutions.. many of them involve hacking the assembly to add this as the first parameter. apparently its called thunking and apparently mfc does it.

edit2: SO much nasty reinterpret casting in winapi.. it's really absurd. casting things as a DWORD is something really strange and not exactly portable to 64-bit afaik. HWND has been cast to just about everything.

-------------
Bah weep granah weep nini bong!

 1   2 


Go to: