winapi

Drawing on the Desktop Background (WIN32)

Is there any way to draw on the desktop background in WIN32 and also receive notifications when the desktop background is repainted? I tried this: desk = GetDesktopWindow(); dc = GetDC(desk); MoveToEx(dc,0,0,NULL); LineTo(dc,1680,1050); ReleaseDC(desk,dc); But it draws on the whole screen, even over windows that are on the screen. ...

Is KillTimer necessary?

Hi All! I use SetTimer API and I see a lot of code like this: case WM_DESTROY: // Destroy the timer. KillTimer(hwnd, IDT_TIMER); PostQuitMessage(0); break; Do I have to call KillTimer or the system will automatically free resources on the process exit? Does forgetting to call KillTimer lead to resource leaks? I u...

Does anybody know what means ShellHook message HSHELL_RUDEAPPACTIVATED?

I am writing application which establishes shell hooks to get shell events (I am using C# if it matters). I am using this example: http://msbob.spaces.live.com/blog/cns!DAFD19BC5D669D8F!132.entry Hook is working fine but I do not receive message on which I am interested: HSHELL_WINDOWACTIVATED (all other window-related events work well)...

How do I create a bitmap with an alpha channel on the fly using GDI?

I am using layered windows and drawing a rounded rectangle on the screen. However, I'd like to smooth out the jagged edges. I think that I'll need alpha blending for this. Is there a way I can do this with GDI? ...

Problem with WH_CALLWNDPROCRET

I am trying to catch messages from an application for which I have no source code. I install a Windows hook like this: hhk = SetWindowsHookEx(WH_CALLWNDPROCRET, HookProcSetTextRet, hinst, threadID); (The hhk variable is in shared data.) I don't understand some of the behavior, though, specifically: LRESULT CALLBACK HookProcSetTextRet...

How to use "GS:" in 64-bit Windows Assembly (eg, porting TLS code)

How can an user-space program configure "GS:" under 64-bit Windows (currently XP-64)? (By configure, set GS:0 at an arbitrary 64-bit linear address). I am trying to port a "JIT" environment to X86-64 that was originally developed for Win32. One unfortunate design aspect is that identical code needs to run on multiple user-space threa...

How do you turn on the microphone?

How would I go about turning the microphone on and open some kind of a live stream to listen to whats happening on my PC in another location? It's going to be a baby-monitor project. Any ideas on the way I should do this? I am only really after code to do the task. I can do the rest. I am learning Delphi so I should be okay. I would al...

Accessing a bitmap resource fails with error code 0x716

So I don't know why I keep getting this error. Here's the relevant code: //////////////////////// In resource.h /////////////////////////// //{{NO_DEPENDENCIES}} // Microsoft Visual C++ generated include file. // Used by Freestyle.rc // #define IDB_BITMAP1 101 // Next default values for new objects // #ifdef APSTUD...

How to send POST request to some website using winapi?

I'd like to send HTTP POST request to website and retrieve the resultant page using winapi. How can I do that? Thanks i advance. ...

Developing tools for Poser (Pro)

As a software engineer, I sometimes use Poser Pro to create artwork to insert in my applications. It's useful to provide visual reminders to the users of the applications. For example, an image of a man/woman when a person has provided a gender as additional feedback to the "select gender" combo box. Or a house when they need to enter an...

Using TAPI(telephony API) for getting Signal strength

Hi I Have wireless modem/usb datacard .And i am using TAPI for getting signal strength on that device.but i am always getting value 65535 means highest signal strength.but its varying.so how can i get the exact signal strength value according to that usb datacard. ...

Managed alternative to user32.dll FlashWindow

In a .Net application that flashes the title bar and the corresponding taskbar button for a window, to attract the users' attention, P/Invoke code something like this is used: [DllImport("user32.dll")] private static extern bool FlashWindow(IntPtr hwnd, bool bInvert); public static void FlashWindow(System.Windows.Forms.Form window) { ...

Win32: Monitoring for files being created or changed

1) How can I use FindFirstChangeNotification / FindNextChangeNotification + ReadDirectoryChanges to detect certain files being created or removed? 2) Is the FILE_NOTIFY_CHANGE_LAST_WRITE a reliable indicator of a file change? Application: I have an explicit list of files that may be located in different folders. Display contents depe...

Create a background process with system tray icon

I'm trying to make a Windows app that checks some things in the background, and inform the user via a systray icon. The app is made with Not managed C++ and there is no option to switch to .net or Java. If the user wants to stop the app, he will use the tray icon. The app can't be a Service because of the systray side and because it ...

WLAN API's for USB Data Card

Hi All, Can I use the native WIFI API's (WLAN) for quering about a USB Data card which i have connected to my PC? If yes, can i get a sample code? Thanks in Advance. Best Regards, Suren ...

How can I monitor status changes of windows services under windows xp?

I'm trying to write a program in C, that can detect when some Windows services (aka. NT services) are started or stopped. There seems to be a function NotifyServiceStatusChange, but that's only available on Vista and Windows 7. I'm trying to do this on Win XP, so what's the best way? Is there any other than continuous polling? edit: I...

Is there an equivalent of BitBlt in WPF?

Is there a way to invert a region of the screen using WPF? In Win32, I would do BitBlt ( .... DSTINVERT ...). Of course, I would use Interop but that seems pretty messy. ...

Accessing files beyond MAX_PATH in C#/.NET

BACKGROUND I need to write a tool using .NET version 2.0 at highest (using something off the shelf is not an option for this client for political, commercial, and confidentiality/trust reasons) to migrate files from one server to another over the network. The servers are file servers for local teams, and certain team folders need to be ...

GetPrivateProfileString() Gives Access Denied Error on Vista

A GetPrivateProfileString() call works fine on Windows XP but fails with an Access Denied error when run on Vista. The call is being made inside a thread spawned by a Windows service which I wrote. The Windows service itself is run using the credentials of a user account on the local machine (thought to be needed because the code requi...

Render a Win32 widget in the OpenGL context

Is it possible to intercept a control's paint event and make it draw in the opengl context? ...