TE
科技回声
首页24小时热榜最新最佳问答展示工作
GitHubTwitter
首页

科技回声

基于 Next.js 构建的科技新闻平台,提供全球科技新闻和讨论内容。

GitHubTwitter

首页

首页最新最佳问答展示工作

资源链接

HackerNews API原版 HackerNewsNext.js

© 2025 科技回声. 版权所有。

Ask HN: Why is building Windows apps so complicated?

382 点作者 vixalien超过 3 年前
So I decide to build a windows 11 app. I already know some .NET and C&#x2F;family from school and look through the source of C# and it doesn&#x27;t seem too complicated.<p>However, building Windows apps is very complicated even when you know C++ or C#.<p>1. I wanted to build Windows 11 apps and I had to choose between Windows Forms, WinUI3, Win32 and WPF I think. I don&#x27;t really know the difference between the 3 and no one really explains that (unless Win32 which is obvious).<p>2. Apparently, WUP is no longer recommended. A few years they were pushing it to the max. Bummer.<p>3. I installed Visual Studio overnight (it comes with all the tools that building apps need). It downloaded 6GB of data and used 20GB of storage. All i want to build is a hello world app.<p>4. I create a project following a guide from Microsoft.<p>5. The app is extremely resource heavy and way too over-featured. I build the boilerplate app and Run it and it takes minutes to build (most of the time is downloading dependencies so not such a big deal).<p>6. I open the newly created app in Sublime Text (my editor) and I can&#x27;t find a way to build the app anymore.<p>7. Because Visual Studio is so bloated, I download Visual Studio Code, which is far more simple but I can still not figure out how to build my app even with the various extensions VS code boasts.<p>8. After hours of googling, I formulate a script that can build the app from the command-line.<p>9. But I stil don&#x27;t know how to build the app as the .exe file created does not execute.<p>10. I&#x27;m very disappointed.<p>The worst of all is that there is not even one good guide on the whole clearnet on how to do develop a Hello World windows app from scratch.

108 条评论

Dayshine超过 3 年前
1. Install the .NET 6 SDK: <a href="https:&#x2F;&#x2F;dotnet.microsoft.com&#x2F;en-us&#x2F;download&#x2F;dotnet&#x2F;6.0" rel="nofollow">https:&#x2F;&#x2F;dotnet.microsoft.com&#x2F;en-us&#x2F;download&#x2F;dotnet&#x2F;6.0</a><p>2. Terminal ,pick a folder, `dotnet new wpf`<p>3. `dotnet run` and you have an (admittedly empty) hello world app<p>It&#x27;s telling me it took 1.5s to build the app.<p>Want to publish the app?<p>`dotnet publish -o .&#x2F;publish -r win-x64` which takes a bit longer as it has to download some runtimes (60 seconds max, then cached). Zip up the resulting folder and ta-da you have an application. Just unzip and run the .exe.<p>If you want a single-file exe (as in completely statically compiled without self-extraction) that&#x27;s a bit more advanced and requires a few properties in the csproj to configure how to handle native assemblies that expect to exist on disk. If you want it to have no runtime dependencies, add `--self-contained`
评论 #29529712 未加载
评论 #29529950 未加载
评论 #29531066 未加载
评论 #29529779 未加载
评论 #29530083 未加载
评论 #29529686 未加载
评论 #29536573 未加载
评论 #29531679 未加载
评论 #29530343 未加载
评论 #29532465 未加载
评论 #29530052 未加载
评论 #29531430 未加载
indymike超过 3 年前
Unpopular opinion: native GUI app development on most platforms is a shitshow. Huge toolkits, copious amounts of boilerplate, and a huge amount of dev effort thrown at the platform just to get it working.<p>Meanwhile, say what you will about the web ecosystem, I&#x27;ve given interns&#x2F;jr devs tickets like: see if you can get this webapp running in electron, and maybe figure out how to do push notifications and save data locally. Two days later the project is done. A week later, the app is ready to install.<p>I think the real reason I quit doing meaningful amount of native GUI development a decade ago was velocity. The developer experience with iOS is probably about the best of the major GUI platforms, but even that is rife with tarpits of tribal knowledge and gets really complicated to release an app due to the whole App Store experience.
评论 #29530581 未加载
评论 #29530918 未加载
评论 #29530098 未加载
评论 #29530658 未加载
评论 #29530233 未加载
评论 #29532216 未加载
评论 #29530221 未加载
评论 #29532251 未加载
评论 #29530418 未加载
评论 #29532055 未加载
评论 #29530935 未加载
Someone1234超过 3 年前
There&#x27;s a lot to untangle here.<p>Point 1 is largely true, Microsoft builds too many competing UI toolkits.<p>Point 3: You can slim down Visual Studio&#x27;s install a lot if you&#x27;re more selective during installation. For example if I only wanted to do .Net desktop application development it is closer to 4 GB and under 10 GB on disk.<p>Point 4: Is actually the end of the original synopsis on the topic and after it veers off. You successfully built the application.<p>Now it goes a little off the rails:<p>Point 5: &quot;The app is extremely resource heavy and way too over-featured.&quot; Ok? You didn&#x27;t say which toolkit, guide, or similar you used nor what you define as resource heavy or in what way it was &quot;over-featured.&quot; This is too vague to discuss meaningfully (e.g. Win32 applications built in C++ definitely aren&#x27;t resource heavy or over-featured for example, and since you didn&#x27;t clarify even what tech stack was used let alone guide&#x2F;template this isn&#x27;t constructive at all).<p>Point 6: I&#x27;ve read this sentence several times but seemingly you opened an executable in a text editor and that somehow broke your build process? Or something? Was it write-locked by the editor?<p>Point 7-10: You had a working build pipeline, you broke the pipeline, then decided to start again from scratch in an editor that doesn&#x27;t have native desktop development support on Windows (because the old editor was &quot;bloated&quot;). You found this process problematic.<p>So in answer to:<p>&gt; Why is building Windows apps so complicated<p>You made it complicated by using unsupported workflows and introducing arbitrary limitations on what was a successful outcome. There&#x27;s a lot you can legitimately criticize Windows and even its desktop application development workflow for, but this isn&#x27;t that.
评论 #29530669 未加载
评论 #29529865 未加载
评论 #29530224 未加载
评论 #29533676 未加载
评论 #29531936 未加载
codeflo超过 3 年前
Even though I personally much prefer Unix environments, I&#x27;ve done a lot of work in Microsoft&#x27;s tech stacks and WPF in particular.<p>WPF is nice, but it&#x27;s not developed much anymore and lacks basic features that people have come to accept (great touch support, smooth scrolling). And the successor technologies are all a mess, driven by Microsoft&#x27;s internal politics more than by any coherent strategy. I tuned into a few streams of Microsoft&#x27;s developer conference last year, and no fewer than three different UI libraries, developed by three competing divisions, where announced as &quot;the future of app development on Windows&quot;. I can guarantee that only 0-1 of those will survive, so good luck betting on the right one.<p>The only real recommendation I can give is to do as Microsoft does, not as they say. So while they <i>tell</i> everyone to use UWP, WinUI, MAUI or whatever, all of their own new apps are written in Electron. Decide what that means for yourself.
spaetzleesser超过 3 年前
I am a long time Windows desktop developer. Since around Windows 8 MS has lost any sense of direction and just keeps cranking out new frameworks only to drop them soon after. All frameworks available are either outdated or incomplete. It’s very frustrating.<p>When you look at Teams or Outlook it seems even MS themselves doesn’t know anymore how to develop solid and reliable desktop apps.<p>My advise is to go either qt, electron or web. Preferrably web IMO because there is a clear path to the future.
评论 #29531186 未加载
评论 #29530423 未加载
评论 #29532811 未加载
评论 #29530238 未加载
qalmakka超过 3 年前
I think the main culprit for the whole situation - that is, the fact that building anything on Windows is a byzantine and convoluted process - is the fact the whole OS was designed with CLI as an afterthought. On UNIX the CLI is always forefront and center - you don&#x27;t really have &quot;GUI&quot; apps, all apps are console apps and they may connect to some sort of Window server and draw windows.<p>Meanwhile on Windows there was close to zero effort on making the system usable from a CLI before half a decade ago. There are still lots of tasks that require you to log in on a GUI, for instance. Applications started in GUI mode have no console attached, so you have zero diagnostic messages when started in a CMD. The entire command line tool situation is a complete mess, and it&#x27;s clearly meant that msbuild and friends are actually meant to be invoked by Visual Studio instead of being used from a CLI.<p>Until a few released ago there still was no non-hacky way to get a development PowerShell, because all the various `vcvars` scripts were only batch files.<p>The complexity of using XML files in project descriptions just complicates things, and ironically I&#x27;ve seen several occasions in which msbuild just tells you to change a settings using Visual Studio (instead of telling which CLI toggle you are supposed to use).<p>My two cents is that IDEs and GUI told may be convenient but they should never be the default way to do anything, especially with development tools.
评论 #29530371 未加载
评论 #29530533 未加载
tester756超过 3 年前
&gt;Because Visual Studio is so bloated<p>It&#x27;s definitely huge tool, but it allows you to do a lot of kind of developments.<p>I think it&#x27;s very decent tool if you want to do C# development, especially when you want to have reliable intellisense and strong debugging tooling<p>(expression evaluation at fly, changing code at fly, moving to different lines during debugging, conditional breakpoints)
评论 #29529883 未加载
ThinkBeat超过 3 年前
Most of this is either inaccurate or downright false.<p>The most valid point is that Microsoft keeps churning out new UI frameworks that all seem to die quickly, with some still staying alive.<p>Running compilers in the command line on Windows has always been possible and it is trivial these days.<p>That goes for both (MS) C++ or .Net.<p>Hitting F5 &quot;build&quot; is easier than using the command line. That does not mean the command line in not well supported.<p>Visual Studio will generate a script you can use to build the projects from the command line for your projects<p>Here is an example of a minimal Win32 app written in C <a href="https:&#x2F;&#x2F;docs.microsoft.com&#x2F;en-us&#x2F;windows&#x2F;win32&#x2F;learnwin32&#x2F;your-first-windows-program" rel="nofollow">https:&#x2F;&#x2F;docs.microsoft.com&#x2F;en-us&#x2F;windows&#x2F;win32&#x2F;learnwin32&#x2F;yo...</a><p>It is tiny and uses nearly no resources. The code is about the same as it was 10 years ago.<p>Using Winforms with C# it is trivial to create a minimal Windows application that is small and uses nearly no resources. (just but a button on the canvas, hit F5).<p>Any decent code editor can be easily adapted to work with the C# or C++ Microsoft compilers for builds.<p>Visual Code offers deep support for C# <a href="https:&#x2F;&#x2F;code.visualstudio.com&#x2F;docs&#x2F;languages&#x2F;csharp" rel="nofollow">https:&#x2F;&#x2F;code.visualstudio.com&#x2F;docs&#x2F;languages&#x2F;csharp</a><p>This article seems to outline how to get C# support in Sublime (I am not a Sublime user so I dont know how well this works) <a href="https:&#x2F;&#x2F;www.quora.com&#x2F;How-do-use-sublime-text-editor-for-coding-C-sharp" rel="nofollow">https:&#x2F;&#x2F;www.quora.com&#x2F;How-do-use-sublime-text-editor-for-cod...</a>
评论 #29533201 未加载
nerdywordy超过 3 年前
We have a Windows POS app for mines, quarries, sand and gravel, etc.<p>When we broke ground on this version Microsoft was hardcore pushing UWP. We were building for the future so we built our app within the constraints of UWP with the expectation that it would grow with Microsoft’s vision…<p>Fool me once, as they say. UWP is dead.<p>We are currently redeveloping the entire thing with a series of Win32 base classes and intend to layer on a WPF front end for now. WinUI is early and promising. But so was UWP.<p>Long term we’re exploring outside the box UI options like running a local server and popping a browser. C# and .NET are very powerful. But the fractured landscape for desktop development gives little hope for the future.<p>If your goal is to build a rich UI, then you may have to suffer through learning whichever flavor of XAML you decide to go for. But if your goal is to interact with local hardware functionality I’d probably steer clear and use WinForms, a browser interface, or a console interface.
评论 #29529702 未加载
评论 #29530244 未加载
评论 #29529934 未加载
评论 #29530887 未加载
yesimahuman超过 3 年前
It is quite complicated but at least it feels like it’s finally heading in the right direction. I recently did a deep dive into WinUI3 and the Windows App SDK and finally they are separating these tools from the OS and making them available to packaged and unpackaged apps. I wouldn’t bother with any of the older approaches unless you have a reason to, as this is clearly the future.<p>Speaking of which, the reason your exe doesn’t open is because you’re likely building a packaged app. You can think of that like building and iOS&#x2F;Android app where it comes with a bunch of extra metadata and hooks into the OS, but that means you can’t just launch the exe and it has to be installed using the new .msix installer format. Thankfully the Windows App SDK just added the ability to build unpackaged (I.e. classic win32 exe apps): <a href="https:&#x2F;&#x2F;docs.microsoft.com&#x2F;en-us&#x2F;windows&#x2F;apps&#x2F;windows-app-sdk&#x2F;deploy-unpackaged-apps" rel="nofollow">https:&#x2F;&#x2F;docs.microsoft.com&#x2F;en-us&#x2F;windows&#x2F;apps&#x2F;windows-app-sd...</a><p>I have built and tested both approaches and they work well, though unpackaged apps aren’t able to use certain APIs that expect “package identity” (I.e that special metadata I mentioned above)
评论 #29530508 未加载
评论 #29533240 未加载
评论 #29529896 未加载
derjames超过 3 年前
This is bit extreme and if you are ok with the c language: 1. download tcc for windows(tiny c compiler from Fabrice Bellard). 2. compile the examples in the examples folder. Here you will find the &#x27;hello world&#x27; program for both command line and win32 gui.<p>The download size of tcc is a few megabytes and the compilation times are for practical purposes instantaneous. You will have to bring your own IDE or text editor.
评论 #29533139 未加载
azalemeth超过 3 年前
Does qmake&#x2F;Qt work sensibly in Windows? I&#x27;ve never tried it, but on *nix it&#x27;s very, very easy to make a simple gui app with Qt, no real ide required. (0)<p>0: <a href="https:&#x2F;&#x2F;www.wikihow.com&#x2F;Create-Your-First-Qt-Program-on-Ubuntu-Linux" rel="nofollow">https:&#x2F;&#x2F;www.wikihow.com&#x2F;Create-Your-First-Qt-Program-on-Ubun...</a>
评论 #29529699 未加载
评论 #29530914 未加载
评论 #29529679 未加载
评论 #29530253 未加载
lucastech超过 3 年前
I agree that MS has done a terrible job at making their tools simple. I started programming using VB6 in 2002 and it was the easiest thing around. This simplicity still exists if you&#x27;re trying to do winforms, but is gone if you try to do anything else.<p>If you&#x27;re just starting out I&#x27;d recommend Win Forms + C#. WPF and all of the other gui options are insanely difficult for reasons I still haven&#x27;t understood.<p>I made a quick video to show you how to create the app and get a simple hello world together. The drag and drop interface is great. Unfortunately virtualbox didn&#x27;t record the mouse cursor (I am on OSX) so it&#x27;s not as clear to follow as I had hoped.<p><a href="https:&#x2F;&#x2F;wxp.io&#x2F;visual_studio_winforms.webm" rel="nofollow">https:&#x2F;&#x2F;wxp.io&#x2F;visual_studio_winforms.webm</a>
评论 #29533150 未加载
mdp2021超过 3 年前
As many have noted, there exist development systems that seem to want to involve wartime industrial efforts to craft even toothpicks (presumably also because they were born to develop the Unimaginable in a distributed international team of uncountables), and there are &quot;measured&quot; tools that do their job directly and effectively.<p>Many have suggested a number of effective lean tools. I suggest you also try PureBasic. You can build GUI applications in seconds (reasonably, depending on the functions to implement), even when just programmatically if you so wish. The executable will be compiled, small and fast. The language remains relatively very powerful (it does quite a lot on its own, and can hook to third party libraries when needed.<p>As a personal compact and effective swiss army knife, it&#x27;s unvaluable. You seem to be oriented towards &quot;manageable&quot; development systems. There could be systems that are more instrumental to your curriculum vitae, but. Some of today&#x27;s development systems are very high level, and I still believe that having a good grasp of the low-level, of the actual internal workings, is duly - the intermediate output of PureBasic is Assembly, and this should give the idea of the &quot;faithfulness to low-level&quot;.
nobodyandproud超过 3 年前
There’s no guide because nobody wants to learn Windows Desktop programming anymore.<p>The Web has taken over everything, even use cases where it shouldn’t, because it’s a career dead-end.<p>The IDE is complicated because it’s an evolution of 30 years.<p>As for the UI: - Win32: This is the C library for creating and manipulating Windows. This library is foundational.<p>- WinForms: .NET abstraction around Win32. Event-driven design. Every UI component is effectively a Window.<p>Very rich and complete; hard to write unit tests for; easy to peel away the abstraction.<p>Never going away.<p>- WPF: Reimagined UI library. Addresses the many limitations of WinForms. Inspired by HTML; steeper learning curve; designed to separate display from display logic, making unit testing a very possible.<p>Every year, someone asks if WPF is dead.
theodpHN超过 3 年前
A big part of the problem, I think, is that tools that make it easy have been deemed uncool and as a result are half-heartedly supported by Microsoft, such as Visual Basic and MS-Access. Lack of vendor support has killed or hampered other easy-to-use development software that might otherwise find widespread use, including BASIC (classic and VBA; Microsoft, Apple), HyperCard (Apple), and AppInventor (Google). My two cents. :-)<p>Microsoft Plots the End of Visual Basic <a href="https:&#x2F;&#x2F;www.thurrott.com&#x2F;dev&#x2F;232268&#x2F;microsoft-plots-the-end-of-visual-basic" rel="nofollow">https:&#x2F;&#x2F;www.thurrott.com&#x2F;dev&#x2F;232268&#x2F;microsoft-plots-the-end-...</a><p>Microsoft Access: The Database Software That Won’t Die <a href="https:&#x2F;&#x2F;medium.com&#x2F;young-coder&#x2F;microsoft-access-the-zombie-database-software-that-wont-die-5b09e389c166" rel="nofollow">https:&#x2F;&#x2F;medium.com&#x2F;young-coder&#x2F;microsoft-access-the-zombie-d...</a>
评论 #29533614 未加载
superasn超过 3 年前
Does Borland Delphi 6&#x2F;7 exe files run on Windows 11?<p>I seldom use Windows nowadays but I did try running the Delphi Ide a while back and it created a 100kb exe file and it was running just fine on Windows 10 with almost everything working including the embedded internet explorer and firefox.<p>Not sure if this helps your case but it can certainly be done if Delphi can still create exe files that run just fine.
评论 #29529772 未加载
评论 #29531088 未加载
评论 #29529986 未加载
rkagerer超过 3 年前
Never thought I&#x27;d say this but the Windows developer experience from Microsoft peaked with VB6. Later tools got more powerful but never quite reached the same sweet spot of productivity and intuitiveness.<p>Working on a small C# WinForms app right now, and saddened that Edit-and-Continue still doesn&#x27;t really work, build times are 10x what they should be, and even hit bugs in the native control wrappers.<p>Microsoft used to have very smart people who understood their tech stack from the ground up. I&#x27;m sure they still do, but their business decisions make it seem like instead of stripping the paint and re-priming they simply keep painting over the old mess with yet-another-layer.<p>(Not saying they need to break backward compatibility, but do wish they&#x27;d update old paradigms rather than abandoning them to rot).
评论 #29531526 未加载
kitsunesoba超过 3 年前
I’ve been building a C# WinUI 3 app as a hobby project, since the app in question only makes sense as a Windows app (making cross platform capabilities pointless) and because I don’t care a shred for the convolutions of front end web dev that come along with an Electron project of any significant complexity.<p>Getting started was annoying — certainly more so than developing a native Mac app with Xcode, which presents something closer to a “happy path” that gets you writing code with little to no boilerplate — but I finally got the ball rolling and have been fairly productive. There are some oddities though, like the collection type relied upon by list views not supporting sorting, requiring one to either wastefully allocate a new list, sort that, and assign that to the collection or implement sorting in a class extension. Very very strange stuff when you’re used to the base collection types in the language you’re working with supporting both observation and sorting.<p>I’ve read that picking up the latest Windows UI framework is foolhardy, but I really didn’t care to theme WPF so it’s a closer match to current windows design and isn’t glaringly bright when using dark mode. And as noted, this is a hobby project, so whatever. If a rewrite becomes necessary it’s not the end of the world.
评论 #29530272 未加载
josalhor超过 3 年前
I find it very amusing that the current answers suggest:<p>- WPF with NET 6<p>- Electron<p>- WinUI<p>- Flutter<p>- That GUI programming is complicated
评论 #29529768 未加载
pjmlp超过 3 年前
You are basically holding it wrong.<p>Visual Studio + Forms&#x2F;WPF, done.<p>If you are more in the C++ camp, go with either Forms&#x2F;WPF + C++&#x2F;CLI, or MFC (yes really MFC).<p>Everything else on MS stack are just distractions, and VSCode is not for Windows development.
jhallenworld超过 3 年前
I found this to be useful, make a Win32 GUI in the old-school 90s way using MingW so you don&#x27;t even have to use any Microsoft tools. It has the advantage that nothing has to be installed on the target PC except your application.<p><a href="https:&#x2F;&#x2F;www.transmissionzero.co.uk&#x2F;computing&#x2F;win32-apps-with-mingw&#x2F;" rel="nofollow">https:&#x2F;&#x2F;www.transmissionzero.co.uk&#x2F;computing&#x2F;win32-apps-with...</a><p>I used it to make an application that downloads files over a serial port from an OptiCon bar-code scanner:<p><a href="https:&#x2F;&#x2F;github.com&#x2F;jhallen&#x2F;cartscan" rel="nofollow">https:&#x2F;&#x2F;github.com&#x2F;jhallen&#x2F;cartscan</a><p>Coming from UNIX, the biggest annoyance was Microsoft&#x27;s use of wide character strings.
atraac超过 3 年前
Everyone here sugesting electron or wpf but really… Just look up Avalonia and be done with it. Not everything has to be browser based or made by Microsoft.<p><a href="https:&#x2F;&#x2F;avaloniaui.net&#x2F;" rel="nofollow">https:&#x2F;&#x2F;avaloniaui.net&#x2F;</a>
评论 #29529670 未加载
wheybags超过 3 年前
This is part of the reason why electron is so popular these days.
评论 #29529564 未加载
mswisdom超过 3 年前
The problem is that all of these components are named by people on the marketing team. And beyond asinine naming, marketing also seems set on obfuscating the technological relationship between different components.
评论 #29529723 未加载
willjp超过 3 年前
Almost certain I’m doing it wrong (hobbyist), but most versions of vs studio have some kind of cli interface for installing workloads. I’ll fight with that until I figure out which includes the cli compiler tools. Write a script to automate install. Afterwards I’ll use a build system that calls vcvarsall.bat and perform the build from the cli.<p>I agree, it feels clunky and bloated compared to what I’m used to (especially if multiple vs studio versions required) but it gets the job done.<p>I’m very curious what workflows look like for people that know what they’re doing when building c&#x2F;cpp on windows.
评论 #29529705 未加载
lostmsu超过 3 年前
The author is nuts, and so are many commenters here echoing their viewpoint.<p>The steps are<p>1. Download and install Visual Studio (author says C# - that&#x27;s one checkbox to set in the installer)<p>2. Launch it and click make new -&gt; desktop application<p>3. Hit F5<p>The rest is a self inflicted wound.<p>20GB for arguably the best IDE of the last decade may be a problem for a high schooler in a very poor country, but everyone else here, all supporters of this post included, should have no issue with it (unless also self-inflicted).<p>1 min build is basically a lie for launching a hello world app with F5. I doubt it will take more than 5 seconds on any machine.
评论 #29533276 未加载
评论 #29531512 未加载
michihuber超过 3 年前
Also, distribution: Windows Defender requires code signing with an extended validation certificate, or going through the Windows Store. Otherwise users see a scary warning after installation how your app is probably a virus.<p>But using an EV cert means you cannot build on a CD service (it comes on a dongl). And users hate the Windows Store.<p>What am I missing as a mac person? I hear that most apps aren’t on the Windows Store. Is it normal to just have a virus warning and people ignore it anyway? Or can you just not distribute through a CD service?
评论 #29529959 未加载
评论 #29531012 未加载
madsbuch超过 3 年前
I recently had to develop a small application for the MS ecosystem (An Office add-in) and as I use Pop OS as my daily driver, I had to switch to my Windows partition. While this was considerably simpler than what you describe, it was a very bad experience developing on Windows for the MS ecosystem. Bad and bloated documentation and boiler plate code of very low quality. It seems like MS responds to the competition with quantity instead of actually building some quality packages and frameworks.
评论 #29529976 未加载
评论 #29530567 未加载
lixtra超过 3 年前
If you just want „hello world“, try tcl&#x2F;tk. It’s the same as 20 years ago and a very simple language.<p>I build some simple GUIs for myself (ok, for Linux) and it was a perfect choice for that. Very stable language, relatively small, easy.<p>Python tkinter still went through the python2 to python3 storm and the unicode plague. So i hesitate to recommend that.<p><a href="https:&#x2F;&#x2F;www.tcl.tk&#x2F;software&#x2F;tcltk&#x2F;" rel="nofollow">https:&#x2F;&#x2F;www.tcl.tk&#x2F;software&#x2F;tcltk&#x2F;</a>
评论 #29530495 未加载
b20000超过 3 年前
all of what you describe happens when you try to build a modern web app using any of the hip languages or frameworks too.<p>what kind of app do you want to build? that is the first question to ask. then, you choose the right framework for it and the right project type in VS. with windows software, just like with mac osx, you need to read the docs first and think about what frameworks to use and what application type. preparation will help a lot down the line.
keewee7超过 3 年前
Listen to the .Net community and pick WPF.<p>Don&#x27;t listen to whatever the Microsoft marketing department is hyping.
quaintdev超过 3 年前
I would not recommend this for serious use but Flutter on desktop is taking a good shape. If you have tried Flutter for Android then developing for desktop is pretty easy. Although they are still ironing out some core functionalities it&#x27;s something you can try and use for application development for both Linux&#x2F;Windows.
评论 #29529693 未加载
评论 #29529685 未加载
chucktingle超过 3 年前
&gt;so complicated<p>Compared to what? GUI programming has always been hard on all platforms I tried.
评论 #29529607 未加载
评论 #29529599 未加载
评论 #29529698 未加载
评论 #29529587 未加载
评论 #29530429 未加载
mikewarot超过 3 年前
&gt;Why so complicated?<p>It&#x27;s because Borland isn&#x27;t around any more to keep them honest, and focused.<p>Note: This is about building a program for Windows, not something to be sold in their &quot;App Store&quot;, which is a whole different nightmare. The difference is important!<p>If you use Lazarus, building an app (I just did one) took less than 2 minutes from reading your question, to having an EXE (under 3 megabytes) that shows a form with a button, and when you click the button, says &quot;Hello, World&quot;<p>Command line programs in free pascal turn out even smaller. The exe files for this years advent of code for me are about 300-700k.<p>Lazarus also runs on my Raspberry Pi Zero W (the old one), which only has 512mb of RAM and a 16GB sd Card.
mrlonglong超过 3 年前
Bugger all that codswallop. Just build a Windows form app using .NET C# or Visual Basic in Visual Studio. I have done it many times.
sandreas超过 3 年前
Here is a very good tutorial series for WPF: <a href="https:&#x2F;&#x2F;www.youtube.com&#x2F;watch?v=fZxZswmC_BY&amp;list=PLA8ZIAm2I03hS41Fy4vFpRw8AdYNBXmNm" rel="nofollow">https:&#x2F;&#x2F;www.youtube.com&#x2F;watch?v=fZxZswmC_BY&amp;list=PLA8ZIAm2I0...</a><p>Source is: <a href="https:&#x2F;&#x2F;github.com&#x2F;SingletonSean&#x2F;reservoom" rel="nofollow">https:&#x2F;&#x2F;github.com&#x2F;SingletonSean&#x2F;reservoom</a><p>It walks you through the whole process of creating an MVVM app including publishing. I saw and read many tutorials but this one was just AWESOME.
dundarious超过 3 年前
Handmade Hero is pretty much the perfect project for this. The first few videos go over basic C&#x2F;C++, but I think in one video you build a Hello World GUI app without using Visual Studio to set up anything, you just call the compiler in a script (initially, Casey used VS as a debugger, which you can do by just asking it to &quot;open&quot; the .exe, but nowadays he uses RemedyBG which is pretty much as useful, and is lightning fast -- costs like 20 bucks).<p>Look at <a href="https:&#x2F;&#x2F;handmadehero.org&#x2F;" rel="nofollow">https:&#x2F;&#x2F;handmadehero.org&#x2F;</a> and Previous Episodes, Day 001 and 002. He&#x27;s creating a game, not a GUI with textboxes and buttons, but much of it is applicable, and there is very purposely no impenetrable &quot;magic&quot; operating behind the scenes.<p>As for &quot;why is it so complicated?&quot;, well... none of the popular 3 OSes or ecosystems are really covering themselves in honor there. I think MS is unique in just how fond of &quot;magic&quot; they are, and there is a lot of boom and bust in their tech stacks, which seems to be mostly driven by their internal structure rather than any kind of rationale. Linux is fond of competition between mutually incomplete alternatives, and constant change even within alternatives. macOS is arguably the most sensible and stable, but it has been about 10 years since I wrote an OS X or iPhone app (weren&#x27;t called macOS or even iOS back then).
Gravyness超过 3 年前
I also hate complexity and I&#x27;m not a C&#x2F;C++ professional creating apps for billions of people so when I need a tool or a program I just use microsoft build tools from visual studio 2019 in a batch script to compile&#x2F;run from a single source file:<p><pre><code> @echo off call &quot;C:\Program Files (x86)\Microsoft Visual Studio\2019\Community\VC\Auxiliary\Build\vcvars64.bat&quot; :loop cl &#x2F;nologo &#x2F;Ob0 &#x2F;O2 .&#x2F;main.c &#x2F;Fe&quot;main.exe&quot; &amp;&amp; &quot;.&#x2F;main.exe&quot; echo. pause goto loop </code></pre> This calls the environment-setting script and uses cl.exe from that env, then compiles and if successfull executes the program on the terminal.<p>Visual Studio current state is disgusting. vscode is an attempt to fix that but it is very slowly going the same route.<p>Edit: I try to depend heavily on win32, because they invested a ton of time creating the documentation, and stopped changing things every month (which is literally the ONLY thing software seems to be UNABLE to do, ffs), and win32 functions work most of the time with simple setup, and usually return a code if it succeeded or not, instead of sending some obscure event to god-knows-where that has to be handled with signals, or messaging or dark rituals! And there&#x27;s an example for pretty much every function call, what more does a mortal need?<p>Everything that came after win32 is a hit-or-miss, undocumented, no examples, or just chaotic interfaces.
einpoklum超过 3 年前
About the humungous Visual Studio download - that&#x27;s annoyed me as well. I recently asked:<p>&quot;How do I obtain Microsoft&#x27;s C++ compiler and standard library (and just that)?&quot;<p><a href="https:&#x2F;&#x2F;stackoverflow.com&#x2F;q&#x2F;69274364&#x2F;1593077" rel="nofollow">https:&#x2F;&#x2F;stackoverflow.com&#x2F;q&#x2F;69274364&#x2F;1593077</a><p>and the answer was either &quot;You can&#x27;t&quot; or &quot;It&#x27;s complicated&quot;. I gave up and used the MSVS installer. And you _still_ need to invoke a complex script to get your environment in order.
评论 #29530472 未加载
revskill超过 3 年前
These days, for enterprise application, ElectronJS is enough for most of use cases. You don&#x27;t need a PHD in Computer Science to do that. Just learn basics of JS, HTML, CSS is enough.
评论 #29529732 未加载
badsectoracula超过 3 年前
As some others mentioned, use Lazarus[0], it&#x27;d be the easiest way and you get a single exe file with no external dependencies.<p>It has been a long time since i made this video, but here is one[1] where i make a 2D tilemap editor in Lazarus from scratch - it starts with installing Lazarus (note that the video is old and some things have changed but 99% of it would be the same anyway).<p>Lazarus is crossplatform so here is another one where i make a small puzzle game under Linux&#x2F;XFCE. Also starts with installing (which is a tiny bit more complicated because i need to build it from source - still a minute or so and strictly speaking you can get it running from your repository but chances are it will be broken and you avoid several potential issues if you build it from source on Linux).<p>I might make a new video at some point though as i&#x27;m back on Linux as my main OS nowadays and Window Maker as my window manager, it&#x27;d be the farthest from how things would look on Windows :-P. Though i might capture it in a VM if possible (the two videos i linked at were from a VM).<p>[0] <a href="https:&#x2F;&#x2F;www.lazarus-ide.org&#x2F;" rel="nofollow">https:&#x2F;&#x2F;www.lazarus-ide.org&#x2F;</a><p>[1] <a href="https:&#x2F;&#x2F;www.youtube.com&#x2F;watch?v=_3JgeIUo1X0" rel="nofollow">https:&#x2F;&#x2F;www.youtube.com&#x2F;watch?v=_3JgeIUo1X0</a><p>[2] <a href="https:&#x2F;&#x2F;www.youtube.com&#x2F;watch?v=s_01Xhd2EJM" rel="nofollow">https:&#x2F;&#x2F;www.youtube.com&#x2F;watch?v=s_01Xhd2EJM</a>
avsteele超过 3 年前
Really disagree with the OP.<p>Google &quot;Windows desktop development&quot; -&gt; <a href="https:&#x2F;&#x2F;docs.microsoft.com&#x2F;en-us&#x2F;windows&#x2F;apps&#x2F;desktop&#x2F;" rel="nofollow">https:&#x2F;&#x2F;docs.microsoft.com&#x2F;en-us&#x2F;windows&#x2F;apps&#x2F;desktop&#x2F;</a><p>Click the first chapter -&gt; &quot;Overview of app development options&quot;. It explains the options and their differences at a high level. Admittedly if you choose WinUI3 I haven&#x27;t much experience, but if you chose WPF...<p>Google &quot;Microsoft WPF&quot; and click the 1st result:<p><a href="https:&#x2F;&#x2F;docs.microsoft.com&#x2F;en-us&#x2F;dotnet&#x2F;desktop&#x2F;wpf&#x2F;?view=netdesktop-6.0" rel="nofollow">https:&#x2F;&#x2F;docs.microsoft.com&#x2F;en-us&#x2F;dotnet&#x2F;desktop&#x2F;wpf&#x2F;?view=ne...</a><p>Click the link &quot;Create a WPF application&quot;. You get a lovely guide that was updated within the last month or so.<p><a href="https:&#x2F;&#x2F;docs.microsoft.com&#x2F;en-us&#x2F;dotnet&#x2F;desktop&#x2F;wpf&#x2F;get-started&#x2F;create-app-visual-studio?view=netdesktop-6.0" rel="nofollow">https:&#x2F;&#x2F;docs.microsoft.com&#x2F;en-us&#x2F;dotnet&#x2F;desktop&#x2F;wpf&#x2F;get-star...</a><p>You can&#x27;t really complain if you are a newbie, don&#x27;t follow the tutorial, and find things confusing.<p>Dayshine&#x27;s post (<a href="https:&#x2F;&#x2F;news.ycombinator.com&#x2F;item?id=29529535)shows" rel="nofollow">https:&#x2F;&#x2F;news.ycombinator.com&#x2F;item?id=29529535)shows</a> the easiest way to do things from the command line.
评论 #29533335 未加载
blablabla123超过 3 年前
This matches my experience. Ages ago I was successful with the Borland tools to produce anything non-trivial. Eventually I worked a few months on a project with C# which included an installer. Somehow this seems very standardized but I was surprised to see that you had to register every single file in an xml file. On the upside, this would result in a really clean uninstall. So maybe part of this is also to prevent brittle software like in the past.
jmnicolas超过 3 年前
Assuming you&#x27;re on Windows, as a beginner you should do everything with Visual Studio (not Code), it&#x27;s the easiest way.<p>Create a new WinUI project (choose an UWP one), once you&#x27;re on the hello world page, just look at the green arrow at the top of Visual Studio, press it and voilà it will run your app.<p>But to develop a visual app for Windows you will need to learn a few things before you can be at ease. There&#x27;s one WinUI book for sure, and there should be courses too.<p>Keep it on!
steeleduncan超过 3 年前
1. If you wish to work with C++, then WinUI 3 is the latest and greatest, and the way to go.<p>2. WinUI 3 is the controls in UWP repackaged under a new name, but without the restrictions of UWP. The only substantial difference is a change of the root namespace from Windows to Microsoft<p>3 &amp; 5. This is a sad reality of modern IDEs, it is a one off cost though, once downloaded and built for the first time it is smoother. Also, you can opt in on a component by component basis, so if you don&#x27;t want them, don&#x27;t download them.<p>6-10. If it works with Visual Studio, stick with that, don&#x27;t waste your time and effort unnecessarily trying to run a complex build process in an esoteric way. If you want to use Sublime Text, then edit in that, and alt-tab back to Visual Studio to run it.<p>I don&#x27;t think you have made life easy for yourself, but there is an overwhelming choice of frameworks when starting. Rather than evolve a single framework, they seem to create a new one every 3&#x2F;4 years and deprecate the predecessor. That limits the work you need to do keeping up with backwards incompatible changes in the longterm, but it makes for an miserable start to Windows app development.
评论 #29531195 未加载
axby超过 3 年前
I found that using CMake with C++ was a pretty okay process on windows, despite not having much experience with windows. I have to run cmake and then msbuild and I don&#x27;t really know the details, but I got a simple GUI application running with wxWidgets on windows, and I don&#x27;t need to use the Microsoft IDE. I&#x27;m happy to share more details if anyone is interested.<p>It was a nightmare to figure out how to do it, though.
throwawayboise超过 3 年前
It&#x27;s been years since I fooled around with .NET but the book I used (<i>Microsoft .Net for Programmers</i> by Grimes) started out with writing C# code in Notepad (or other editor of choice) and compiling with csc.exe on the command line. It would be sad if that sort of very simple use case is no longer supported, as it&#x27;s always been the best way for me to learn <i>and understand</i> what is happening.
Meph504超过 3 年前
&gt; I wanted to build Windows 11 apps and I had to choose between Windows Forms, WinUI3, Win32 and WPF I think. I don&#x27;t really know the difference between the 3 and no one really explains that (unless Win32 which is obvious).<p>This is microsoft still makes it pretty simple to create apps that use 30 year libs and frameworks,<p>WinUI3 Honestly, this is a trash fire that microsoft tried to make developers work in a walled garden, restrict their ability to distribute to other platforms, and make it very difficult to distribute to anything but their app store. They have been handed their hat for several years now, and they have chipped away at their restrictions, such as allowing sideloading by default, and allowing win32 games to be deployed on the app store. These apps only support win10 an later, and require directx11. To me, this is a failed experiement, and that has damaged the windows development ecosystem a lot.<p>WPF is a vector based more modern UI that works well with modern MVVM techniques. But microsoft never gave it the attention it should, and it never reached the level of design and drag and drop UI development winForm did.<p>Winform, is the most mature, but honestly dead for realistic production applications, it doesn&#x27;t support UI scaling. But it&#x27;s much faster to develop in, has much more components available, and doesn&#x27;t fight you nearly as much if you want to do Pinvoke stuff an the like.<p>At this point, you&#x27;d do best to just write your services in C# and do you UI in a web framework, or make use of <a href="https:&#x2F;&#x2F;dotnet.microsoft.com&#x2F;en-us&#x2F;apps&#x2F;aspnet&#x2F;web-apps&#x2F;blazor" rel="nofollow">https:&#x2F;&#x2F;dotnet.microsoft.com&#x2F;en-us&#x2F;apps&#x2F;aspnet&#x2F;web-apps&#x2F;blaz...</a>
simonh超过 3 年前
It&#x27;s not any better on the Mac. I started trying out Playgrounds on an iPad and wondered why none of the suggestions and blogs on the web worked, only to find out there&#x27;s a MAcOS version of Playgrounds and thy don&#x27;t work quite the same. Then I find out there&#x27;s a Playgrounds feature in Xcode and actually a lot of the guides and Stack Overflow answers are actually for that, although most such resources don&#x27;t say which one they&#x27;re for.<p>I finally settle on using the XCode one as most resources seems to be fort that, but after a whole afternoon failing to get a Playground to load a single package from Github I just flat out gave up. Pretty much nothing I could find about any of this ever actually worked.<p>My heart goes out to anyone trying out coding with playgrounds for the first time on an iPad and trying to find out anything useful, not realising almost all of the info they find is for the wrong Playgrounds. Compared to the built-in guides and helpful info for Pythonista and Codea it&#x27;s an embarrassment.
评论 #29530802 未加载
评论 #29530972 未加载
explaingarlic超过 3 年前
I understand the disappointment, but this is a case of a bad template as opposed to building Windows apps being natively complicated. UWP is amazing - I haven&#x27;t had the chance or bother to use it for anything particular, but if I was going to do anything for Windows that required a UI I&#x27;d definitely use UWP.<p>If anyone remembers the VS2012+ (I might have the time period wrong there) WIN32 default UI application, it&#x27;s gigantic and the first few things you see are horrible practise. Global variable that has the root window&#x27;s title, weird `InitInstance` function, use of the ATOM type (not actually used but present in the first few lines - <i>why???</i> You didn&#x27;t <i>need</i> to return anything from RegisterClassExW...).<p>Microsoft, or at least whoever they choose to make the example work for any SDK&#x2F;API that they put out, is completely incompetent when it comes to understanding where someone who doesn&#x27;t know what&#x27;s going on is coming from.
crispyambulance超过 3 年前
UI is complicated and always has been. You have to be patient with it and give yourself time to absorb it.<p>Based on how you described things, you&#x27;re just starting out with Windows UI and Visual Studio. That&#x27;s OK, there&#x27;s nothing wrong with that. Welcome.<p>The landscape is confusing for multiple reasons. Partly because now multiple platforms are now targetable. Partly because Microsoft bends over backward to support legacy codebases (yes, there are people still maintaining winforms apps). Partly because UI is just hard.<p>What you&#x27;ll want to do is to find a stable but relatively modern UI library. You&#x27;ll want something XAML-based, so that means WPF or WinUI. WPF is &quot;done&quot;, terminally stable and there&#x27;s a lot of resources (tools, tutorials, books) available for it and it works on Win 11. If you learn it, transitioning to the more modern WinUI is not a big deal.<p>Recommend you limit yourself to WPF or WinUI and Visual Studio. It should not take &quot;a minute&quot; to build an example application on a normal machine.<p>The initial confusion with xaml-based UI wears-off quickly. You will be able to make simple one-off UI&#x27;s with ease. The hard part is building non-trivial applications with it because you will quickly find that you need to use libraries for MVVM and Dependency-Injection. I use the Prism library, it&#x27;s a hot mess, but it&#x27;s my preferred way of making UI apps.<p>The next major hurdle, for me at least, was customizing the UI controls. You can compose your own from the &quot;built-in&quot; controls and style them so they look pretty good (that&#x27;s called a &quot;User Control&quot;). Anything more elaborate means buying UI controls from a vendor like Infragistics. You theoretically <i>can</i> create your own controls and package them in libraries, that&#x27;s called &quot;Custom Controls&quot; and it&#x27;s nightmarish in complexity if your end-goal is just creating applications.
thefz超过 3 年前
1. I wanted to build Windows 11 apps and I had to choose between Windows Forms, WinUI3, Win32 and WPF I think. I don&#x27;t really know the difference between the 3 and no one really explains that (unless Win32 which is obvious).<p>WinForms is &quot;legacy&quot;, WPF is the way to go.<p>3. I installed Visual Studio overnight (it comes with all the tools that building apps need). It downloaded 6GB of data and used 20GB of storage. All i want to build is a hello world app.<p>Bad choice not cherrypicking what you need and installing a whole lot of packages you don&#x27;t.<p>5. The app is extremely resource heavy and way too over-featured. I build the boilerplate app and Run it and it takes minutes to build (most of the time is downloading dependencies so not such a big deal).<p>Nah, a basic &quot;hello world&quot; WinForms program is minuscule. A WPF one might have a bit more dependencies, say a MVVM framework, but for a one-window program that&#x27;s it.<p>6. I open the newly created app in Sublime Text (my editor) and I can&#x27;t find a way to build the app anymore.<p>Not clear what you were trying to do here.<p>7. Because Visual Studio is so bloated, I download Visual Studio Code, which is far more simple but I can still not figure out how to build my app even with the various extensions VS code boasts.<p>It&#x27;s bloated because of your choices. VS Code still compiles and runs .exe with attached .pdbs.<p>8. After hours of googling, I formulate a script that can build the app from the command-line.<p>You don&#x27;t need to google for hours and formulate any script. I can run a basic program from VS Coe just fine.<p>9. But I stil don&#x27;t know how to build the app as the .exe file created does not execute.<p>It&#x27;s 100% on you.<p>10. I&#x27;m very disappointed.<p>It&#x27;s 100% on you.
评论 #29530259 未加载
评论 #29530493 未加载
评论 #29530144 未加载
评论 #29530803 未加载
评论 #29530596 未加载
semireg超过 3 年前
Another option is to use an Electron boilerplate and then start learning a web framework of your choice. Electron development is incredibly rich. The UI is web tech, but that’s just the tip of the iceberg. There’s RPC back to a node process. You can call into native code on any platform. There are tons of NPM modules for both the browser and Node. There are bindings for whatever languages you want to use, and if you find yourself SOL (outta luck) you can even package “one file” python projects into a command line callable (via electron’s child exec) to work magic. It’s almost a limitless environment to build - I’m absolutely addicted because the puzzle solving is immensely gratifying.<p>For example, my electron app is used to design and print labels, and it integrates with excel and CSV. Mac users of Apple’s Numbers app have been SOL because the only way to export CSV data is using the UI (either manually or pseudo manually with AppleScript). When I wrote the app 3 years ago nothing existed to read .numbers files, let alone convert to CSV. Every holiday I get a flurry of emails from sad Numbers users because manually exporting is high friction. This morning I woke at 4am and thought I’d look again and huzzah! Someone published a Python project this year to read .numbers files. Awesome.<p>It took me about an hour to write a python script that accepted two arguments: the .numbers file and a destination .csv file. Then I spent 4 hours trying to package it up because damn if apple’s code signing isn’t a nightmare. But I digress.<p>I built a beta and now my poor users (wife included) can finally hit save in Numbers and boom, their labels immediately update with data. Very happy!<p>I know electron isn’t for everybody. I was (and still am) a mobile app dev writing native swift&#x2F;kotlin. But I’m absolutely in love with JS&#x2F;TS, warts and all!<p>My app is <a href="https:&#x2F;&#x2F;label.live" rel="nofollow">https:&#x2F;&#x2F;label.live</a> and I’m always looking for interesting cross-platform app ideas, partners, etc.
miki123211超过 3 年前
Whatever you say about Microsoft and the amount of overlapping technologies they have, their documentation is best in class.<p>There&#x27;s a barely supported, legacy API from Windows 2000 that is still used by some legacy screen readers to actually access whatever is on the screen. It&#x27;s meticulously documented and the documentation seems maintained and up to date.<p>Apple is the exact opposite, the API that screen readers use to communicate with web browsers isn&#x27;t even mentioned anywhere. If you ever need to learn about it, the usual answer is &quot;go Read the Safari source code and figure things out from there.&quot; It&#x27;s gotten so bad that the documentation for Dotnet bindings of some Swift methods has apparently gotten better than the documentation of those methods themselves.
评论 #29533225 未加载
dimgl超过 3 年前
You&#x27;re not wrong. This is one of the reasons I&#x27;ve stayed far away from building Windows apps.<p>Right now I&#x27;m really into Golang, and I&#x27;m wondering if it&#x27;s possible to build a Windows UI app using Go. I&#x27;ve always wanted to try QT, so maybe QT is an option?
stjohnswarts超过 3 年前
I&#x27;ll tell you one thing, building software that isn&#x27;t trivial isn&#x27;t easy. You are expecting it to be a turnkey solution on your first try. Honestly there are some turnkey solutions out there but you have to do your research and quit being so negative. You might as well accept that 95% of most modern software is &quot;heavy&quot; unless you are writing a C based command line app. About the lightest software (but hard to write) on Windows will be Win32 if you&#x27;re looking to write Windows apps that are light on memory. Personally I think C# is probably the best all around place to get started on Windows for GUI coding. Python is probably the easiest for command line stuff.
smishra12345超过 3 年前
Use PureBasic and build small, fast native GUI programs with no dependencies quickly. There is no dependency - it uses Win32 UI.<p>As an added bonus, you can compile your programs to run on Mac, x64 Linux, x86 Linux as well as Raspberry Pi.<p>The program is stable, and has a good community.
SZJX超过 3 年前
Interesting how nobody seems to have mentioned React Native here. Its Windows support is still rough round the edges in some situations (e.g. third-party library comparability) but the experience I’ve had so far using it to build a cross-platform app has been great. I’d imagine if you need to do more system-specific things e.g. the Windows task tray icon, you may still need to reach into the skeleton project and write some OS-specific code in C++, but the majority of the app I’m just writing in React, and there’s even a tailwind port for RN that worked out of the box. I also heard that Flutter upped their support for desktop a lot as well.
评论 #29669192 未加载
FpUser超过 3 年前
With Delphi (it has free hobby edition) and &#x2F; or Lazarus one can build simple hello world literally in seconds. Same with QT (I do not use it as I am not fond of their licensing shenanigans). The rest of the discussion looks like people are trying to find the best way to hurt themselves.<p>One can easily build windows GUI &quot;hello world&quot; using notepad and mingw but anything more serious would throw one in a world of hurt. Win32 was designed to be wrapped into something more manageable, not used directly for large GUI apps.
ab_testing超过 3 年前
I think that this might not be the comment that you are looking for but have you tried Visual Basic.net. C# has grown into a multi platform , multi runtime language that can be used to build apps on all version of Windows from 7 to 11, Linux and Mac OS. But if you still want to make apps that only run on Windows machines and uses still supported Windows Forms- then VB.Net might be just what you are looking for. It still ships with Visual Studio and let’s you build multi windows, database centric applications.
JaggerJo超过 3 年前
Use WinUI. The end.
评论 #29529941 未加载
tyingq超过 3 年前
&gt;Why is building Windows apps so complicated<p>I suspect mostly because of their strong respect for backwards compatibility and interop between new stuff and old stuff.<p>Means there&#x27;s always 10 ways to do the same thing.
rsp1984超过 3 年前
Do yourself a favour and install Qt (it&#x27;s free if you choose the LGPL version) and start building apps with QML &#x2F; Qt Quick, which is Qt&#x27;s language for UIs. As a Bonus: your app can also work on Android and iOS.<p>If you&#x27;re more of the web developer type, just use Electron (your Hello world app will probably need several 100s of MBs of memory just to show a window but hey, that&#x27;s what you get).
ipiz0618超过 3 年前
I feel you on the documentation point. WPF is great, but the documentations are scary. Microsoft&#x27;s documentations are rich, but don&#x27;t help in most cases. I&#x27;d been a professional WPF developer for a few years, but still couldn&#x27;t get a lot of things.<p>Nowadays if I want to build a simple Windows compatible app for side projects, I use cross platform frameworks like Flutter.
aristofun超过 3 年前
Deepest reason — there is no incentive to make it simple, nobody is going to pay for that.<p>Even the opposite is true — the more complicated technology is — the more services around it you can sell.<p>K8s is another example of this pattern (i usually get a lot of dislikes for this statement, which ironically proves the point, because people usually react more to uncomfortable truth).
fortran77超过 3 年前
Complicated? It&#x27;s the easiest thing in the world -- when compared to building an iOS, MacOS, or Linux GUI app.<p>You should use &quot;Visual Studio&quot;<p><a href="https:&#x2F;&#x2F;www.codeguru.com&#x2F;csharp&#x2F;hello-world-c-sharp-windows-11&#x2F;" rel="nofollow">https:&#x2F;&#x2F;www.codeguru.com&#x2F;csharp&#x2F;hello-world-c-sharp-windows-...</a>
scruple超过 3 年前
I don&#x27;t have much to add. I went through a similar process about a year ago. It was painful and annoying and despite the fact that it was not what I wanted to do I ended up with an Electron app.<p>I&#x27;d also add that they&#x27;re (Microsoft) also pushing .NET MAUI and Blazor for GUIs. They&#x27;re very confused over there, IMO.
daviddever23box超过 3 年前
I see your .NET drama and up the ante by mentioning UWP &#x2F; WinRT app development. You’re welcome!<p>My younger self would have asserted that Windows is a poison which gets re-absorbed into one’s skin by contact; my older self wonders how long the circus tent will stand aloft. There’s no P in PTSD until you’re outside the ecosystem.
intrasight超过 3 年前
<a href="https:&#x2F;&#x2F;github.com&#x2F;migueldeicaza&#x2F;gui.cs" rel="nofollow">https:&#x2F;&#x2F;github.com&#x2F;migueldeicaza&#x2F;gui.cs</a><p>&quot;A toolkit for building console GUI apps for .NET, .NET Core, and Mono that works on Windows, the Mac, and Linux&#x2F;Unix.&quot;<p>I&#x27;m going to try using this for a new console app
cjfd超过 3 年前
It has always been this way on this platform. Also not helping is that the documentation is of, let us say, varying levels of quality. I don&#x27;t build GUIs that often, but have build them in the past, and, honestly, I am not entirely sure what I would use if I were to build one....
eganist超过 3 年前
<a href="https:&#x2F;&#x2F;docs.microsoft.com&#x2F;en-us&#x2F;visualstudio&#x2F;get-started&#x2F;csharp&#x2F;tutorial-wpf" rel="nofollow">https:&#x2F;&#x2F;docs.microsoft.com&#x2F;en-us&#x2F;visualstudio&#x2F;get-started&#x2F;cs...</a><p>I take it you&#x27;re leaning largely on this?
sys_64738超过 3 年前
Is Win32 MFC still a thing? I remember wrestling with that 20+ years ago. It felt bloated back then but would probably be considered the equivalent of embedded programming nowadays. It was all C++ but not traditional C++ that you know. If felt like J++.
评论 #29529868 未加载
评论 #29530062 未加载
secondcoming超过 3 年前
Firefox is rejecting all the docs.microsoft.com links in this thread:<p>&gt; An error occurred during a connection to docs.microsoft.com. The OCSP response does not include a status for the certificate being verified.<p>&gt; Error code: MOZILLA_PKIX_ERROR_OCSP_RESPONSE_FOR_CERT_MISSING
wedesoft超过 3 年前
I can recommend Qt <a href="https:&#x2F;&#x2F;www.qt.io&#x2F;" rel="nofollow">https:&#x2F;&#x2F;www.qt.io&#x2F;</a> . Not only is it a well designed C++ library, but it is also cross-platform. For creating Windows installers, I use NSIS.
tzs超过 3 年前
The way I used to deal with Windows programming was to buy the Charles Petzold “Programming &lt;X&gt;“ book where &lt;X&gt; was the version of Windows I wanted to program for.<p>Petzold stopped writing these and so I stopped writing Windows programs.
spapas82超过 3 年前
I&#x27;ve had a lot of success using Lazarus <a href="https:&#x2F;&#x2F;www.lazarus-ide.org&#x2F;" rel="nofollow">https:&#x2F;&#x2F;www.lazarus-ide.org&#x2F;</a> for some internal apps. Try it. It&#x27;s like VB6 but in Pascal!
la_fayette超过 3 年前
Windows 11 has great support for PWAs. This could be an option for certain types of apps, with the advantage, that it runs also on other platforms. MS Teams and VS Code are also web apps, so I guess the technology is ready?!
psyklic超过 3 年前
If I recall correctly, the steps would be:<p>1. Open Visual Studio.<p>2. Create a new Windows Forms app.<p>3. Drag a label onto the form.<p>4. Change its Text property to &quot;Hello, World!&quot;.<p>5. Press Run.<p>From my experience, professional-looking Windows apps are easier for a solo dev to make than websites (HTML+CSS+JS+backend).
评论 #29534935 未加载
dt3ft超过 3 年前
&gt; The worst of all is that there is not even one good guide on the whole clearnet on how to do develop a Hello World windows app from scratch.<p>If you bothered to use a search engine (google, bing), you’d find thousands of such guides.
dmitrygr超过 3 年前
Been doing this for ~ 1.5 decades with no issues:<p>1. build DLL in visual C that does whatever your business logic is.<p>2. build ui in visual basic by dragging around some controls and hooking them up to a few lines of code<p>3. tell VB to import your DLL<p>4. hook it up with a few more lines
lelanthran超过 3 年前
Maybe you should switch to Lazarus. I&#x27;ve had quite a good experience building fast and small GUI applications in Lazarus.<p>Best of all, your program will be multiplatform (just recompile on supported platforms).
fmxexpress超过 3 年前
It isn&#x27;t difficult. Just use Delphi. 26+ years of unbroken excellence building using Win32. And now Microsoft is saying that going forward they are back to promoting Win32 as the best way.
chakkepolja超过 3 年前
&gt; 1. I wanted to build Windows 11 apps and I had to choose between Windows Forms, WinUI3, Win32 and WPF I think.<p>Aside, is there a term for this type of product bloat? &quot;industrial ADHD&quot;?
Tempest1981超过 3 年前
&gt; choose between Windows Forms, WinUI3, Win32 and WPF<p>The focus now is on Electron web apps... it&#x27;s harder and harder to find&#x2F;write native apps. I guess you just confirmed this.
markus_zhang超过 3 年前
I had some exp building personal projects using QT. It&#x27;s definitely a complicated GUI framework but it&#x27;s not difficult to meddle amd create simple gui apps.
评论 #29530287 未加载
account-5超过 3 年前
When I&#x27;m writing simple things for Windows I just use Autohotkey. No hassles, portable, compiles to exe. Not for everyone but for me it makes windows usable.
pembrook超过 3 年前
Hence why all apps will be electron in &lt;5 years.<p>While more resource heavy, with the transition to better ARM-based processors already underway this will become a mute point.
choiway超过 3 年前
#1 is the #1 complaint. In 2021, I still don&#x27;t know what Windows framework I should invest my time in if I want to develop a native Windows app.
usrbinbash超过 3 年前
Have you tried Fyne?<p><a href="https:&#x2F;&#x2F;github.com&#x2F;fyne-io&#x2F;fyne" rel="nofollow">https:&#x2F;&#x2F;github.com&#x2F;fyne-io&#x2F;fyne</a>
评论 #29529900 未加载
flohofwoe超过 3 年前
Yes, it sucks, but it&#x27;s not much different from any other platform.<p>This is essentially why Electron has won, despite its obvious downsides.
markus_zhang超过 3 年前
BTW has anyone tried wxwidgets? I know older UnrealED (e.g. the one for Unreal Tournament 1) was written with it.
cool-RR超过 3 年前
&quot;Why is building Windows apps so complicated?&quot; Compared to what? Web development?
评论 #29531756 未加载
snambi超过 3 年前
Why would anyone want to build an windows app when there are so many better alternatives?
physicsguy超过 3 年前
Lol, I actually think for building and distribution, it’s <i>much</i> easier to do so on Windows than it is on Linux, because of redistributables. On Linux you have to build on &lt;insert ancient distro&gt; and then build and bundle all other dependencies in order to guarantee it’ll actually work somewhere else.
评论 #29533156 未加载
amelius超过 3 年前
Android development also sucks.
Shadonototra超过 3 年前
and i&#x27;m here working on a SwiftUI app and i am so happy<p>everything is smooth and efficient, code compiles to native machine code, there is no JIT or other weird shit that slow me down<p>windows is being run by incompetent junior students<p>leave that sinking ship
shadowAuror超过 3 年前
To be fair, I can create the exact rant on programming in Linux...
mmargerum超过 3 年前
Use Delphi or Lazarus. Superlative windows development tool.
malka超过 3 年前
Aaaand that&#x27;s why people use electron.
pigbearpig超过 3 年前
What is the point, just to complain?<p>Is this harder than Linux&#x2F;Unix&#x2F;Mac OS?<p>I don’t know what toolkit to use Qt, GTK2 GTK3? Ugh, I’m going to give up and complain on HN.
评论 #29531060 未加载
trinovantes超过 3 年前
Oh boy, wait till you discover how hard is it to sign&#x2F;distribute an app on Windows without triggering thousands of anti-virus programs
midjji超过 3 年前
Just use QT instead,
plq超过 3 年前
A common mistake I see is to let the tools&#x2F;frameworks make the decisions. The engineer should make the decisions. If the tools don&#x27;t let the engineer do what he wants, he must change the tools.<p>Not sure how much experience you have with native development but, as a person who has production code running on windows, macos and linux, frankly I don&#x27;t see much difference. Getting together almost all of the moving parts that make a modern OS tick behind simple API calls is no simple feat. Native development is complex because ... well it&#x27;s a complex problem. Microsoft platforms have always been clunky so if you add that as well, it might seem unsurmountable if you don&#x27;t know what you&#x27;re looking for.<p>Linux is the most developer-friendly OS out there. What&#x27;s nice, its GUI toolkits have the advantage of being cross-platform so if you learn how to use them, you can easily port your code to other platforms. For windows development I&#x27;d go with Qt or Gtk instead of full-on native nowadays. Qt takes you %95 of the way (Gtk a bit less) and for what&#x27;s left you can drop to native code which wouldn&#x27;t be too difficult.<p>However, for the sake of argument, let&#x27;s try using the native apis.<p>Here&#x27;s the checklist: Get a compiler, get an editor, write some code, generate build files, build, run, iterate.<p>1. Get a compiler. For windows, MSVC is the obvious choice. My MSVC provisioning script is 40 lines of powershell plus some json file I exported after doing the first manual install.<p>2. Get an editor. Notepad++ will let your feet get wet but for advanced stuff like completion and refactoring, get a real IDE like Qt Creator, Visual Studio or CLion. But for now, notepad++ it is.<p>3. Ok, time to write some code. I DuckDuck &quot;windows gui hello world&quot; and clicking around the first result lands me here: <a href="https:&#x2F;&#x2F;docs.microsoft.com&#x2F;en-us&#x2F;windows&#x2F;win32&#x2F;learnwin32&#x2F;your-first-windows-program" rel="nofollow">https:&#x2F;&#x2F;docs.microsoft.com&#x2F;en-us&#x2F;windows&#x2F;win32&#x2F;learnwin32&#x2F;yo...</a> so we have our hello world sample. Get the code from there and save it as main.cpp<p>4. Now let&#x27;s compile the code. Running cl.exe by hand is doable but won&#x27;t take you very far. We need a build configuration system. It looks like CMake and ninja is now bundled with Visual Studio so let&#x27;s use them. I DuckDuck &quot;cmake windows hello world&quot; but don&#x27;t get much and you turn to Google and you get these three lines:<p><pre><code> cmake_minimum_required(VERSION 2.4) project(hello_world) add_executable(app WIN32 main.cpp) </code></pre> Good! now, launch a developer shell and do this:<p><pre><code> cd \path\to\my\code mkdir build cd build cmake .. </code></pre> And when I type make ... wait what is this? What is a .sln file?? Visual Studio Solution?? Sorry cmake, that&#x27;s not what I want, give me a proper Makefile. Or build.ninja.<p>Let&#x27;s try again:<p><pre><code> cd .. rm -r build mkdir build cd build cmake .. -G Ninja ninja .\app.exe </code></pre> Ah! That&#x27;s more like it. And you take it from there.<p>Never let your tools dictate your actions. You&#x27;re the engineer. The tools should do your bidding. As for the framework, just use Qt. If not, I think the latest fad is WinUI but Win32&#x2F;MFC is here forever.<p>I actually put all this here along with my MSVC Provisioning script: <a href="https:&#x2F;&#x2F;github.com&#x2F;plq&#x2F;hello-win32" rel="nofollow">https:&#x2F;&#x2F;github.com&#x2F;plq&#x2F;hello-win32</a><p>Hope it helps!
clavicat超过 3 年前
I’ve noticed that no one has attempted to answer OP’s question: “why is it so hard?”<p>If you were creating an OS and you wanted to ensure its success, one obvious thing to do would be to make it as frictionless as possible to develop native software. Ideally, it would be as easy as importing the system library and typing one or two lines to create a new windowed instance. It could be made so easy that amateurs with no understanding of programming could write their own little programs like many do with Excel.<p>Instead, Microsoft seems to go out of its way to make GUI development as nightmarishly complicated and intimidating as possible. It has expressed zero interest in streamlining the existing clusterfuck and instead piles on more layers and paradigms and libraries that are then poorly maintained and abandoned for other fads. Microsoft itself does not seem to have a canonical way of developing programs. Visual Studio is a monstrous behemoth that becomes more obese with every release—the last time I tried to install it, it temporarily bricked my laptop because of some memory corruption bug.<p>Everything Microsoft touches suffers the same pathologies—nothing they do is ever excellent. Their products just manage to chug along in spite of all their defects. No sane person would ever think to design things this way, but this is how they turn out. Even the tiniest and most obvious improvements, like the recent updates to Notepad, literally takes decades to implement. The bar is set lower and lower in terms of performance because improvements in hardware almost make up for the shittiness in software.<p>Microsoft suffers from a complete absence of vision and responsibility. Ultimately, no one there owns any project—there is no one to blame when it turns out shitty, and there is no visionary leadership to coordinate their efforts and pick a direction. It is just aimless bureaucratic chaos.
评论 #29539488 未加载
评论 #29531886 未加载
评论 #29530151 未加载
评论 #29531176 未加载
distantsounds超过 3 年前
Visual Basic.<p><a href="https:&#x2F;&#x2F;docs.microsoft.com&#x2F;en-us&#x2F;visualstudio&#x2F;ide&#x2F;create-a-visual-basic-winform-in-visual-studio?view=vs-2022" rel="nofollow">https:&#x2F;&#x2F;docs.microsoft.com&#x2F;en-us&#x2F;visualstudio&#x2F;ide&#x2F;create-a-v...</a>
RapperWhoMadeIt超过 3 年前
There&#x27;s a really simple solution. Don&#x27;t develop for Windows. Literally, most UNIX systems were created with the intention of having the developer experience in the foreground! Just pick one and be happy :)
323超过 3 年前
Building Windows apps is easy, but you need to use the right tools instead of the legacy Microsoft ones:<p><a href="https:&#x2F;&#x2F;www.electronjs.org&#x2F;docs&#x2F;latest&#x2F;tutorial&#x2F;quick-start" rel="nofollow">https:&#x2F;&#x2F;www.electronjs.org&#x2F;docs&#x2F;latest&#x2F;tutorial&#x2F;quick-start</a>