winapi

What is best couple for developing small and fast GUI application with some graphical editor features - C++ and (VB or Win32)?

It has to make some time consuming calculations, so i need it to work as fast as possible. Also thought about Delphi. So. Is it a question of taste(or habit) or not and what can you advice me then? ...

Find which MDI child just got focus Win32 API

Hi all, I have a program that has a MDI host and I would like to be able to get which of it children just got focus, bassiclly I would like to make a window focus changed event for this application. The application is a 3rd party and I don't have the source, I have the window handle to the main program and the MDI host part. I know...

C++ NetUserAdd() not working?

I posted earlier about how to do this, and got some great replies, and have managed to get the code written based off the MSDN example. However, it does not seem to be working properly. Its printing out the ERROR_ACCESS_DENIED message, but im not sure why as I am running it as a full admin. I was initially trying to create a USER_PRIV_AD...

NetUserAdd() to Remote Desktop Group?

Is there anyway to give a newly created user from NetUserAdd() remote desktop access and/or administrative rights? I know it is possible, at least for Remote Desktop, and I have been reading through the MSDN but nothing seems to hint at what is required to be set for it to work. ...

Help Using NetuserAdd() and NetLocalGroupAddMembers() in C++

So I think I almost got it. I create my dummy account with one function, and wrote a second function to add it to the Remote Desktop group. Problem is, the Administrator account is the one logged in, so I am not sure how to specify what account to add to the group. Here is my code... The user is being created properly... void AddRDPUs...

Why does my simple C++ GUI application show a message box in Chinese?

Oh as for the whole (LPCWSTR) casting thing: It wouldn't compile unless I put those in. It game me this error message: Error 1 error C2664: 'MessageBoxW' : cannot convert parameter 2 from 'const char [22]' to 'LPCWSTR' ...

Dangers of Windows API and Administrator accounts?

I wrote a game server plugin last night that allowed me to create a user account and set it as administrator, which is a huge problem. Of course the simple fix is to create a basic user account with limited privileges for the game servers, so they would not have access to do things like this. I wanted to find out if there's anything els...

How to create a virtual file ?

I'd like to simulate a file without writing it on disk. I have a file at the end of my executable and I would like to give its path to a dll. Of course since it doesn't have a real path, I have to fake it. I first tried using named pipes under Windows to do it. That would allow for a path like \\.\pipe\mymemoryfile but I can't make it w...

How can we detect hotkeys registered by other apps?

Is it possible to detect all the hotkeys registered by the OS as well as software applications currently running? Any native or managed approach on the Windows platform? I know that the RegisterHotKey function returns false if the hotkey is already registered, but what I am looking for is an approach, method, etc. that will give me a lis...

What does APIENTRY do?

I encountered it first time and found no dedicated page on msdn. What does APIENTRY mean? ...

PE Header Requirements

What are the requirements of a PE file (PE/COFF)? What fields should be set, which value, at a bare minimum for enabling it to "run" on Windows (i.e. executing "ret" instruction and then close, without error). The library I am building first is the linker: Now, the problem I have is the PE file (PE/COFF). I don't know what is "required"...

Has anyone been able to create a hybrid of PE COFF and ELF?

I mean could a single binary file run in both Win32 and Linux i386 ? ...

WIN32 Audio Sample Rate Conversion

Under WIN32, One may use the acmStreamConvert function as an audio sample rate converter (for example, converting 44.1kHz to 48kHz audio stream). According to Secret Rabbit Code documentation, the quality of a sample rate converter is measured by it's Signal-to-Noise Ratio and Bandwidth. Secret Rabbit Code claim "signal-to-noise ratio...

How to get the length of data to be read (reliably) in named pipes?

I have created a named pipe with following flags: PIPE_ACCESS_DUPLEX - both side read/write access PIPE_TYPE_MESSAGE - Message type read PIPE_WAIT - blocking read\write From the server side I am calling ConnectNamedPipe and waiting for the clients to connect. From the client side I am calling CallNamedPipe to connect to server and w...

WIN API User Privilege C++

Hi, I'm trying to see if the user has the SeLoadDriver privilege. I've got the PLUID : PLUID pld; LookupPrivilegeValue(NULL, SE_LOAD_DRIVER_NAME, pld); But now i'm not sure how to get a bool from the PLUID stating that the user has, or not, the privilege. I've read the related methods but it think that it might be an easy way...

How to simulate mousemove event from one window to another?

Hello, I am trying to Create an empty window, which process the WM_MOUSEMOVE message in WinProc: case WM_MOUSEMOVE: { HWND otherHwnd = HWND(0x000608FC); POINT pt = {LOWORD(lParam), HIWORD(lParam)}; ClientToScreen(otherHwnd, &pt); PostMessage(otherHwnd, WM_TIMER, WPARAM(4096), 0); PostMessage(...

Manually drawing gradients for buttons, toolbars, tabs etc?

I would like to update some toolbar-like code we have to have a Vista/Win7 gradient roundedness to them. Currently, the buttons have the Windows 2000 look & feel: blocky, single-tone. I've played around with the XP themes, and using DrawThemeBackground, DrawThemeEdge, etc.; but I'm very dissatisfied with the theme drawing mechanics (th...

What are the values in intel x86 CPU stack before running (on Windows)?

I have been debugging some .exe and noticied that before I start debugging step by step, at the very beginning of the program, there are already some values loaded in the stack? What are these? I am using OllyDbg and some of the "labels" for these values are: return to kernel32.7C8... ntdll.7C9... End of SEH chain SE handler Than...

Does DeferWindowPos work well with the VCL?

I'm considering to increase my usage of DeferWindowPos. Up to now I used it in some simple circumstances and didn't notice any problems. Do you know of any pitfalls, where e.g. the FLeft/FTop/... fields aren't updated correctly or similar things? ...

Number of physical monitors attached to a Windows machine?

I am trying to count the number of monitors attached to a machine ( not virtual displays, so two monitors running with clone would have one virtual display but two physical monitors ). I am currently counting the active monitors listed under the device manager. This works fine in Windows Vista and 7, but it seems that in Windows XP, th...