winapi

Fullscreen management with WinAPI.

How to well use the WinAPI to manage the fullscreen mode on windows's window ? Here is my problem : I have an application which has to be fullscreen. I use ChangeDisplaySettings() function (winuser.h) with the CDS_FULLSCREEN value to put my window to fullscreen mode when receiving a WM_ACTIVATE with (wParam == WA_ACTIVE || wParam == WA...

Get current open filename from Windows Process using C#

Hi All, Is there a way to find the currently open file from an Excel or Word process? For example, i want to get all the list of running processes in windows and which files they currently have open. Thanks in advance! ...

Possible channels of communication between Javascript on HTML page and a windows EXE ?

Hi all Here's the thing. A two-way communication (RPC-style) is needed between Javascript on HTML pages provided by a web server online (with session-management and whatnot) and a windows EXE application running on the PC of the website visitor. Both are parts of the same 'package' and should be able to communicate. There is the us...

Android create avd size on windows command prompt

Hi guys I'm starting with Android development and I have no idea what's wrong on the this command line: C:\Documents and Settings\Gabriel.Esquivel.android\avd>android create avd -n Ev o4G -t 9 -c 8000MB -s 480-800 Valid skins: WVGA854, WQVGA400, HVGA (default), WQVGA432, WVGA800, QVGA Error: '480-800' is not a valid skin name or size ...

WaitForSingleObject not work

Please see the code below: #include <windows.h> int main(int argc, char* argv[]) { HANDLE _mutex = ::CreateMutex(NULL, FALSE, "abc"); if (!_mutex) throw std::runtime_error("CreateMutex failed"); if (::WaitForSingleObject(_mutex, INFINITE) != WAIT_OBJECT_0) throw std::runtime_error("WaitForSingleObject failed...

doing pInvoke and can't get the right hDC

So I'm trying to get the right Device Context so I can set the gamma ramp on individual monitors in an N monitor configuration (2+). I've tried [DllImport("gdi32.dll")] static extern IntPtr CreateDC(string lpszDriver, string lpszDevice, string lpszOutput, IntPtr lpInitData); With this method I'm using the string "DISPLAY" for lpszDr...

Program/algorithm that creates a .PRN file of any file format for a specific printer! Please help!

I need an algorithm that converts any file format to its .PRN file equivalent which will be compatible for a specific printer (for example, only in CANON printers). Or I need a source code or way to know how printer drivers work. Printer drivers are the one who specifies or creates the .PRN file of any type. So please help me. Thanks! ...

c++ set a cursor using SetCursor

ok im setting a cursor in a loop it works but when i move the cursor it just changes back to the way it was. im using win32 api and i used SetCursor(LoadCursor(hInstance, MAKEINTRESOURCE(IDC_PROTECTED))); any idea ...

wmain vs main C runtime

Hi, I have read few articles about different Windows C entry pooints, wmain and WinMain. So, if I am correct, these are added to C language compilers for Windows OS. But, how are implemented? For example, wmain gets Unicode as argv[], but its Os that sends these arguments to program, so is there any special field in the .exe file entry...

Why did Microsoft choose stdcall as their API convention?

Is there a good reason? Are their internal functions (not exported) also stdcall convention? ...

Windows non-mfc open source projects

Hi, Where can i find those and learn about a modern way to start off a project from scratch or any other recommended book? ...

How does Windows Explorer extract EXE file's icon.

It's my guess. We list a files and directory by Windows Explorer. If Windows Explorer meets a exe file, it does, LoadLibraryEx(ExefileName, LOAD_LIBRARY_AS_DATAFILE) Then extracts the icon, and represents it. But I'm not sure. Is there anyone who knows well about this? I'm finding a nice case with LOAD_LIBRARY_AS_DATAFILE Is th...

How to detect win32 process creation/termination in c++

Hi, I know that to receive notifications about win32 process creation or termination we might implement a NT kernel-mode driver using the APIs PsSetCreateProcessNotifyRoutine() that offers the ability to register system-wide callback function which is called by OS each time when a new process starts, exits or is terminated. My question...

[WinAPI] Is there any way to have ASYNC MessageBox?

Or do I have to use threads? (C++) ...

What is the biggest size / number of documents of index - java lucene 3.0.2 on 32 bit OS

Hi, I am playing around with lucene and 40GB of data (~500M of tuples, 2 fields behaving like key - value). I have created -- a suprise -- a 35 GB index which does not work. Therefore I want to create a set of smaller indicies but, for that, I need information about maximum size. ...

IPC bottleneck?

I have two processes, a producer and a consumer. IPC is done with OpenFileMapping/MapViewOfFile on Win32. The producer receives video from another source, which it then passes over to the consumer and synchronization is done through two events. For the producer: Receive frame Copy to shared memory using CopyMemory Trigger DataProduced...

How do I measure time in C?

I want to find out for how long (approximately) some block of code executes. Something like this: startStopwatch(); // do some calculations stopStopwatch(); printf("%lf", timeMesuredInSeconds); How? ...

MessageBoxA (Windows API) loses focus

Hello, I am implemeting a plugin for Winamp. I have a MessageBox when the plugin starts which asks the user for a certain task. However, the problem is that this MessageBox goes in the background as Winamp starts. I would like this MessageBox to have focus - or wait for an answer. The relevant code: int answer(MessageBoxA( plugin....

What could cause "The MDL is being inserted twice on the same process list"?

We are developing an NDIS protocol and miniport driver. When the driver is in-use and the system hibernates we get a bug check (blue screen) with the following error: LOCKED_PAGES_TRACKER_CORRUPTION (d9) Arguments: Arg1: 00000001, The MDL is being inserted twice on the same process list. Arg2: 875da420, Address of internal lock trackin...

Is it OK to call pthread_exit from main?

When I call pthread_exit from main, the program never gets to terminate. I expected the program to finish, since I was exiting the program's only thread, but it doesn't work. It seems hung. #include <stdio.h> #include <stdlib.h> #include <pthread.h> int main(int argc, char *argv[]) { printf("-one-\n"); pthread_exit(NULL); ...