winapi

GDI Image::Save returns Win32Error

Hi I am using GDI Image::Save Method to save the images to the file in my Application. I am getting Win32Error (7) status error in few instances with Vista 64 bit. It is working fine with vista 32 bits. and also this problem is coming randomly . Can you please suggest how to solve the problem Thanks in advance Regards Subbi Reddy...

Getting a file path relative to a particular directory

Is there a nice way in the WinAPI to get a path relative to another path? For example: Have a list of paths relative to: a\b\c\d And I'd like to change them all to paths relative to a\b\c Is there a neat way to do this or should I get path parsing? ...

How do I enumerate network adapters and get their MAC addresses in Win32 API C++ ?

As the title says, I've been trying to achieve that for the better part of the day. Any help would be apreciated. ...

C/C++ memory usage API in Linux/Windows

I'd like to obtain memory usage information for both per process and system wide. In Windows, it's pretty easy. GetProcessMemoryInfo and GlobalMemoryStatusEx do these jobs greatly and very easily. For example, GetProcessMemoryInfo gives "PeakWorkingSetSize" of the given process. GlobalMemoryStatusEx returns system wide available memory. ...

What should I use to replace gettimeofday() on Windows?

I'm writing a portable Socket class that supports timeouts for both sending and receiving... To implement these timeouts I'm using select().... But, I sometimes need to know how long I was blocked inside select() which of course on Linux I would implement by calling gettimeofday() before and after I call select() and then using timersub(...

How can I tell that a directory is the Recycling bin in VB6?

I am attempting to port the code in this article to VB6, but I'm experiencing crashing. I'm pretty sure my error is in my call to SHBindToParent (MSDN entry) since SHParseDisplayName is returning 0 (S_OK) and ppidl is being set. I admit my mechanism of setting the riid (I used an equivalent type, a UUID) is pretty ugly, but I think it ...

HTML parser to parse images and hyper link in C# or in C++

Possible Duplicate: Library Recommendation: C++ HTML Parser Hi all... Can any provide me a sample link which can parse all the images and .css files assosiated with web page... i know the logic.. but i m failing in one or the other possibilities... i am not getting any documentation that how web-browser download the entire webp...

How to do a getPixel() in Ruby on Win32?

How can you do a getPixel() in Ruby on Win32? It is either to get a pixel in a window or on the screen (dc == null). ...

How to capture a part of a screen using Ruby on Windows?

Instead of using some third party app, I'd like to write an app in Ruby that when invoked, will capture the full screen and save it in c:\screenshot\snap000001.png The graphic package is readily there, but how can you capture a region from the full screen so as to save it? This program is to be invoked by some hot-key, such as settin...

DllMain and Qt Mfc Migration

Hello I am using the Mfc to Qt migration solution, to migrate my Mfc plugin to Qt. My Mfc plugin is loaded in third party Mfc app. Basically I am using the following example Qt based Application Extension : BOOL WINAPI DllMain( HINSTANCE hInstance, DWORD dwReason, LPVOID ) { static bool ownApplication = FALSE; if ( dwReason == DLL_P...

How Google desktop search is opening files in foreground?

Hi, I want to build similar experience as google desktop search is giving while opening the file. Suppose the user is searching for a particular file and he clicks on it in the browser, google desktop is opening it in foreground, i tried to do this in my app but it some times opens in background. I used ShellExecuteEx and then AllowSe...

Loading an assembly from a win32 application without having .NET framework installed

I know it's possible to run a .NET application using a portable Mono executable without having .NET framework installed but is it possible to load and use an assembly is this situation? thanks in advance. ...

Waiting for grandchild processes in windows

Is it possible to wait for all processes launched by a child process in Windows? I can't modify the child or grandchild processes. Specifically, here's what I want to do. My process launches uninstallA.exe. The process uninistallA.exe launches uninstallB.exe and immediately exits, and uninstallB.exe runs for a while. I'd like to wai...

How does Windows switch to supervisor mode during a system call?

How does Windows switch to supervisor mode during a system call? I heard something about a "trap 0", but that doesn't even seem like an x86 instruction. I stepped through some system calls, but I can't find any. Do a lot of Windows system calls run in user mode? Which DO run in supervisor mode? ...

How to know the internet connection details using Visual C++ Win32 API

I have to create a log file for all internet connection made by PC. It should have details of the username, time of connection, etc. I do know about the InternetGetConnectedState() function which returns the bool value. Know how do I get the other details. Can some one help me out thanks in advance. I am using win32 API and visual c++. ...

Question about file seeking position..

My previous Question is about raw data reading and writing, but a new problem arised, it seems there is no ending.... The question is: the parameters of the functions like lseek() or fseek() are all 4 bytes. If i want to move a span over 4G, that is imposible. I know in Win32, there is a function SetPointer(...,Hign, Low,....), this po...

taskbar window behavior for my own window

Windows Taskbar has a significant behavior. It is attached to a bottom (top, left, ...) of your desktop so that it occupies this area and prevents other windows from overlapping it. When some window is not maximized it goes below the Taskbar as if Taskbar is topmost. (*)When some window is maximized it fills the area that is not occupie...

Win32 newbie: Firefox-like find bar

Firefox has this nice find-a-text-on-the-page dialog, which is non-modal and shows up at the bottom of the window. How to do something similar using just Win32? I guess there has to edit control but do I have to position it manually on parent window WM_SIZE? How do I dismiss the dialog, i.e. how to make it disappear? ...

Is it possible to set the DPI of an application programatically?

Is it possible to set the DPI of an application programmatically or the DPI only possible to set through the system preference? Note: My application's GUI is coded in MFC and .NET forms. Update: After some research I have found no way of doing this so I have to agree with the only answer here; it cannot be done. ...

Creating a thread in DllMain?

It seems that when a thread is created from within DllMain upon DLL_PROCESS_ATTACH it won't begin until all dll's have been loaded. Since I need to make sure the thread runs before I continue, I get a deadlock. Is there any way to force the thread to start? ...