Category : winapi

I want to add columns to the ListView menu. You could see what I tried below using ListView_InsertColumn, but I’m getting "identifier x is undefined". It should be in CommCtrl.h, but dunno what’s wrong. I’ve seen some people using CListView_InsertColumn instead. Not sure what the difference is. #include <Windows.h> #include "resource.h" #pragma comment(linker, ""/manifestdependency:type=’win32′ name=’Microsoft.Windows.Common-Controls’ ..

Read more

While using c++ UI automation client I am iterating over all the elements of the discord window. And I want to get DefualtAction, ToggleState, or State mute button… Here is code to iterate over all the elements… void discordListDescendants(IUIAutomationElement* pParent, std::string &zoomAudioGlobal, std::string &audioControlExist, std::string &zoomStatus) { std::string statusMute = "unknown"; IUIAutomationTreeWalker *pControlWalker = NULL; ..

Read more

When I attempt to close the dialog, I expect the application to close, but it doesn’t. I assume something is wrong with WM_CLOSE. The application is not resizable. How do I make it so? Do I really need UpdateWindow(hWnd)? #include <Windows.h> #include "resource.h" #pragma comment(linker, ""/manifestdependency:type=’win32′ name=’Microsoft.Windows.Common-Controls’ version=’6.0.0.0′ processorArchitecture=’*’ publicKeyToken=’6595b64144ccf1df’ language=’*’"") #pragma comment(linker, "/SUBSYSTEM:WINDOWS") INT_PTR ..

Read more

My single thread process(Windows) create a named pipe. But the child process’s stdout get buffered and i can not receive until flushed. I do not want to change the child process’s source code(like fflush or setbuf): #include<iostream> #include<cstdio> using namespace std; int main() { int a,b; while(true) { scanf("%d%d",&a,&b); printf("%d",a+b); } return 0; } How ..

Read more

Basically just want to open cmd with the createprocess function and redirect the input and output streams and then just write to the input stream and print the output stream to the console, but my code just doesn’t work lol. Every time I run it, it gets stuck at the ReadFile function with which I ..

Read more