winapi

win32 application aren't so object oriented and why there are so many pointers?

This might be a dumb question to some of you and maybe I asked this question wrong, because I am new to c++. But I notice when working in a lot of win32 applications, you use a lot of resources that are pointers. Why do you have to always acquire a objects pointer ? why not initiate a new instance of the class. and speaking of that, I no...

How to enumerate system restore points using WinAPI (not WMI)?

Must work for WinXp - Vista - Windows 7 ...

CredWrite returns Win32 error code 2 (ERROR_INVALID_FUNCTION) "Incorrect function."

i'm trying to call CredWrite, but it is returning ERROR_INVALID_FUNCTION. i can call CredRead to fetch credentials out of the password store, and i can store new credentials by using CredUIPromptForCredentials. But i cannot figure out how to get CredWrite to work. The code i'm using is: var Target, Username, Password: WideString; b...

Why doesn't scanf work when using the Win32 ConsoleInput function?

Hi! This is the example code, I'm using these functions for a program, but scanf doesn't work well: It doesn't display my input and accepts the input only after the enter key is pressed twice. this is the code: #include <stdio.h> #include <windows.h> char c[25]; void KeyEventProc(KEY_EVENT_RECORD); void KeyEventProc(KEY_EVENT_RECORD k...

GetPrivateProfileString in .NET

Is there a .NET version of GetPrivateProfileString? (I can use p/invoke, I just don't want to unless necessary.) ...

Error while transforming .py to .exe...

When I try to transform my script in an executable, I get this error after it's done: Traceback (most recent call last): File "shd-WinResize.py", line 4, in <module> File "zipextimporter.pyo", line 98, in load_module ImportError: MemoryLoadLibrary failed loading win32api.pyd I'm using this script to convert: from distutils.core i...

What does the Win32 CRITICAL_SECTION contain?

What data does the Win32 CRITICAL_SECTION contain, and how big is it? This is undocumented and presumably implementation specific, but I'm curious to know ...

Validate HWND using Win32 API

From the native Win32 API using C++ is there a way to determine whether the window associated with an HWND is still valid? ...

Who's the Raymond Chen of .NET?

Possible Duplicate: Which C#/.NET blogs do you read? I've found reading The Old New Thing to be an incredible learning experience (multithreading, COM, asking myself "What would Raymond do?", don't use the desktop window for anything modal, this behavior in Windows seems stupid, but here's why). I've just discovered Larry Oste...

Breaking down WinMain's cmdLine in old style main()'s arguments

I want to convert WinMain's cmdLine argument to argc and argv so I can use the argument parsing function I wrote for console applications. This would be trivial except that I want to support "quotes" too. For example: test.exe test1 test2 "testing testing" should be argv[0] = "test.exe"; argv[1] = "test1"; argv[2] = "test2"; argv[3] ...

Placing a image inside an CEdit control in Win32

I'm trying to achieve an effect where there's a visible logo inside an edit control and the logo becomes hidden when the user places the focus on the edit control. What's the best way to approach this? Would it be better to place an image control on top of the edit control or paint the background of the edit control transparent and pos...

Keeping encrypted data in memory

I'm working with a listview control which saves the data using AES encryption to a file. I need to keep the data of every item in listview in std::list class of std::string. should I just keep the data encrypted in std::list and decrypt to a local variable when its needed? or is it enough to keep it encrypted in file only? ...

WINAPI main function

hi guys, could you please explain to me the WINAPI word in winmain header ? in the simpliest way.. #include <windows.h> int -->WINAPI<-- WinMain(HINSTANCE hInstance, HINSTANCE hPrevInstance, LPSTR lpCmdLine, int nCmdShow) { MessageBox(NULL, "Goodbye, cruel world!", "Note", MB_OK); return 0; } is it just some windows f...

Blocking WM_QUIT

Quick question. I have an app that use a native DLL through PInvoke, this DLL may call a PostQuitMessage(). How can I avoid it? (as my app should not close) I tried AddMessageFilter, but it doesn't trigger the WM_QUIT. ...

How to create a radio button and see if it's checked?

How to create a radio button and see if it's checked? Windows Vista Dev-C++ Win32 API WM styles ...

Avoid P/Invoke errors at startup time.

It seems that calling a P-Invoke while the App is not completed loaded make it spew the errors of the related functions. For example at the moment I'm trying to load at startup various DLL through LoadLibrary and test if they have exported a particular function. If I do that while the app completed its load procedure no error are give...

Recommendations for cross-platform C/C++ JSON library ?

I'm looking for recommendations for a reliable and functional cross-platform JSON library that can be called from either C or C++ and which can be used with Linux, Mac OS X and WIN32. Ideally it should support both generating JSON output as well as parsing JSON input. I've looked at a lot of the open source options but it's hard to tell...

C++: Any way to 'jail function'?

Well, it's a kind of a web server. I load .dll(.a) files and use them as program modules. I recursively go through directories and put '_main' functors from these libraries into std::map under name, which is membered in special '.m' files. The main directory has few directories for each host. The problem is that I need to prevent usa...

How to intercept the access to a file in a .NET Program

I need to intercept when the system tries to access to a file, and do something before it happens. ...

Automate Windows GUI operations with Python

I want to make a Python script that automates the process of setting up a VPN server in Windows XP, but the only way I know how to do it is using the Windows GUI dialogs. How would I go about figuring out what those dialogs are doing to the system and designing a Python script to automate it? ...