winapi

Set volume using SDK functions causes one channel to be inactive.

Here is my problem: I made a simple mixer class for my own purposes, here it goes: struct Volume { DWORD left; DWORD right; }; CMixer::CMixer () { m_hMixer = 0; m_value = 0; } CMixer::~CMixer(void) { delete [] m_value; if (m_hMixer) mixerClose (m_hMixer); } bool CMixer::Init( UINT type /*= MAIN*/) { // ge...

JW Player - How can I add an event listener for fullscreen toggling?

I'm using JW Player 4.5 on my site and I need to add an event listener for when fullscreen is toggled. The reason for this is to switch between a low-def version and high-def version. The default video will be the low-def version and when they switch to a fullscreen display, it will change to the high-def version. According to http://d...

How to create a window with DropDownShadow like Sticky Notes in Win 7?

Hello, How can I create a Win32 window like Sticky Note in Windows 7 which has no border but has drop down shadow effect? I have tried to create a Win32 window without borders (remove ~WS_BORDER), but the drop down effect shadow is gone. Any idea? Best regards, Zach@Shine ...

Have to find if some window name has some string on it with python

First of all, I get the name of the current window win32gui.GetWindowText(win32gui.GetForegroundWindow()) k, no problem with that... But now, how can I make an if with the result for having an specific string on it... For example, the result gave me C:/Python26/ How can I make an True of False for the result containing the word,...

Windows API Textfield with offset characters

Hi there! Is it possible using the Windows API, to create a textfield that lets me offset characters by exact pixels? if so - how? for example, I would like to place two O letters on top of each other, such that they form something like an 8 ? context is an application for a language where most of the glyphs are written left to right,...

How to pass a method as callback to a Windows API call?

Hi, I'd like to pass a method of a class as callback to a WinAPI function. Is this possible and if yes, how? Example case for setting a timer: TMyClass = class public procedure TimerProc(Wnd:HWND; uMsg:DWORD; idEvent:PDWORD; dwTime:DWORD); procedure DoIt; end; [...] procedure TMyClass.DoIt; begin SetTimer(0, 0, 8, @TimerProc); ...

How to get information about a Windows executable (.exe) using C++

Hi, I have to create a software that will scan several directories and extracts information about the executables found. I need to do two things: Determine if a given file is an executable (.exe, .dll, and so on) - Checking the extension is probably not good enough. Get the information about this executable (the company name, the pro...

Clipping the caret in a C# program

I'm creating a WinForms control in C# (using VS2008, .net 3.5) which allows text input. I've imported the necessary Win32 API functions from User32.dll for displaying the normal Windows caret and these are all working fine, but it's not displaying exactly how I'd like it. Text is displayed on the control with a blank border and I use Gr...

Shall I bother with QT?

Guys I study C++ for a second year. Till now I was doing only console app but I think it's a time to start programming in Windows. There are few alternatives and Qt is one of them but I'm also drawn towards pure Windows API - for more power of course. What would you suggest? ...

How can I determine which taskbar application/windows are requesting user attention

I'd like to know how to get a list of the windows requiring user attention from the Windows taskbar. Windows requiring attention appear with a flashing orange color within the Windows taskbar. Un-focused MSN Messenger conversation windows are a good example of this behavior: they turn orange as soon as a remote user sends an instance m...

How to get smartcard reader name in Windows 7 using C# or C/C++?

Hi! I'm trying to make a C# program which will use a C .dll (unfortunately, the .dll doesn't have good documentation) to access a smart card. One of the functions of the .dll uses name of the reader as argument. My problem is that I don't know how to get the name. After looking for answers I found something similar to what I need in an...

Communication with HyperTerminal [ QT and WINApi ]

Hi! I write program to communicate with modem (it useing Hayes commands) and this is working. GUI is programmed with QT, but communication with COM port is write with winapi library. I have problem when I want to send with my program message from one computer to another, i can't send Polish chars (they are repleaced by '?'), how can I fi...

Win32 Thread Exits Unexpectedly

Hello, I'm writing a C++ application. I realized that one of my worker threads may terminate unexpectedly. The (VS 2005) debug log says: The thread 'Win32 Thread' (0x5d98) has exited with code -858993460 (0xcccccccc). I surrounded all the worker thread code with a try/catch block. So, if the reason was an exception, I would cat...

GDI+ not clearing my window on repaint for vista

on WM_PAINT i do the following: //RectF mNameRect; //WCHAR* mName; //HWND mWin; // this is the window handle { PAINTSTRUCT ps; HDC hdc = BeginPaint(mWin, &ps); Graphics g(hdc); g.Clear(Color::White); StringFormat stringForm; stringForm.SetLineAlignment(StringAlignmentCenter); stringForm.SetAlignment(StringAlignmentCenter); // set the...

capture the last WM_SIZE

When I resize my window I want to tell another part of my program that my window has changed size. I read on MSDN that: WM SIZE Message The WM SIZE message is sent to a window after its size has changed. However, I receive the WM_SIZE even when dragging. I noticed that there is also a WM_SIZING message that is sent when my window is re...

What books are available in market for learning the Windows API for GUI development with C++?

Please give me some titles, preferably not free books. I don't need it to be free; it would be better if published by McGraw Hill, Prentice-Hall, Springer, or any other good publisher. Note that I'm interested here in programming with C++ only. ...

What methods are available in the WinAPI for accessing programs in the system tray?

What DLLs would have functions for accessing things in the System Tray? Do I even need the winapi, or are there classes already available in the Class Library for this? I'm hoping to find a way to emulate all the functionality of the system tray, i.e. the icons, the mouseover text, and the capability to display the context menu. ...

hidden forms and thr handles

i am hiding the form using SetVisibleCore to false, but now i cant get the handle of this form in other application which i am retrieving using EnumWindow its giving me exception "Attempted to read or write protected memory. This is often an indication that other memory is corrupt." an ACCESS VIOLATION EXCEPTION. so i am searching on 2 ...

what size of buffer is the best for uploading file to internet

I'm using HTTP API provided by MS to upload video to YouTube, I noticed the total elapsed time is different with different buffer size, what size of buffer is the best for uploading file to internet? Thanks in advance. ...

How to detect when my app window is activated explicitly by the user

Hi, I need to know when my application is activated explicitly by the user, i.e., my application lets users open office documents, when they do that the office window becomes active and my application's window becomes deactivate. What I need to know is when the user re-activates my application's window either by Alt+Tab or through the t...