Winapi Questions
Ad
How to unselect the text in a Combobox with dropdown style?
In windows c api i have a combobox with dropdown style. i set a text in the edit control of the combo box during the dialog initialization. i want
Making The Edit Control Transparent WinAPI (win32)
This is the relevant part of my code: case wm_ctlcolorbtn: case wm_ctlcoloredit: case wm_ctlcolorstatic:
Why can I read a dereferenced pointer, but can't write it in C, but can in C++?
I needed to patch a program, so i made a dll that i can inject and on inject it patches one byte of the instruction. the code is pretty simple,
How to get FileDescription with VerQueryValue (getting the example to work)?
I am trying to get the various attributes of a file as seen in its "details" tab with the winapi function verqueryvalue. i
Subclass edit control without ruining copy/paste
I want to create an edit control where users can only type in floating point numbers, but i want to also be able to copy/paste/cut text in this
Winapi Window in c not responding
I've been trying to make a simple window using winapi, it compiles and links with some warnings, when i open the program the window shows up, but
Image not displayed correctly with BitBlt
So i just started c yesterday, literally. being as fresh as i can be, i tried a fairly simple task of displaying an image on top of my desktop.
How does a GUI framework switch windows/window views/forms on Windows?
From what i understand, a gui will have its windows, window classes, and use these for the main windows and all the buttons and tabs etc.
Facing issues trying to decode base64 image
I have a jpeg image, which is represented as a base64 encoded string. i want to save it as a decoded byte array using the win32 api
Ad
Cannot find output of Win32 TraceLogging
I tried to replicate the short sample program for tracelogging that microsoft provides (see below, with minor changes). i completed the
How can you iterate though directories without using any recursive functions in c?
I'm trying to create a program using c and the win32 api to iterate though directories trees. can anybody help modify the code to make it work
Text highlighting and UNDO in Richedit
I'm trying to implement a text highlighting and undo in richedit. the code below marks 5 and 6 chars but undo doesn't work (the text doesn't
Common Item Dialog interfaces not included in minGW?
I'm writing a program for windows 10 in c using mingw. i have the latest version. i want to display an open file dialog, which is easy to do with
Windows set maximum number of threads in default thread pool
Starting with windows vista, every application automatically gets a
CreateRemoteThread, doesn't start a thread
I use this function as usual, but the debug traces (outputdebugstring) don't work from injecting dlls. and in the target application no thread is
C create and run windows service
I am trying to create a service that will be run at system startup and start it immediately. service is supposed to run my exe file. getlasterror
Why does OpenProcess() return ERROR_ACCESS_DENIED only for some processes?
Openprocess(process_query_information, true, pid) returns successfully for, for example, an administrator cmd.exe and
GDI fails conversion to indexed color with exact palette?
Summary using windows gdi to convert 24-bit color to indexed color, it seems gdi chooses colors which are "close enough" even though
How do I disable privileges for a process?
Ultimately, i want to spawn a c executable from a node app that drops all but the necessary privileges for its parent, the node process itself. my
InternetOpenUrl with self signed certificate
The following code is used to download files, but not working if the server has a self signed certificate: dword errcode = 0;
Ad
When building a DLL file, does the generated LIB file contain the DLL name?
In visual c++ , when i build a dll , the output files are .dll and .lib. is the name of the dll built into the .lib file . the
How can I programmatically manipulate Windows desktop icon locations?
Several years back, i innocently tried to write a little app to save my tactically placed desktop icons because i was sick of dragging them back
How can I make a systray (notification area) icon receive WM_MOUSEWHEEL messages?
I want to extend an existing application i made to make it set mixer volume by wheel-scrolling over it's notification area icon. as far as
Creating a ruler bar in MFC
What's the best way to go about creating a vertical and horizontal ruler bars in an sdi app? would you make it part of the frame or the view?
How to get milliseconds passed since unix epoch in C without multiplying seconds by 1000?
The only thing i know is time(null), but it return seconds since 1970. it's fine to me to use winapi functions if c doesn't have
In .NET CF 2.0, will a global keyboard hook interfere with P/Invokes that require a keypress?
My details: custom mobile device running windows ce 4.2, compact framework 2.0 sp1. c# app making decent use of p/invokes with no problems until
_setmode( _fileno(stdin), _O_BINARY) waits for Enter key when compiled with /MD
I am embedding a java vm (jvm) using jni in a dll for a native application on windows (altv-server.exe). internally jni_createjavavm calls
What is the best practice for writing Registry calls/File Sytem calls/Process creation filter for WinXP, Vista?
We needed to monitor all processes registry calls/file sytem calls/process creations in the system (for the antivirus hips module) . also
Where's the Win32 resource for the mouse cursor for dragging splitters?
I am building a custom win32 control/widget and would like to change the cursor to a horizontal "splitter" symbol when hovering over a particular
Why does OpenThemeData(pParent, L"TEXTSTYLE") fail on XP?
I'm using the theme library to draw some text which works absolutely fine on windows vista - however, on windows xp the returned htheme is null.
How can I get a list of all open named pipes in Windows?
Is there an easy way to test whether your named pipe is working correctly? i want to make sure that the data i'm sending from my app is actually
Ad
Is FindFirstChangeNotification the best API to use for file system change notification on windows?
I'm new to windows programming and i'm trying to get notified of all changes to the file system (similar to the information that filemon from
On Win32 how do you move a thread to another CPU core?
I'd like to make sure that a thread is moved to a specific cpu core and can never be moved from it by the scheduler. there's a
Low level keyboard input from Windows
What win32 calls can be used to detect key press events globally (not just for 1 window, i'd like to get a message every time a key is pressed),
How can I find out how much of address space the application is consuming and report this to user?
I'm writing the memory manager for an application, as part of a team of twenty-odd coders. we're running out of memory quota and we need to be
How do you parse an IP address string to a uint value in C#?
I'm writing c# code that uses the windows ip helper api. one of the functions i'm trying to call is
_wfreopen works on c:/path/file.txt but not with c:\path\file.txt?
Tchar finalpath[max_path]; getcurrentdirectory(max_path,finalpath); tchar filename[] = text("\\lista.txt"); wcscat(finalpath,filename);
Setting the Line End Styles for Canvas.LineTo
Is there any way to set the style for the lineends for the tcanvas.lineto method? it seems to default to rounded ends, which looks very bad for
Window styles / Minimal titlebar/borders
I'm looking for some kind of a resource (website) that would list all possible window/dialog frame styles and their respective combinations
Do you have to register a Dialog Box?
So, i am a total beginner in any kind of windows related programming. i have been playing around with the windows
Is it possible to impersonate a user without logging him on?
Is it possible to impersonate a user without supplying user name/password? basically, i'd like to get the csidl_local_appdata for a
WaitForMultipleObjects doesnt wait until all threads finish
What i want are 5 threads that print something indefinitely. i used the waitformultipleobjects api to wait until the threads finish
Ad
Ctypes- pass the address of an integer to WriteProcessMemory
I want to write to address1 the value of number1 that is an integer. i tried to use addressof but it still
Python- GetProcAddress using ctypes returns NULL
Problem: i am trying to get the address of loadlibraryw but gets null. research
Winapi CreateProcess File Permissions
I'm currently writing some software that has two different programs using the winapi (a parser and an interpreter). i would like to call the
Why can't I reuse an event even after explicit ResetEvent call?
I want to watch for changes done with a file (the event i'm waiting for is change contents event, i.e. last modified date is updated) i
Get current desktop wallpaper in ctypes
I try to get path to current wallpaper in python using ctypes module. but as a result program returns value 1. import ctypes
Understanding SendMessage wparam
I am working on an mfc project, which has the following code: nmhdr pnmhdr; pnmhdr.hwndfrom = getsafehwnd(); pnmhdr.idfrom =
Why do many Win32 Strucs contain their size as a member
This is not strictly a programming question but more of a design question. working with some strucs from the winapi i noticed that many of
Check if key is pressed on background using win32api
I'm trying to make a simple python script to capture image from my webcam on workstation unlock. and i am making a "kill switch" that checks if
Resetting windows idle time
I have written a small program, that keeps my computers awake even, when the battery settings can not be changed:
tkinter watch clipboard GetMessage no return value
I want to monitoring clipboard app for win10. like: when we copy text 00-22-33-11-22 mac address from notepad.exe,tk's window get text and
How to extract the folder path from PItemIDList parameter in TRzShellTree.OnAddItem event handler?
In a 32-bit vcl application in windows 10 in delphi 11 alexandria, i have a trzshelltree control (by ray konopka from the konopka
Ad
how to add drop down list in excel cell using win32com python
I am trying to add drop down in excel cell using python win32com api. but not able to implement it. here is my code
GetWindowTextA returns gibberish with unrelated code changes
I've tried this code which was supposed to get all window titles and positions and store them in vectors (here window titles are printed) but the
Shall the caller deallocate the return value of `SHCreateMemStream`?
This is a dumb question, but i'm sorry i cannot find this information in
How to return a variable from the event function?
I am new to c/c++. currently, i am working on a project in which a haptic device is used. i just want to return a value when the device button is
API for certain Windows events (opening a file, copying a file, etc)
Is there an api in windows so that any time a user saves a file, opens a file, etc in windows explorer you can have a handler in between it? for
How do you configure an OpenFileDialog to select folders?
In vs .net, when you are selecting a folder for a project, a dialog that looks like an openfiledialog or savefiledialog is displayed, but is set
Finding function offset from file from RVA
I want to find a function inside my .exe, and memcpy it somewhere else. i have used the idia sdk to parse the .pdb file for my .exe, which
Calling a DLL function with an allocated character buffer that the function fills in Inno Setup
I am using (unicode) inno setup 6.0.5 on windows 10 64-bit. the exported symbol, i want to use has the signature:
Setting cursor for the gap in between controls WinAPI
I have statically added few .cur files to the executable. i can get them well;
How to get the 64 bit "Program Files" folder path from a 32 bit program
I need to get the 64 bit "program files" folder path (the one that defaults to c:\program files, not the one that default to
How to get non-latin input in console
I wanted to get latin and also non-latin characters as input but there is a problem here. when i am going to enter persian words like
Ad
Hiding and showing container windows based on tab
I have created a tab control that contains two tabs. inside each tab there will be a container window to hold other controls (in the code example,
PIMAGE_NT_HEADERS Showing different Values
So i am currently attempting to locally map my suspended thread when i pop my program into cff explorer it says that the value of
how to advance to next block of memory when relocating image
Basically i just want to understand how does this works i saw a couple of people advancing to the second pimage_base_relocation struct (or second
Calculate normalized coordinates for SendInput() in a multi-monitor environment
I want to send mouse input programmatically to anyone of my connected displays. i know i can use the
Color specific treeview item using WIN32 API (C/C++)
I wanted to create a tree view where specific items have a different back & text colors. i did found the following solution in the internet:
Expected Expression before 'LPCVOID' in C?
I want to get imagebase for a process, so i can edit its contents later. this is my code : handle
Issues with Win32 ReadProcessMemory API
I am writing a simple application to perform process hollowing which starts a 64 bit process, the application then uses ntqueryinformationprocess
Program to get all local users and their permission for the given file using win32 api in C programming
I'm trying to get all the users details and the privileges of the users for the given file. something like
Redirect Input\Output pipes from parent process to cmd child process C/C++ WinApi
I have been trying to run a parent process that acts like a cmd input\output console. the purpose of this is for future use, but for now i am
How to get attribute of a directory like last access and last modify
I wanted to get timestamps of a directory and then show it to the user. i have written the following function, but it doesn't work when i give a
DrawText issues
I have a couple of issues with this function: the text turns into gibberish if i move the window a bit, or if i switch it to another
Ad
I'm a Windows Forms\WPF developer. Should I read Petzold's Programming Windows (the C language one) book?
I'm a c# developer working with either windows forms or wpf. sometimes i have to deal with unmanaged code, which i don't like. i think that the
Ensure memory mapped page is in memory
I have a read-only win32 memory mapped file with no sharing open. is there any way to tell windows to load some page into memory, making sure that
Set button text color in Win32 API using custom drawing
I wanted to create some sort of a dark-mode button using common controls & win32 api. i wanted to use custom drawing to set my
Are C standard library functions thread-safe in absence of C11 threads?
I am writing a multi-threaded program on windows. since there is no windows implementation of c that i know of to support c11 threads, my best bet
Iterate through resource string table
I have a string table defined like this in my win32 app: stringtable begin ids_string101 "mystring1"
win32 scrollbar in not working in C/C++ program
Win32 scrollbar in not working screenshot win32 scrollbar in
Disabling close button in messageboxa with the use of sc_close
I had this problem for quite a while now. in my message box, i have a cancel button. i don't want the close button to interfere because my
Linker error encountered upon attempting to use RtlInitUnicodeString()
The function rtlinitunicodestring() used to initialize the unicode_string structure cannot be used as a linker error
Can .EXE use symbols from an indirectly imported DLL?
I have a sample.exe project that depends on common.dll . i need to use libcurl.dll in both sample.exe and common.dll . do i need to import
Does rcx always point to the PEB at the process entrypoint?
64-bit windows seems to call into an exe's entrypoint with rcx = r8 = &peb and rdx = r9 = &entrypoint as if the
How to check existence of a directory in C
I have developed a program that is a simple file manager. for example, it lets a user create a file, delete a file, see the attribute of the
Ad
Can not Transmit last packet with recv() Server/Client C file Transmiting over TCP
I have been trying to transfer files over tcp\ip on a windows client to linux server. this has been a major issue for the passed few days due to a
Parsing of Wide Characters String in C
I wanted to store arguments that passed to my program from the command line and then forward them to a function which it needs all strings to have
DeviceIoControl returning ERROR_ACCESS_DENIED
I'm trying to interface with a driver for creating tun interfaces (wintun), but in order to send and receive data from them i need to register a
DeleteFile api doesn't delete file until process terminated
I have implemented the following function in which it gets the path of a file and then tries to delete it from the file system. the
C++ mouse functions not responding, Trying to create a clicking simulator
#include <windows.h> #include <iostream> #include <conio.h> //void mouseretracer(point mousepos, int noofsaves, int
win32 without mouse, how to assign keyboard shortcuts to buttons
I wrote a simple win32 gui application with buttons and other controls, in pure c, no mfc. i want to make it more accessible for those who can not
Placeholder text in a Win32 Edit control
I am using the win32 api. i have this code that creates an edit control: createwindoww(l"edit", l"", ws_visible | ws_child, 100,
FindWindowA() returns 0 and when i check the error code with GetLastError() it's also 0 (ERROR_SUCCESS)
This is a segment out of a dll injection code i'm writing. i'm using findwindowa() to get a hwnd to the window procces defined in
How to get access to parent's object handles?
I have parentprocess.exe which has the following code. it creates a file and fils it with a simple character of 1 then it creates a new process
Disable keyboard but make my program still know when a key pressed
I want to write a program in c that disables the entire keyboard but continues to receive inputs in my program. i tried using
Ad
What is the correct way of sizing a control inside its own WindowProc function?
I want to adjust the size of a custom control and make it topmost when it is active and has at least one line. is it safe or even good coding to
How to take a screenshot with JNA in Windows?
I found a few code examples, but i don't know with which jna versions i can use which methods. i did only find snippets, where classes were
Ad
Blog Categories
Ad