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.

1
vote
0answers
23 views

CertOpenStore “Memory” returns file not found

The code below used to work. I think it broke after some .NET Framework or Windows 10 upgrade, but not sure. It opens a temporary certificate store for generating self-signed certificates. using ...
-3
votes
0answers
27 views

Trying to delete .exe file using Path from windows registries and DeleteFile() method

So I need to scan windows registries, display them all on the console and then check which of those values has the same name as set in the code When the program finds the value with the targeted name ...
-1
votes
0answers
17 views

Win32 Java Embedding Internet Explorer

by developing an EclipseRCP app i need to embeed Internet Explorer into my app. This is done, but sometimes by embedding i have white background instead of IE toolbar. Have they any ideas how to solve ...
2
votes
1answer
30 views

Client authentication (certificat + private key) using WinInet

This is an evolution of my previous question, which was about WinHttp. I hope this is the right way to do this... I'm trying to communicate in https with a server using WinInet (from the Win32 API). ...
0
votes
0answers
41 views

C# support both x64 and x86

I'm working on a C# project where i have to support both x64 and x86 architecture. I have to pinvoke some kernel32 functions like WriteProcessMemory. In the case of WriteProcessMemory the "SIZE_T ...
0
votes
0answers
38 views

Memory keep unreleased with more than one CDHtmlDialogs.(navigate same Url)

MFC create Modaless CDHtmlDialog more than one time and delete one or more, Memory keep unreleased and heaped up 10~20MB per one CDHtmlDialog until create new modaless CDHtmlDialog with all ...
-4
votes
1answer
54 views

CreateProcess vs. CreateFile EXE

[Edited] CreateProcess creates a process (for example, from .exe file) CreateFile can create / open a file. If it opens an .exe file, that execution file will run. In this case, is it equal to ...
-1
votes
0answers
34 views

Getting Desktop Icon on Win7 x64 Crashes?

I wanted to test accessing desktop icon information but for some reason I get Windows explorer has stopped working and then Windows explorer is restarting This is on Windows 7 x64 Pro ...
-3
votes
0answers
47 views

The windows title defined in CreateWindowW function isn't displayed

I created a window with the CreateWindowW function (after registering the windows class etc) and it works fine, but the title of the window isn't displayed. I could solve the problem with the ...
0
votes
1answer
42 views

ReadProcessMemory Crashes Application When Trying to Read 32bit Integer From Another Process

I have been experimenting with various aspects of the Windows API and thought I would give process memory manipulation a try. Previously I had been trying to do this in native C++ using this method: C+...
1
vote
0answers
33 views

Setting “Override high DPI scaling” to “System (Enhanced)” programmatically or with a manifest (MinGW)

I tried all possible combinations of gdpiScaling and dpiAware, still no luck. If I manually right click app.exe and set "Override high DPI scaling" to "System (Enhanced)", it works great. <...
0
votes
0answers
28 views

C++ CreateProcess STARTF_USEPOSITION not working [duplicate]

I am trying to open a program in the left corner of the screen. But it don't use the info i pass to the function. I have tried with and without this part WaitForSingleObject(processInfo.hProcess, ...
0
votes
1answer
44 views

How to get the serial number of the hard disk using Win API on Lua

local ffi = require("ffi") ffi.cdef[[ int __stdcall GetVolumeInformationA( const char* lpRootPathName, char* lpVolumeNameBuffer, uint32_t nVolumeNameSize, uint32_t* lpVolumeSerialNumber, ...
1
vote
1answer
35 views

QueueUserAPC access violation on x86

I'm trying to use QueueUserAPC to run some function asyncronously on a specific thread. My code is working ok when compiled for x64, but when I compile and run for x86, I get an access violation. At ...
0
votes
0answers
27 views

Does 'MaximumTransferLength' (info via STORAGE_ADAPTER_DESCRIPTOR) affect ReadFile(Handle, ..) ;

At what level do driver 'limitations' such as MaximumTransferLength and AlignmentMask (for instance as can be retrieved via DeviceIoControl (Handle, IOCTL_STORAGE_QUERY_PROPERTY, .. ) ; have impact ? ...
-3
votes
0answers
26 views

File location for Windows system classes? [on hold]

Can anyone tell me where Win32 system classes are stored in the file system? In particular menu class "#32768". I'd like to know if it's possible to change the coloring of standard menus by changing ...
0
votes
0answers
83 views

Hide scrollbars in old windows console(pre windows 10 one)

I have a problem with hiding scrollbars in an old Windows console while simultaneously allowing the console to being resized. My code works on a new console, but on an old console: it works, but ...
-2
votes
0answers
48 views

C++ MoveWindow used after ShellExecute not working [on hold]

I am trying to make a program that open a game and moves it to the left corner. The game is called Growtopia. When i am to using shellexecute with movewindow movewindow dosn't do anything. When i use ...
1
vote
0answers
55 views

Client authentication (certificat + private key) using WinHttp

I'm trying to communicate in https with a server using the Win32 API. Here is a very minimalist code : HINTERNET ses = WinHttpOpen(L"test",WINHTTP_ACCESS_TYPE_DEFAULT_PROXY,WINHTTP_NO_PROXY_NAME,...
-2
votes
0answers
51 views

Direct3D 9 Edges extremely bumpy & Z-buffer problem? [on hold]

I'm developping a Windows-only game engine using DirectX 9 for rendering. Problem is : when i look at my models edges, they have a really odd appearance, for example an inclined edge would look like a ...
-1
votes
2answers
89 views

Enumerate all partitions and test if they are NTFS

I'm using: DWORD d = GetLogicalDrives(); for (int i = 0; i < 26; i++) { if ((1 << i) & d) // drive letter 'A' + i present on computer { wstring s = std::wstring(L"\\\\.\\"...
-2
votes
0answers
35 views

Get Program Name, Program Location or CLSID of application being elevated within a Credential Provider context

I've developed a Credential Provider DLL in C++, based on sample source code by Microsoft. What I want is basically to get the program name/location or CLSID that is being elevated at the UAC window. ...
0
votes
1answer
35 views

Create a process specifying the NUMA node to run on

How to launch a process in Windows on a specific NUMA node in C++? E.g. command start /NODE X does this for node X. But how to achieve the same programmatically?
-3
votes
1answer
58 views

C++ WINAPI Exception Unhandled Les Vesti before reaching code

I've put together a nice little terrain engine in direct x. I changed the width and height of the land from 256 to 512 and now when I run the debugger the program crashes in wWinMain. The Width and ...
0
votes
1answer
79 views

Which way is better to get a static linked DLL's module handle (HMODULE) - using GetModuleHandleEx() or LoadLibrary()?

I have a DLL that contains both code (exported functions) as well as data (binary data embedded as a resource). This DLL is statically linked into my program (EXE). In order to get access to the ...
0
votes
1answer
48 views

How to get Windows screen orientation with Ruby and Win32API

I'm trying to get the Windows screen orientation to put an easter egg of sorts into a game that will occur when the display is upside down. I know Fiddle exists, but that's not the question I've ...
1
vote
0answers
33 views

Re-launch a software minimized

I run MediaPlayerClassic, as a minimized window in the taskbar (see here and the other answer too), with: import subprocess, win32con, win32gui, win32process, win32api info = subprocess.STARTUPINFO()...
0
votes
1answer
47 views

How to monitor and record Win API calls made by executable files for certain action?

PowerBuilder application has some limitations on how objects are managed in libraries. for example there is no way i can copy user object from one library to another through script. I am looking for ...
-2
votes
1answer
56 views

What is clipping rectangle in Win32 API

I'm a beginner and there are functions on MSDN documentation which take RECT argument that contains the coordinates of the clipping rectangle. ex: this function: ScrollWindowEx function I understand ...
1
vote
1answer
38 views

how to create a pen that is the same color as that of a solid brush?

I would like to get the color (colorref) of a SolidBrush to create a pen of the same color, using only Windows API functions (no dot net and stuff like that) using C/C++/Asm/Delphi, etc. If it helps, ...
-3
votes
1answer
53 views

Change BackColor Of Button

Engineer I Have Created 3 Buttons With BS_OWNERDRAW Style Now How Can Brush Function WndProc(Hwnd,message,wparam,lparam) CASE WM_CTLCOLORBTN If wparam=Button1 Then WndProc=hBrushbtn1Elseif Wparam=...
1
vote
0answers
51 views

Qt transparent child window with WS_EX_LAYERED always fails [duplicate]

I'm integrating libVLC in a Qt Quick application on Windows by creating a child window and passing the handle of the window to libVLC to render the video. This works fine. However, I'm trying to ...
2
votes
1answer
70 views

How to detect if Windows 10 is in tablet mode

I'm trying to find a method to detect if Windows 10 is in tablet mode or not. Please note, this is not about querying whether the user has a Tablet PC or not - that can be solved with GetSystemMetrics(...
-6
votes
1answer
58 views

What does all capitalized Function name means in WinAPI?

Informs the provider that a directory enumeration is starting ` PRJ_START_DIRECTORY_ENUMERATION_CB PrjStartDirectoryEnumerationCb; HRESULT PrjStartDirectoryEnumerationCb( const PRJ_CALLBACK_DATA *...
1
vote
1answer
53 views

Undefined Windows reference _ftprintf

I just recently installed GCC onto Windows through Cygwin64. I am trying to compile a program that contains the Windows _ftprintf function (as shown here in the MyHandleError Function and documented ...
0
votes
0answers
56 views

Does CoCreateInstance always launch new copy of server process?

I call CoCreateInstance to get out of proc ActiveX (CLSCTX_LOCAL_SERVER). It launchs new process of server. Is it possible to connect to already started process and don't start new one? If I close ...
-2
votes
0answers
46 views

How to get the window pixels

I'm trying to get the array of pixels of a window using Winapi, i'm usin a screenshot but doesn't work when the window is hide/minimized? Something like this: window = Window.new("Window Name") ...
1
vote
0answers
40 views

Not receiving WM_DPICHANGED in SDL application

I'm trying to write a DPI aware application for Windows 10 with SDL2 using the PySDL2 bindings. For now I don't care about supporting any other operating systems or Windows versions older than the ...
0
votes
1answer
42 views

Invalid handle when calling Windows API from Python 3

The following code works well in Python 2: import ctypes def test(): OpenSCManager = ctypes.windll.advapi32.OpenSCManagerA CloseServiceHandle = ctypes.windll.advapi32.CloseServiceHandle ...
0
votes
1answer
72 views

How to embed OpenGL into a Win32 application?

First of all, my understanding of both Win32 and OpenGL might be entirely wrong. Because of that, don't hesitate to question any assumption I'll make within my following question. What I'm asking ...
2
votes
1answer
43 views

Use SHGetFileInfo in Java with JNA

I tried to translate the SHGetFileInfo function from Shell32 into Java with JNA and used C# code and this as reference While in the C# code psfi.iIcon is 432 in my translated Java code psfi.iIcon is ...
0
votes
1answer
64 views

Window with SysMonthCal32 class doesn't respond to WM_SETFONT

I'm not sure what am I doing wrong. I have a functionality in my CDialog-based MFC app to increase the font in some common controls. It is done by sending them WM_SETFONT message with a larger font: /...
-2
votes
0answers
47 views

What am I doing wrong with runPE injection?

for the last 2 weeks, I've been trying different types of injections. Yesterday, I got DLL injection to work. My next goal was to get runPE to work. I wrote something from what I understood, but it ...
0
votes
1answer
34 views

FOF_NORECURSION while deleting a file with subfolders

Can someone explain to me what does the MSDN description of FOF_NORECURSION flag mean: FOF_NORECURSION Only perform the operation in the local directory. Do not operate recursively into ...
0
votes
1answer
41 views

P/Invoke definition for RtlCrc32 and RtlCrc64 functions?

I would like to request a working P/Invoke definition for the undocumented RtlCrc32 and RtlCrc64 functions. I'm aware about existing CRC-32 algorithms in managed code, but I prefer to go the ...
0
votes
0answers
50 views

How to properly allow click-through areas of transparent sections of topmost window?

I am working on an overlay component of a project in C#/DirectX. This project does not use WinForms or WPF by design. This overlay is hybrid, where I want to render custom UI components via DirectX ...
1
vote
0answers
60 views

Failing to simulate mouse click via Windows API

I was dabbling with positioning of the mouse pointer which I had no trouble at all with, but trying to simulate a left click is giving me problems at the moment. #include <Windows.h> int main() ...
1
vote
1answer
54 views

doesnt work keyboard in login screen with pywin32

I'm running the following code on the windows login screen, but the password doesn't write, how can I do? or how can I enter a password import win32api #running this code in windows login screen time....
0
votes
1answer
37 views

DirectX9 CreateDevice() returns D3DERR_INVALIDCALL in injected DLL for VMT hooking

I want to modify a DirectX-Application's behavior (namely I want to implement a program similar to the Statman-Application by OrfeasZ [https://github.com/OrfeasZ/Statman/releases] as Onscreen-Info for ...
0
votes
0answers
21 views

scheduled job using NetScheduleJobAdd in Active Directory dont run in client

i am administrator of Active Directory. i want to copy a executable in the ADMIN$ share location of a client programically. after run my program, executable copy to ADMIN$ share location successfull ...

http://mssss.yulina-kosm.ru