winapi

Windows API to make Windows Vista and 7 semi-transparent screenshots

Windows Vista and Windows 7 display semi-transparent forms when Aero is activated. And some screen-taking applications such as WinSnap or Windows Clippings are able to capture those windows as a semi-transparent PNG image. What Windows API are they using to obtain such a beautiful capture ? ...

Getting out of memory exception when loading high resolution image with IImagingFactory

I am trying to load high resolution image(like 3264x2448). For that I am using IImageFactory class in C#. IImageFactory is downloaded from the Microsoft site. If I try to load the high resolution image I am getting “out of memory” exception. Have a look at the below sample: IImage GetIImage(string fileName) { Bitmap bitmap = null; Gra...

Selenium IDE focus event doesn't fire unless window is active

I added this code to my web page: <input id='argh' type='text' onfocus='this.value=7'> Unless the browser window is active, the focus event does not seem to fire (using the 'focus' command) from Selenium: # [info] Executing: |waitForElementPresent | argh | | # [info] Executing: |focus | argh | | # [info] Executing: |verifyValue | arg...

obtain x,y coords of individual Chars in a gdi widget

if i use textout("this text") with a particular font/style, i want to find out the (x,y) coords of 't' 'h' 'i' 's' chars. i cant use the printer route. how else can i obtain the individual x,y coords. ...

How can I communicate between two C++ MFC plugins?

I have a plugin for a c++ MFC app. I'm working with the developer of another plugin for the same app, that's trying to get notifications of events in my code. Both plugins are in the form of c++ dlls. How can I pass messages from my plugin to his plugin? The solution needs to be robust to mismatched versions of our two plugins, as we...

How to place 90X90 icon

Hi, i am creating .cab file installer for windows mobile application, problem is i need to keep the 90X90 .png image as icon for application. as per the link i tried to load the icon,step am following are 1) writing the icon path to registry 2) then loading the icon... i followed the step mentioned above link, but the problem is i...

Win32Api - Window Name Property

Is there any way to get a control's name through win32api? (c++) I'm talking about the property that in C# is 'Name', like 'frmMain', or 'btnNext'. Is there any way to retrieve this data through the win32API? I've tried GetWindowInfo() and stuff but I think I'm not heading in the right direction.. thanks edit: I'm iterating with Enu...

How to tell if a a mouse button has been released outside the window?

Usually, when a user holds the mouse pressed over a button, moves the mouse away from the window, and then releases it, the button can tell that the mouse has been released even though the release has actually occured outside the window. When I inspect mouse clicks in my window, how can I imitate the same behavior? When a mouse button ...

Set static text color Win32

I am making a dll that controls a dialogue box. I like to get a certain area to have red text. This code does compile, but the effect is not seen. Here is the area where the dialogProc is done: LRESULT CALLBACK DialogProc(HWND hDlg, UINT message, WPARAM wParam, LPARAM lParam) { switch(message) { case WM_INITDIALOG: ...

List Control SetFocus Redraw Error on a Tab Control

Environment: Visual Studio 2008, Visual Studio Feature Pack, MFC Dialog App, Windows XP, New Common Controls. I'm having a problem with a list control that happens to be on a tab control. To reproduce the problem simply create a dialog based app. Place a tab control on that dialog, then put a list control onto that tab control. You d...

What Perl module(s) do I use to obtain an absolute path (including filename) from a relative one on Windows?

I can only imagine I'm not searching correctly; this seems like an obvious question to be asked here. My apologies if this is a duplicate. I'm writing a Perl program that will take a filename as a command-line argument. I need to convert the filename (or the filename with a relative path attached) to an absolute path (specifically to wo...

How to access window class extra memory without a window handle?

I need to register a window class, and right after that set some data in it's extra memory section (the one cbClsExtra refers to) before any window of the class is being created. The problem is that SetClassLong expects a HWND in order to identify the class, instead of the class's name or atom. What's the way to acheive this? ...

Split large file without copy?

Question: Are there Windows API calls (perhaps NTFS only) which allows one to split a very large file into many others without actually copying any data (in other words, specify the logical breakpoints between joined files, with file names and sizes)? Examples: SetFileValidData, NtSetInformationFile Scenario: I need to programatically...

Detecting the Loopback Adapter

What is the best way for detecting whether a network interface is a loopback adapter? The windows API's GetAdaptersInfo and GetAdaptersAddresses state in the documentation that they will return whether an interface is a loopback through the Type (MIB_IF_TYPE_LOOPBACK) but neither of these do for the Microsoft Loopback Adapter at least, ...

VC++ win32 API programming :how can i get the image out of the clipboard and display it in a winodws?

hi there ,i m new here . stackoverflow is a good place to help others and being helped. so i post my problem here.i'va asked quite a few people and find no answers. thanks Use SelectObject() on your memory DC to select the bitmap into it.This makes me puzzled. i read the msdn but still don't konw how to fill the second parameter of Se...

How can I take a screen shot and display it in VC++?

I want to make a screen shot and display it in the window of my program, but so far I have only been able to make the screen white. What am I doing wrong? Code: #include <windows.h> LRESULT CALLBACK WndProc (HWND, UINT, WPARAM, LPARAM) ; int WINAPI WinMain (HINSTANCE hInstance, HINSTANCE hPrevInstance, PSTR szCm...

Explicit Linking DLL and Program Hangs

Hello, I've the following piece of code in my program which dynamically links wtsapi32.dll file for session notifications like WTS_SESSION_LOCK and WTS_SESSION_UNLOCK and runs in background. After the first lock/unlock the program hangs and not responding. Is this a right way of doing explicit linking ? void RegisterSession(HWND...

How can I make my program do a true full screen view in VC++?

How can I make a true full screen mode in VC++? Code: #include <windows.h> LRESULT CALLBACK WndProc (HWND, UINT, WPARAM, LPARAM) ; int WINAPI WinMain (HINSTANCE hInstance, HINSTANCE hPrevInstance, PSTR szCmdLine, int iCmdShow) { static TCHAR szAppName[] = TEXT ("screen") ; HWND hwnd ; MSG ...

Set location of MessageBox?

I want to print out a message using MessageBox (or similar). I would also like control over where exactly on the screen the box appears but can find nothing in the description of MessageBox that allows you control over the location. Did I miss something? If MessageBox can not be used, then is there an alternative? For reasons too comple...

How do I recursively create a folder in Win32?

I'm trying to create a function that takes the name of a directory (C:\foo\bar, or ..\foo\bar\..\baz, or \\someserver\foo\bar), and creates directories as necessary so that the whole path is created. I am attempting a pretty naive implementation of this myself and it seems to be a string processing nightmare. There is / vs \, there is ...