winapi

perl win32::gui remove elements

I have a dialogbox, to which i populate elements(labels) on activate event. I want to remove these elements(labels) when the window is being deactivated. something like:[its erroneous fragment of main code but explanatory] my $wchRW = Win32::GUI::DialogBox->new( -name => "wchR", -title => "whed", -left => CW_USEDEFAULT, -size ...

On Windows, how do we convert a virtual key code to the shifted character?

I looked at MapVirtualKey() and ToAscii(). MapVirtualKey() gives me only the unshifted character. ToAscii() only works for vk codes that translate to ASCII values. I need to detect for example, "Ctrl + Shift + 3" as Ctrl active, Shift active and '#'. Any clues? ...

ZeroMemory on PROCESSENTRY32 local variable?

Hi, I needed to enumerate running processes and wondered for a while why my code wasn't working: PROCESSENTRY32 ProcEntry; ZeroMemory (&ProcEntry, sizeof (PROCESSENTRY32)); //problem ProcEntry.dwFlags = sizeof(PROCESSENTRY32); HANDLE Snapshot = CreateToolhelp32Snapshot(TH32CS_SNAPPROCESS, NULL); if (Snapshot == INVALID_HANDLE_VALUE) ...

timers in win32, c++

Hi, I have a timer class which uses CreateTimerQueueTimer and DeleteTimerQueueTimer. I receive callbacks to the class objects as expected. How do i make sure the timer does not fire when the app is busy drawing the UI or doing some intensive renders etc ?? I am not concerned about high resolution, just that it has to fire when app is id...

Grab server (SSL) certificate using WIn32 API

I'm relatively new to Win32 programming & I was wondering if there is any thing similar to openssl's s_client; for e.g "openssl s_client -showcerts -connect". Bottom line, I want to grab the server certificate using Win32 API directly. Is that possible? ...

does winmm.dll support volume control with each sound

functions defintion winmm.dll : BOOL PlaySound( LPCTSTR pszSound, HMODULE hmod, DWORD fdwSound ); MMRESULT auxSetVolume( UINT uDeviceID, DWORD dwVolume ); the auxSetVolume use a uDeviceID Flag to Control the Volume, but there is no DeviceID need with the PlaySound function. does it mean auxSetVolume will control the gl...

Using C# managed structures/classes with Windows API

I'm sick of using Marshal.Copy, Marshal.Read* and Marshal.Write* so I was wondering if there's a way to force casting of an unmanaged memory pointer (of type IntPtr). Something like this: IntPtr pointer = Marshal.AllocateHGlobal(sizeof(Foo)); Foo bar = (Foo)pointer; bar.fooBar = someValue; // call some API Marshal.FreeHGlobal(pointer);...

Why SetMenuInfo doesn't work under Windows 7?

When I use SetMenuInfo to change background color of MenuBar it works under Windows XP,but doesn't work under Windows 7.What is the reason?How can I solve the problem? Thanks. ...

FTP:FTPGetFile Error 87 : The Parameter is incorrect

hi , I have implemented FTP, for downloading i am using FTPGetFile but is throwing error "Error 87 : The Parameter is incorrect" My code looks like : int CFtpClient::GetFile(char* szRemoteFile, char* szLocalFile,int iType, DWORD& dwLastError ) { dwLastError = 0; if (m_bActiveSession) { if (!FtpGetFile (m_hConnec...

Detecting the use of HRESULTs as bools

We have a big body of code that was refactored so that stuff which was plain-old C++ is now COM. I've been spending the last couple of days hunting out places in which we missed the fact that a function that previously returned a bool now returns an HRESULT (the problem is compound by the fact that S_OK == false). Is there a way to det...

How can I find out how many GDI objects my process is allowed to create?

There's a registry key where I can check (& set) the currently set GDI object quota for processes. However, if a user changes that registry key, the value remains the old value until a reboot occurs. In my program, I need to know if there's a way to determine, programatically, how many more GDI objects I can create. Is there an API for g...

Registry Defragmenter

Hello folks, This is out of curiosity, but I have seen several (and some of them very popular) software called registry defragmenter. While I can see the benefit they offer, but I am very curious on how exactly do you do registry defragmenting? Note that I'm not asking for software name, just a basic description of how it's done program...

Problems getting capVideoStreamCallback and WM_CAP_SET_CALLBACK_VIDEOSTREAM to work

I've got a simple VB.NET app that captures video from a Webcam and saves it to a file using avicap32.dll. I've also one callback working that handles capStatusCallback. My next step is set up the capVideoStreamCallback callback so I can do things with individual frames as they're captured. I'm just going to show the code for the video...

how to send key's to any application that is currently running from background program (c++)

Hello everyone, my question is how to send some key's to any application from application that is running in background? Let's say that I made shortcut to LEFT ARROW key which is ALT+S, and than I want whenever I'm in any application and when I press ALT+S that background application response that shortcut and send to currently opened pr...

How to get fileindex without using file handle?

The function GetFileInformationByHandle gives us a structure with the values nFileIndexHigh and nFileIndexLow which comprise of a fileIndex. What is this number? Is it the same as the USN? Is there a way to get this fileIndex of a file without opening it (any other method except GetFileInformationByHandle)? ...

Win32 programming question

I have a tab-based application for windows, which I am developing by myself. I would like to add a subtle gradient to the background of my tab control. How would I go around doing this? What is the best method for me to use? I think that implementing a custom control that takes up the space of the tab control would work, but how would ...

which is fastest win32 or SQL query?

Hi, I'm writing a client-server win32 application in Delphi 7 and in a section i need to bring aprox. 100k (less or more) rows with data from an Oracle database. Everything ok so far, but one of the fields must be calculated (a simple division with a large number). My question is, how is less resources consuming and optimum, to make th...

Closing 2 secondery delphi forms with 'caFree' causes the Main Form to lose focus

Showing 2 secondary forms from the main form and then closing both forms will cause the main form to lose focus. (another application gets activated instead of mine) The secondary forms are created either by the Main Form directly or by creating the third form from the second form. The secondary forms set caFree in the OnClose event: ...

How do I make my application use the Windows theme?

I'm working with some windows API to create a little application. I already created the buttons, windows, alright. But the problem is the components I created don't look like the OS theme. They look very simple: See the button as example. How do I enable the Windows theme? It can be in C or Delphi. ...

Trick Windows To See Second Monitor

Hi there, is there anyway to trick windows into thinking that a second monitor is connected to the computer, even if there isnt one? Example: Laptop also has an external screen connected into it. The external screen is the primary screen. When the screen is disconnected the laptop becomes primary even if the external screen is reconne...