The Win32 API is the core set of application programming interfaces (APIs) available in the Microsoft Windows operating systems. This tag is for questions about developing native Windows applications using the Win32 API.
4
votes
1answer
83 views
Task-Based Overlapped IO In .NET
I've been working wrapping the Windows API's Overlapped methods in the more usable Task based approach. There isn't much information out there on doing this, so I've been flying blind apart from a few ...
4
votes
2answers
869 views
Minesweeper C++
This is my improvement of a minesweeper game I took from the internet, which I am quite proud of. Nevertheless I am willing to hear your opinions, suggestions, and comments.
...
1
vote
2answers
39 views
Code in patched Cygwin for calculating path to command interpreter
I'm working on a fork of Cygwin for native Windows development.
In this commit, I'm trying to improve the security of code that spawns cmd.exe, used by functions ...
3
votes
1answer
94 views
Handling GetTickCount() overflow in timeouts
This is code which must run on XP, so no GetTickCount64, and which should correctly handle the value wrapping around after 49 days. Can it be improved?
...
1
vote
0answers
297 views
OpenCV-based wrapper for Windows screen capture
I have written a ScreenVideoCapture class that implements an interface for capturing frames from a specified monitor connected to the PC. It uses OpenCV structures (...
6
votes
2answers
145 views
Change list separator, parse file, restore list separator to original value
Following up on @Vogel612's friendly advice from the vba-rubberducking chat room, I am posting my working code for open review. Thanks also to @Mat'sMug for the ...
1
vote
1answer
85 views
Fixed time step game loop
I'm writing a Direct2D game in c++ / WinAPI. I need to render things 60 times every a second using fixed time step.
...
2
votes
1answer
535 views
Implementing a memory scanner in python
I'm trying to implement a memory scanner in python.
The problem is, it's too slow.
What it does it gets a number from the command line and compares it to every address, then writes it to an output ...
5
votes
2answers
77 views
LifeSaver: Hides and manipulates windows
[ This app is now on github !! ]
This is a small program I wrote to hide/show different windows on my Windows PC.
This is named LifeSaver because it did save my ...
2
votes
1answer
246 views
getProcID and getProcessHandle functions
I made two functions: one to get process id and the other to get a handle with all access to that process using the process id. I'm looking for help with making these easy to use on all types of ...
2
votes
2answers
142 views
15
votes
5answers
171 views
Step by Step, ooh HotKey
Still hooked on Windows, I refactored the hook into a number of interfaces, and I wanted to support 2-step hotkeys, so I started with defining an IHook that can be ...
18
votes
2answers
3k views
Hooked on Windows
The code that was just added to Rubberduck will allow us to set up hotkeys for our features, so that next release, Ctrl+Shift+R brings up the refactor/rename dialog, for example.
The requirements ...
1
vote
1answer
213 views
Double buffering Gdiplus and GDI
I have this working code and was wondering how I can optimize it. Is there anything I can declare globally so it does not need to be be created over and over? This function is called around 30 times a ...
3
votes
0answers
107 views
Delphi: convenience wrapper for GetSystemTimePreciseAsFileTime()
For some purposes it can be highly desirable to use GetSystemTimePreciseAsFileTime() whenever it is available (i.e. Windows 8+) because the accuracy of ...
1
vote
0answers
49 views
Follow-up: Window Creation Wrapper Class
This is the revised version of the Window Creation Wrapper Class. I tried to improve the code due to the remarks of @user1118321 (see posted link) and I hope for further reviews. For instance, you ...
2
votes
0answers
36 views
Write data with updateresources
I have developed this function but I'm not sure if this is the best (secure) way to write in resources without corrupt *.exe in case of fails.
What is the best way to write resources to a *.exe file?
...
3
votes
0answers
259 views
Asking Windows for real-time priority
This code snippet is about asking Windows for the highest possible execution priority. Basically, we have to ask for real-time priority class for the entire process, after which each thread has to ask ...
4
votes
1answer
207 views
Window Creation Wrapper Class
This Question now has a follow-up here
I don't think that there is any new technique in my code but in my opinion it's ok all in all (with a bit of magic). Maybe you can find something to improve or ...
12
votes
2answers
269 views
Win32 File API in VBA
Win32 File API Wrapper
Based on a few fundamental frustrations with VBA (namely the lack of ability to work with files larger than 2GB, the lack of encapsulation of the file functions and the lack of ...
6
votes
1answer
115 views
Porting ProcMonDebugOutput from C# to VBA
This code has one public method. ProcMonDebugOutput(). It will sent a string of text to Process Monitor that process monitor will display.
I'm basically ported ...
5
votes
3answers
1k views
Class to wrap Netapi32.dll functions
I have made a class for some Netapi32.dll functions in C#. I would like to know if there are any big problems with it or if there is some other function needed in general.
Functions:
...
7
votes
1answer
106 views
Wormhole - a Windows shim app written in C with no stdlib
My application compiles and seems to work correctly, but this is my first C project so I welcome any criticism. I developed this in Pelles C with no standard lib. Efficiency and optimizations are more ...
3
votes
1answer
105 views
Wrapping WinAPI FindNextVolume as std iterator
This is my first attempt at creating an STL-style iterator. Is this code ok?
...
2
votes
1answer
333 views
Hook COM Object and get data from SIEMENS Step 7 software to control PLC through events in their code modified at runtime
I'm a first traveler coding in WinApi, Hooks, COM objects. Then, I made a dll to inject (EasyHook) this in the target SIEMENS Step7 process and modify the software code at runtime:
Maybe I want some ...
5
votes
3answers
773 views
WinInet C++ Wrapper
Because I don't like complex sequences of code for simple functions, I wrote a wrapper for http/https access in A++. Are there any bad programming practices I am using? Is there any functionality I ...
1
vote
0answers
257 views
Win32 GDI+ memory and style
I compiled this with wxDevC++, and it needs the GDI+ library and header includes for Windows, to compile.
On a larger program I have had memory fluctuating from plus minus 4MBs. Not a lot, but why is ...
1
vote
1answer
427 views
Win32API program Main with Child windows design pattern
Below is the code of a development status project. I have designed a main window with 3 children. I am mainly interested in your comments on the design pattern used for drawing the child windows and ...
3
votes
1answer
323 views
DestroyWindow() non-existant windows
What I am working on has sets of window controls. Controls are constantly being either destroyed, or created.
...
7
votes
1answer
651 views
Testing if TreeView's node is checked
I have recently answered a question on Stack Overflow where OP wanted to programmatically determine if TreeView's node is checked or not, among other things. My ...
6
votes
1answer
1k views
WinAPI code for DNS queries
This is just some test code I'm doing to learn C++11. It compiles and runs consistently. But is anything wrong that will eventually (or under slightly different circumstances) fail?
Besides ...
5
votes
2answers
937 views
Disk enumeration and file listing
I am writing C++ code to enumerate the whole HDD and drive listing. However, it takes more than 15 minutes to complete the disk enumeration of all drives (HDD capacity of 500GB) and compile the ...
2
votes
1answer
1k views
Using ::CreateToolhelp32Snapshot
I have a process, let's call it Proc1. It is installed in two different directories and one instance of each is running:
C:\DirA\Proc1.exe
C:\DirB\Proc1.exe
When iterating through all currently ...
2
votes
1answer
442 views
RAII-style lockable objects
Without the phrases "use Boost" and "use C++11", does the posted code for RAII-style locking of a resource look correct and safe, or is there something I've missed.
I am working on a Windows project ...
1
vote
1answer
51 views
Printing a range of numbers using configurable worker threads
I have written code to print a range of numbers using multi-threaded programming. It takes in the number of threads to spawn as input.
It is working fine and giving the expected results. I just ...
3
votes
1answer
855 views
std::string/std::wstring template wrapper for Win32 API
I have not completed this but want to make my own template library for wrapping the Win32 API to make it compatible with std::string/std::wstring... Here's a sample of what I've worked with so far.
...
-1
votes
1answer
231 views
Zeroing memory on Windows
I need some useful functions that faster than the original. (Original - C++'s functions)
For example:
...