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.
15
votes
5answers
112 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 ...
17
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
51 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 ...
2
votes
0answers
25 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
30 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
22 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
51 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
110 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 ...
10
votes
1answer
112 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 ...
7
votes
1answer
83 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
451 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
84 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
90 views
Wrapping WinAPI FindNextVolume as std iterator
This is my first attempt at creating an STL-style iterator. Is this code ok?
...
1
vote
1answer
212 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
425 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
166 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
138 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
187 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
483 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
755 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
662 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
954 views
Looking for a clean way to use ::CreateToolhelp32Snapshot
I have a process, let's call it 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 ...
1
vote
1answer
355 views
RAII-Style Lockable Objects
TL;DR: 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.
Long Version:
I am working ...
1
vote
1answer
49 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 ...
2
votes
1answer
704 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
212 views
Zeroing memory on Windows
I need some useful functions that faster than the original. (Original - C++'s functions)
For example:
...