Questions tagged [winapi]

The Windows API (formerly called the Win32 API) is the core set of application programming interfaces available for the Microsoft Windows operating systems. This tag is for questions about developing native Windows applications using the Windows API.

Filter by
Sorted by
Tagged with
0 votes
0 answers
62 views

C++ Game Pointer Address changes to Offsets not the value address

I made a code that should give me the value of the pointer address. For that i "build" the address but the address is always only the offset of the pointer address. Cant figure out why i ...
Chraydragon's user avatar
-1 votes
1 answer
23 views

Schrollable dialogbox without (the desktop) window

This example of scrollable dialog box https://www.codeproject.com/articles/32925/scrollable-dialog-in-pure-win32-api works fine, and display the dialog box My question does this dialog box = the ...
elwolv's user avatar
  • 1
0 votes
0 answers
31 views

How do I change an AD users password given his current credentials?

The function should be straight forward... here's an example of one. I have another that uses NetAPIi32.NetUserChangePassword(). In both cases, I get this error: The password does not meet the ...
Iunknown's user avatar
  • 357
0 votes
0 answers
29 views

How do I improve the code from "How to Assign a Custom Icon to a File Type" since it runs with no errors? [closed]

I have been learning Rust using Microsoft's documentation for the Windows API, and I came I across an article "How to Assign a Custom Icon to a File Type". I wanted to implement it in Rust, ...
jigsawy's user avatar
0 votes
1 answer
25 views

How is to create button with icon in WINAPI

I have a button. HWND button = CreateWindow("button", "test_text", WS_VISIBLE | WS_CHILD, 0, 0, 500, 500, window, NULL, NULL, NULL); "window" is my HWND variable of my ...
Rarest Loki's user avatar
0 votes
0 answers
19 views

Close security screen alert using VBA with Windows API

I´v been devoloping an automation with VBA that uses Internet Explorer as the main browser. But every time I run my code, a little screen appear, saying about security: it´s in portuguese but i don´t ...
Erick MS's user avatar
0 votes
0 answers
26 views

Delayed audio when capturing process-specific audio loopback interface

I'm experiencing a 30-50ms delay when playing back the captured audio by the Windows-classic-samples/ApplicationLoopback sample. I noticed this when I played the captured audio over the original ...
naguilera's user avatar
0 votes
0 answers
66 views

What does Windows IOCTL code 0x83350048 do?

I can find: #define CTL_CODE( DeviceType, Function, Method, Access ) ( \ ((DeviceType) << 16) | ((Access) << 14) | ((Function) << 2) | (Method) \ in winioctl.h. ...
埃博拉酱's user avatar
2 votes
1 answer
73 views

Range Check calling OpenSCManager in Alexandria 64-Bit

We recently updated from Delphi Berlin to Alexandria 11.2 and have run into an issue. One of our applications targets the 64-bit platform. When it goes connect query Windows services, it throws a ...
kaosoe's user avatar
  • 23
0 votes
0 answers
26 views

winpy32 throws -2146826246 when accessing a specific cell using WorkSheet.Range('A1').value

I have a script that is reading a complex model in excel, using pywin32. In the first part of the script, model inputs are found from the input worksheet within the workbook through InputWorkSheet....
Zuddas98's user avatar
-1 votes
0 answers
36 views

Problem with VirtualAllocEx function in the win32Api

So i was trying to setup a simple process injection implementation by following along to this video, https://www.youtube.com/watch?v=A6EKDAKBXPs So i write the code and everything is going fine till i ...
koiboi's user avatar
  • 19
0 votes
0 answers
47 views

Support Multi-Language in MFC project without using dll

I have created different .rc files for e.g Japanese.rc and English.rc. I want to load their respective strings on the basis of user not on the basis of locale system language. I tried the following ...
Umang's user avatar
  • 1
-1 votes
1 answer
35 views

Windows :Multiple DNS query while ping and nslookup when 2 NW adapters attached [closed]

On Windows 11, I am looking no of DNS queries trigerred when 2adapters attached to device. To test this I attached wireshark for each ethernet(ethernet1, ethernet2). when I ran single nslookup command ...
user3664223's user avatar
0 votes
0 answers
70 views

How to retrieve the cycle time of each processor in the system?

I'm planning to use QueryThreadCycleTime() to in order to calculate the percentage of CPU some specific thread has used during a given interval (between two samples). The main issue is I need to know ...
tigrou's user avatar
  • 4,316
0 votes
1 answer
25 views

Is access to a data structure posted through PostThreadMessage() serialized by multiple receiving threads?

I want to share a data structure from one thread to two other threads with the Win32 API PostThreadMessage() using a MSG structure. I just want to know if the use of queued thread messages is ...
Julien Poivret's user avatar
-4 votes
0 answers
34 views

Show the windows explorer context menu [duplicate]

I'm looking for a way to show the windows explorer context menu having only the file path in C++. I already saw some posts but them were so old and had broken links. Thank you
Mao's user avatar
  • 116
-1 votes
0 answers
52 views

I'm trying to make a texture for OpenGL on C++ out of an embeded into the executable BMP and method GetDIBits fails and returns 0

The code tries to get an array of pixels out of an embeded BMP (It's 24 bit, 32x32, RGB), to use it in a texture for OpenGL, but GetDIBits() returns a zero. I've tried doing everything I can and no ...
DenisDubovik's user avatar
0 votes
0 answers
35 views

DiUninstallDriver API does not remove driver related entries from Windows registry during driver uninstallation

We recently switched to DiInstallDriver and DiUninstallDriver APIs for our kernel driver's installation/uninstallation via MSI. I encounter no issues when using DiInstallDriver to install the driver. ...
Ankur Garg's user avatar
0 votes
1 answer
91 views

How to wake up only one using WaitForSingleObject in Windows

I have concerns right now Create an event using CreateEvent. HANDLE g_hEvent = CreateEvent(NULL,TRUE,FALSE,NULL); And about 10 Threads are created, and each thread is Wait using WaitForSingleObject(...
Seongtaek OH's user avatar
1 vote
0 answers
26 views

Win32 RDBSS maximum path and maximum path component length in Windows 11?

Windows 11 no longer has the 260 char MAX_PATH limit. Does the Win32 RDBSS (The Kernel Network Mini-Redirector Driver) API have a path length, or path component length limit? I turned the Microsoft ...
Martin Wege's user avatar
-2 votes
0 answers
72 views

Maximum path length in Win32 API on Windows 11?

Maximum path length and path element (single file/dirname length) in Win32 API on Windows 11? There seems to be some confusion, docs cite 256, 260 and 32k. What is the maximum supported, and what ...
Cedric Blancher's user avatar
0 votes
0 answers
61 views

NtAllocateVirtualMemory terminates with error 0xC0000005

When trying to allocate memory via NtAllocateVirtualMemory ( it works via VirtualAlloc , but I'm wondering how it will work via NTAPI ) and I don't understand what the reason is, I gave ...
unyo's user avatar
  • 11
0 votes
0 answers
34 views

Enable snap layout on custom maximize-restore button and apply shadow around borderless form

I have a borderless form with a custom max-restore button, the max-restore button is a custom class with overriden WndProc that returns HTCAPTION when the message is NCHITTEST, that properly shows the ...
Jesus Sobalvarro's user avatar
0 votes
1 answer
32 views

WinUI 3 ListViewItem Width not adhering to ListView Width

Personal commentary This has actually been driving me a bit loopy; I just can't seem to get the desired outcome so any help with this is much appreciated. Problem Statement I have a ListView within a ...
JoeTomks's user avatar
  • 3,247
0 votes
1 answer
73 views

How to use Windows.h Mutexes with two threads

I'm facing a problem using mutexes in two different threads. I have two thread functions: a producer, which receives data from the user and writes it to a global variable, and a consumer, which ...
Timur Khalikshin's user avatar
0 votes
0 answers
28 views

DirectX 11 - Drawing multiple viewports RSSetViewports with an array of CD3D11_VIEWPORT

I've set up my vertex shader and my pixel shader. I then created a vector to represent my viewports (4 in total in this case): std::vector<CD3D11_VIEWPORT> view_ports; I've populated the vector ...
IRP_HANDLER's user avatar
0 votes
1 answer
49 views

Win32 COMBOBOX dont draw dropdown-list

i create in win32 c++ plugin on a *.rc-file a COMBOBOX with drop-down-list: COMBOBOX IDC_CCODE_EDT_PNR,60,18,83,27,CBS_DROPDOWN | WS_VISIBLE | CBS_SORT | CBS_AUTOHSCROLL | WS_VSCROLL | WS_TABSTOP ...
Mario Rosenbohm's user avatar
0 votes
1 answer
39 views

LIBCMT.lib(exe_winmain.obj) : error LNK2019: Unresolved WinMain external symbol referenced in function "int __cdecl __scrt_common_main_seh(void)"

So i want to compile a program that basically is a WINDOWS program with SUBSYSTEM:WINDOWS and everything seems right but is giving me the error: FULL ERROR HERE -> LIBCMT.lib(exe_winmain.obj) : ...
Gh0stSoul's user avatar
-1 votes
0 answers
62 views

Trying to implement better event system in my application

Right now I am implementing entity component system: rendering and everything is moving flawlessly. I needed to implement movement control so that it could work as before. Before my movement code was ...
Arheus's user avatar
  • 19
-2 votes
1 answer
71 views

LNK2019 unreferenced function main [duplicate]

I'm creating a d3d12 project from the blank c++ windows template and am geting this error: 1>MSVCRTD.lib(exe_main.obj) : error LNK2019: unresolved external symbol main referenced in function "...
Luke Wright's user avatar
1 vote
1 answer
135 views

Output False of if statement in C

Can someone please help me with the following problem? I have not included some parts of my code (error handling, etc) in this post to keep it as clear as possible. When I iterate through the ...
Questions123's user avatar
0 votes
0 answers
36 views

How does the Windows clipboard popup (Win+V) determine the caret position?

When opening the Windows clipboard history (by pressing Win+V, or the emoji panel by pressing Win+.) it opens at the location of the caret (cursor, although people seem to confuse that with mouse ...
kwyntes's user avatar
  • 1,119
0 votes
1 answer
55 views

"a pointer to a bound function may only be used to call the function" Error when trying to pass a class method [duplicate]

I have a Windows class as follows: struct PlatformState { HINSTANCE hInstance; HWND WindowHandle; }; class Win32Platform { public: Win32Platform(const char* app_name, uint32 startX, ...
lokit khemka's user avatar
1 vote
0 answers
34 views

Win32 filesystem "FILE_SUPPORTS_POSIX_UNLINK_RENAME" - what does it do?

Does anyone know what the win32 filesystem attribute "FILE_SUPPORTS_POSIX_UNLINK_RENAME" does ? What is the difference in filesystem behaviour ?
Roland Mainz's user avatar
0 votes
1 answer
61 views

How to resize the console window and move it to fill the screen

I am using C++ in Visual Studio 2017, and I am making a text based game in the console window. When I run my program, and it opens the console window, I want it to automatically go into full screen ...
whatupo9's user avatar
0 votes
1 answer
59 views

Compliant way for an uninstaller to remove HKCU keys of other users

I know the general answer is "No, you don't", for example How to remove HKCU registry keys when uninstalling software?. That post suggests that if you're desperate enough you can use ...
Agritite's user avatar
2 votes
0 answers
36 views

Win32 API equivalent to POSIX pathconf() _PC_MIN_HOLE_SIZE (minimum sparse file hole size)?

What is the Win32 API equivalent to POSIX pathconf() _PC_MIN_HOLE_SIZE, i.e. how can I query the minimum sparse file hole size for a specific path in a filesystem?
Cedric Blancher's user avatar
0 votes
0 answers
63 views

How do I change console font size and other properties on Windows?

As title says. I also want to be able to customize it so I can have different lines at different sizes at the same time, if that makes sense. I tried the below code from someone on StackOverflow, but ...
Murhaf Ghazal's user avatar
0 votes
0 answers
64 views

How to ignore (undo) the WM_SETFOCUS for the new window and WM_KILLFOCUS for the old one, keeping the rest of the processing?

Lets say I have a frame window containing an EDIT and a BUTTON controls, I need to keep the focus always on that edit control whenever I click on the button, and continue the normal button click ...
Tomay's user avatar
  • 45
0 votes
0 answers
139 views

Is there a win32 API to get the ids of all threads currently in running state?

I would like to get a list of all threads that are currently in running state on the operation system (globally, not just for the current running process). The thread unique id is enough. Currently I ...
tigrou's user avatar
  • 4,316
0 votes
0 answers
79 views

Win32 - Drawing a native window with a specific style

Does the Win32 API expose any of the facilities that are used by Windows to draw the native controls as they appear by default? Say my application wants to display a non-interactive preview/mockup of ...
user2593449's user avatar
0 votes
0 answers
42 views

Win32 code example - punch holes into file to deallocate blocks and make it a "sparse file"? [duplicate]

Linux has fallocate(fd, FALLOC_FL_PUNCH_HOLE|FALLOC_FL_KEEP_SIZE, ...) to punch a hole into a file, i.e. deallocate the blocks given and make the file a "sparse file". Does anyone have a ...
Cedric Blancher's user avatar
-1 votes
0 answers
80 views

Not all pixels on the screen are captured C++

This program must detect coordinates between 0x0 to 2560x1440, but actually shows 2047x1151, and this is with all resolutions. In all resolutions, I have some problem in the detection of the cursor ...
F_L_X's user avatar
  • 1
0 votes
1 answer
38 views

Extents reported in USN_RECORD_V4 struct are a lot bigger than actual changes

We use USN change journal to track changes on SQL data files for performing incremental backups. For big files (of size 5 TB), we have seen USN_RECORD_V4 have extents reporting that a big portion of ...
Kanak's user avatar
  • 21
0 votes
2 answers
63 views

How to close dumpcap.exe using WinAPI? Dumpcap.exe is work by cmd.exe

I'm capturing packets with dumpcap.exe in a cmd.exe window: dumpcap.exe -i 5 -w:\\Users\\xyz.abc\\Desktop\\allPacketTMC.pcapng This capturing method works in a QT GUI. When I click the "Start LOG&...
AHMET YASİR TEKSAR's user avatar
0 votes
0 answers
46 views

Why does CreatePipe() fail with ERROR_BAD_IMPERSONATION_LEVEL?

We tried to write a replacement for the Win32 _popen() function using CreatePipe() (see https://nrubsig.kpaste.net/b9 for the code). It works as a standalone application, but if we embed it into our ...
Roland Mainz's user avatar
0 votes
0 answers
74 views

Tooptip not working in button of another program

I'm in the process of creating a tooltip for a button 'connect' within a program such as RDP: #include <windows.h> #include <commctrl.h> #pragma comment(linker,"/manifestdependency:\&...
NameBlue's user avatar
1 vote
0 answers
121 views

Compiling Windows Native program in Visual Studio

I am trying to develop a native Windows program so I started from Pavel Yosifovich's video. I wrote the simple.cpp program as shown in the video, and set options of Visual Studio as explained (...
0xmijix's user avatar
  • 11
-1 votes
0 answers
51 views

LocalFileTimeToFileTime vs std::mktime for Local Time Conversion with DST for Comparing FAT32 and NTFS File Timestamps

Over here it explains that LocalFileTimeToFileTime uses an incorrect algorithm to convert FAT32 timestamps to be compared with NTFS timestamps while mktime uses a different algorithm that is ambiguous....
riverofwind's user avatar
-3 votes
0 answers
105 views

Qt App: The second black window appears when I run the application in release mode

The second black window appears when I run the application in release mode: How can I prevent it from appearing? I removed all qDebug statements to prevent it from appearing. However, I have not ...
Mabel_589's user avatar

1
2 3 4 5
851