Using AI for Programming: MS Windows
Persuading Grok to write a usable Windows Template program
Audience: Programmers, Windows developers, development managers, “vibe-coders”, AI enthusiasts
Contents
Executive Summary
Introduction
· The Overlogix Robot
· Role of Artificial Intelligence
Prompt
Code
Results
Conclusions
Footnotes
· LinkedIn
· Substack
Executive Summary
This article details an experiment using Grok, an AI developed by xAI, to create a minimal Microsoft Windows program template in C/C++ with standard menus (File, Edit, Menu3, Menu4, Help) and a functional About dialog. The goal was to test Grok’s capability to produce a compilable prototype for Overlogix’s custom robot automation project, emphasizing modular, maintainable code over pre-built applications.
The template, comprising files main.c, about.c, menu.h, menu.rc, and a Makefile, was successfully compiled using MinGW (gcc/windres) after three rounds of debugging prompted by compiler errors. The process validated Grok’s competence for small, well-defined coding tasks, taking a morning to complete, though it required human oversight for accuracy.
The resulting program is a robust foundation for future expansion, demonstrating AI’s utility in prototyping but not in replacing human-driven system design. A detailed code explanation and customization steps will follow in future articles.
Introduction
Of course we have heard of vibe coding, where a relatively inexperienced person uses an AI to write software, usually far beyond his/her capability to code manually, debug, or maintain. We have been coding in C and C++ for decades; so we know what good quality code should look like. The experiment below was partially to see how far we could go with Grok for a very simple coding task. In a practical sense, we are close to the limit on what the AI can be trusted to do in a single session, and that is fine with us.
Here, we do a bit of vibe-coding, but with a definite long term purpose in mind. Our goal is to construct a collection of well-formed and well-written examples of various programming pieces, which can be later combined, by a human being who knows coding well and can catch errors soon enough to keep the project on track.
The Overlogix Robot
We are building our own robot, a lengthy project which we have written about many times in the past. The basic notion is to automate ourselves, knowledgeably, and assign repetitive or boring tasks to the robot, after coding it for those purposes and thoroughly testing it.
This project has multiple purposes beyond automation; it will also show how we built it, out in the open, through the articles we write in the process of building it. Customers desiring serious automation can see exactly how we go about it, and decide for themselves whether they want this particular style of automation.
Unlike the very large number of pre-built applications already on the market, our robot is a from-scratch, custom automation tool. We are currently working on a large automation project for a customer who uses a number of pre-built applications for CRM (customer relationship management), market data gathering, financial analysis and several other functions. These disparate applications were not originally designed to seamlessly integrate with each other, demanding rather painful stitching together with an automation integration tool.
Our programming paradigm is different. We build up code in modules that are specifically designed to work with each other, controlled by a master program, designed from scratch. The advantage of such a coding method should be clear: since we created it, we know what went into it, how to test it, how to modify it, how to maintain it. Our trade-off is relatively high up-front efforts to build the system in exchange for complete and thorough knowledge of exactly how the system works. No customer support external to our company will be required.
Role of Artificial Intelligence
Interestingly, since we know AI rather well and use quite a few of them as assistants and research concierges, we’re not particularly keen on integrating AI into our automation system. The simple reason is lack of clear business purpose. We have yet to run across a business scenario that unambiguously demands AI.
AI: CEO crack cocaine
Unlike so many uninformed C-suiters, salivating over the concept of replacing fallible human beings, perhaps having other (possibly non-company-aligned) interests, families, vacations, potential illnesses, expectations of decent paychecks, legal rights, and so on, with computer slaves that can be worked 24/7/365 for years, we actually know exactly what we are doing. We also are certain that AI is currently no match for people, and isn’t likely to be any time soon.
We have long experience with DevOps, building and maintaining programs and computers, and wrangling enterprise systems. We also have plenty of experience with applied AI. Computer slaves need energy, maintenance, updating, monitoring, instrumentation, debugging, and a host of other, often unanticipated care needs that management tends to forget.
No comparison with people
In fact, for most purposes, we found in a recent study that people are almost always cheaper and better than machines, and cannot be replaced with current technology. We long ago saw through the AI hype, by the simple process of using AI for business purposes. We found even the best AIs to be woefully inadequate for anything but relatively mild augmentation of human effort. AIs can usefully accomplish very small, well-defined tasks, but little more.
Our only probable AI use cases
We may use artificial intelligence in the robot as a backup server, for cases where the quality of the decision either doesn’t matter (like a coin-toss at a sports event), or can be programmed in advance. The latter case really doesn’t need AI; ordinary automation can make simple routine decisions, and has for decades.
Think about all the banks in the world, which are basically large automations, with people, as icing on the cake, to take care of customers in a human way. Using AI for decision making is much like throwing dice; given the often poor quality of management decisions, there are cases where a relatively random chance machine, like modern AIs, might well be an improvement compared with human decision making.
Vibe-coding with Grok
This article is a demonstration of one case where we use an AI, in this case Grok, to write very simple software: a C/C++ template for a Windows program, which can be step-wise expanded into the master control program for our robot. The requirements were very simple: write a template for a Windows program that does almost nothing except show us an About box.
We finally got it to compile and run, but only after three rounds of debugging. Grok’s initial offering was broken, something we saw right away when we examined the code. It took patience to get the program to actually work. Compared with previous journeys into AI coding, this one went comparatively well. ChatGPT in the past has screwed up a program 25 times in a row, and never produced a working prototype.
Our automation has so far, and will continue to go through several stages of development. The big picture is ours, exclusively. None of the current AIs are even close to conceiving of such a thing, much less do top-down design of an enterprise system. We break off tiny little chunks of the problem, encourage one of our AI zoo to vibe-code it, including test cases, get that working as a prototype, and then take over. Nothing more can be expected from current AIs, at any price point.
NB: vibe-coding is for prototypes, only. Vibe-coded programs should never be released into the wild, EULA disclaimers or not. See the recent scandal over the Tea application, which was vibe-coded and actually released, with a wide-open, unsecured database.
The court system will catch up, since lawyers are greedy, and large-scale data breaches are red meat for litigators.
Prompt
Overlogix: I need a Microsoft Windows program template, that will compile, even if it does nothing at first. Include all standard menus (File, Edit, Menu3, Menu4, ..., Help), and a working About dialog. Include complete compilation instructions for compilation with native Microsoft tools, and alternatives for compiling with GCC. More than one file is OK if necessary.
Code
We’ll only include the debugged code here. There were five files generated: main.c, about.c, menu.h, menu.rc and Makefile. These were rendered as images since Substack’s code mode looked bad. We can supply the code in text files by request.
main.c:
about.c:
menu.h:
menu.rc:
Makefile:
Results
Once the compilation bugs were fixed, the program complied and ran:
Nothing fancy, but the program runs.
Conclusions
With a single prompt, we were able to get Grok to produce the program files needed to create a running program. We chose to use gcc and windres to compile the program, since the Makefile tells us exactly how it was built (no hidden steps) and we have a preference for open-source tools.
Debugging the program so it would compile properly took three more prompts, inputting the compiler errors and then making the suggested changes. These were not included in the article to conserve space. However, once those three debugging steps were completed, we were able to compile the program, and run it immediately without errors.
The simplicity of the program made testing very easy, since there were only a few things the program could do in the first place. It passed all tests, and is fully functional. Now we have a quality template Windows program that can be expanded upon as we add new requirements and the programming that goes along with it.
The entire process took up a morning, and writing this article most of a day. We are satisfied that Grok can write and debug C / C++ code competently, provided it is fed small enough pieces of the project at a time. We’ll explain the code in detail in a future article, to be published soon, and begin customizing it for our purposes in a step-wise manner later in yet more articles.
Back to Contents · Back to Top
Footnotes
Thank you for reading this article!
More information about Overlogix can be found at Welcome to Overlogix!
We currently publish on both LinkedIn (general interest articles, summaries, TL;DR’s: easier and faster to read) and Substack (in-depth articles, how-to’s, technical studies and new approaches to business).
LinkedIn:
· Why hire me? The elevator pitch
· Introduction: Welcome to Overlogix!
· The Overlogix Sunday Times Our newsletter, with occasional specials, published roughly every two weeks.
· Master Index All our articles can be found from here in two clicks.
· The Overlogix Table of Context All Overlogix articles in reverse chronological order
· Applied Artificial Intelligence: Index of Articles One of our specialties is Applied AI. This index lists all relevant articles on the topic, in reverse chronological order.
· Applied AI: Stories in the News Our semi-permanent, curated listing of interesting and important news from the world of artificial intelligence, from many different sources.
· Index: Getting a Job Up until recently, getting a job, much less a good job, has been a nightmare for most job seekers. We publish articles on how and why this is so, and what job hunters can do to find the perfect job for them. We also supply credible external resources, so people can consider their alternatives.
· Starting a B2B Business For everyone who can, we heartily recommend starting your own business. The tools are there, and there has never been a better time to do it.
· Building Our Own Robot We’re automating Overlogix from the start, and this series of articles tells exactly how we are doing it.
· Rebuilding the Linux Server: Index of Articles Running AI on your own machine (recommended) requires a modern, up-to-date operating system, and often a lot of additional software infrastructure. This series, dedicated to exactly that sort of system administration, details what we have done to build a powerful server that runs both databases and artificial intelligence, locally.
· The Gospel According to ChatGPT Conversations with various AIs and additional articles on the various challenges associated with actually making profitable use of artificial intelligence.
· TL;DR: Index of Fast Reads Brief, fast reads on various topics in artificial intelligence. If you are a beginner at AI, or a busy human needing fast and factual explanations of complicated technical topics, this is the place to start.
· TL;DR: Overlogix Artificial Intelligence Mini-Wiki Same Fast Reads as previous but arranged in a mini-wiki format some folks may like better.
Substack:
· Welcome to the Overlogix Substack
· Overlogix: Table of Context Index to our Substack articles arranged by topics.
· Criteria for Paid Content Rules for what goes behind our paywall.
· Curated IT and AI Sources Annotated links to sites and YouTube channels we think are valuable.











