winapi

Is there any way to draw Webbrowser content to a specific DC?

These days, I tries to create a hiden WebBrowser control in my program, and Using the IViewObject interface draw to my custom DC. The result is fine, I got All the content I want, but the Draw speed is unacceptable, especially some complex web pages which contains Flash objects, Each Draw to DC cost more than 100 ms. So the flash object...

How do I get the position of a control relative to the window's client rect?

I want to be able to write code like this: HWND hwnd = <the hwnd of a button in a window>; int positionX; int positionY; GetWindowPos(hwnd, &positionX, &positionY); SetWindowPos(hwnd, 0, positionX, positionY, 0, 0, SWP_NOZORDER | SWP_NOSIZE); And have it do nothing. However, I can't work out how to write a GetWindowPos() function that...

SendMessage(HWND_BROADCAST hangs

When i use SendMessage function with HWND_BROADCAST, the application hangs up. there is no response from the application for long time. Can anyone explain why? ...

Want to know how to write anything on file through program in win32 application

Hello! i am a beginner and want to file handling concept in win32 application for writing anything say text in file which is present in some location on hard disk. Please Reply Thanks in advance... ...

What is Alphablend? And what function is used for alphablend?

What is alphablend and what functions are used for alphablend? Please Reply Thanks in Advance ...

Is there a way to make iTunes automatically sync with Apple's device ?

I am finding a way if I can write a Win32 application to sync media files into iTunes library and then use this Win32 application to launch iTunes to sync the new library to the Apple device. Is there any COM or other libraries operate like that? ...

What is the best way to implement a GUI without a GUI designer?

Hello everyone, if someone doesn't want to use an IDE (just an editor, a compiler and a debugger) what is the best way to impelement a GUI by hand? I think about a WinAPI-Application in plain C or C++. ...

Is it safe to cast SOCKET to int under Win64?

I’m working on a Windows port of a POSIX C++ program. The problem is that standard POSIX functions like accept() or bind() expect an ‘int’ as the first parameter while its WinSock counterparts use ‘SOCKET’. When compiled for 32-bit everything is fine, because both are 32bit, but under Win64 SOCKET is 64 bit and int remains 32 bit and i...

AnimateWindow API in Vista MDI form doesn't work properly

We have an application written in VB.Net; there is a main window which hosts MDI child forms. When we are running the application on Windows Vista (in Win XP and 7 it works as it's supposed), we encounter a problem when closing MDI children forms. When we close the MDI window, its Closing event calls the WindowAnimate API to perform some...

Win32: How to custom draw an Edit control?

i need to implement the functionality of EM_SETCUEBANNER, where a text hint appears inside an Edit control: The catch is that i cannot use version 6 of the Common Controls, which is what is required to get the Microsoft supplied implementation of a cue banner. i've looked into simply changing the text of the edit control, and the fon...

How do I dynamically create controls with the same visual style as their parent?

I'm using Visual Studio 2005 (and win32 API in C++), and I have a window which was designed using the built-in dialog box editor. At runtime, I want to be able to use CreateWindow() to add new controls to it. This works, however the controls I create all look really ugly. For the purpose of concreteness, the control I'm adding is a TabC...

Win32 Messages program

Hi there, Few years ago when I was doing win32 programming, there was a program (from Microsoft I believe) that helps see all messages sent to winproc real time. I think it's a dialog box with all controls and depending of the actions you do, it display messages sent to that control. Does anyone know which program I am talking about? ...

GDI fails conversion to indexed color with exact palette?

Summary Using Windows GDI to convert 24-bit color to indexed color, it seems GDI chooses colors which are "close enough" even though there are exact matches in the supplied palette. Can anyone confirm this as a GDI issue or am I making a mistake somewhere? Maybe there's a "please check the whole palette for color matches" flag which I...

What is thread?How to create thread in win32 application?

What is thread? How to create thread in win32 application? ...

Add toolbar Dialogbox with Win32 API

Hi; I have a dialog box on which controls are added with resource editor. But I am trying to create a toolbar on the fly in WM_INITGDIALOG message but the toolbar is not visible. Is there something else to do make it visible(I dont think so but...). If this is not possible how can add a toolbar in resource editor. As you guessed I use ...

Tickcount and milliseconds in C++

HOw do I convert from TickCounts to Milliseconds? this is what I used: long int before = GetTickCount(); long int after = GetTickCount(); I want the difference of it in seconds. Thanks! ...

playing a list of audio files in sequence

I've been confronted to a situation. I'm writing a Windows app in C# .NET. I want to play multiple .wav files one after another and do that continuously. is there a class that could allow that ? otherwise, how would I implement it ? I tried using MCI and it works, using the notify flag and interception of the MM_MCINOTIFY message but i...

Mouse cursor replacement in Windows

Hi! Is it possible to replace default mouse cursor with some more complex animated object that has size bigger than 32x32? I know that I can use transparent window instead of cursor, but it doesn't look as good solution because cursor renders much more faster than window, therefore user could see movement delays. Thanks! ...

How files are copying at the low level?

Hi everybody, I have a small question: For example I'm using System.IO.File.Copy() method from .NET Framework. This method is a managed wrapper for CopyFile() function from WinAPI. But how CopyFile function works? It is interacts with HDD's firmware or maybe some other operations are performed through Assembler or maybe something other....

Get ID from MIDI devices in C++

Hi all I'm a musician and a programmer and would like to create my own program to make music. I'll start with a console application in C++ before I make a GUI. I'm quiet new to C/C++ and know how to make a basic console application and have read about the Win32 API. I was looking into MSDN for multimedia in Win32 applications and I fo...