winapi

Firewall start/stop using win32 api for windows XP os

I am trying to start and stop the firewall in Windows XP using the win32 api for changing settings in the registry, i.e HKEY_LOCAL_MACHINE\SYSTEM\CurrentControlSet\Services\SharedAccess\Parameters\FirewallPolicy\StandardProfile. I am trying to change a data value but it's not changing. So can tell me any other way how I can stop the fire...

How to find the menu item (if any) which opens a given HMENU when activated?

I'd like to implement a function with the prototype /* Locates the menu item of the application which caused the given menu 'mnu' to * show up. * @return true if the given menu 'mnu' was opened by another menu item, false * if not. */ bool getParentMenuItem( HMENU mnu, HMENU *parentMenu, int *parentMenuIdx ); Given a HMENU handle,...

Creating a single exe file from Python code

Possible Duplicate: py2exe - generate single executable file A friend of mine managed to pack some a Ruby script he wrote in a single exe file. When I tried to do the same thing for a Python script, with py2exe, I also got several pyd files and a dll. Is it possible to pack a Python script with all it's DLL's and pyd files int...

Center subitem Icon in ListView

I would like to center the icon in one of my columns. The way I currently add icons is by calling the AddIconToSubitem method after the row has been created. How would I modify my custom control to also center the icon? Thanks Public Class ListViewSubIcons : Inherits System.Windows.Forms.ListView Public Declare Function SendMes...

Win32 API for getting the language(localization info) of the OS??

Can anybody please help me with how to get the language(english,chinese etc) of Windows OS through win32 API(C/C++)?? Thanks, Sourabh ...

How to create a new port and assign it to a printer

We have a virtual printer (provided by a 3rd party) that is getting assigned to an invalid local printer port. The printer is always local (we aren't dealing with a remote print server or anything like that). I'd like to create a new local port (specific for our application), then configure the printer to be assigned to that port inste...

Dropdown height bug in CComboBox (common controls 6.0)?

I've made a simple MFC application (Visual Studio 2008, dialog based) and added a CComboBox using the resource editor. I used the resource editor to specify the dropdown height. Then I added some code to add 100 texts to the combobox. If I run this simple application the dropdown height is ignored. If I disable the Microsoft.Windows.Com...

Globally intercept window movement

I am having trouble getting a global system hook to work. I want to be notified whenever a window is moving, as early as possible, and change the window size. This means the CBT hook HCBT_MOVESIZE won't cut it, it only happens after the window has been moved. I want to hook the actual movement of the window, and be able to change the win...

How does spy++ find out what is the window at a certain point on the screen?

I am curious how spy++ Finder Tool finds out the window handle for the window over which the mouse is. Is there any WIN32 function for getting the handle of the topmost window that occupies a certain pixel on the display? ...

native win32 gui programming in c++ or choose wxWidgets ?

Hello all i like to write GUI software ( i have no experience in GUI programming ) i need it to be small as possible and fast GUI and native Look and Feel in one self contained exe . only on windows from windows 2000 to windows 7 ( or what ever it called ) . what will be the best choice ? win32 api or wxWidgets? ...

window through Win32 API (menu creation) in VC++

I am trying to add menus to a window created in win32 API through VC++. This program generates two errors which I am not able to fix. The code as following. GENERIC.H #define IDM_EXIT 100 #define IDM_TEST 200 #define IDM_ABOUT 300 LRESULT CALLBACK WndProc(HWND, UINT, WPARAM, LPARAM); LRESULT CALLBACK About (HWND, UINT, WPARAM, LPARAM...

How do I print to the debug output window in a Win32 app?

I've got a win32 project that I've loaded into Visual Studio 2005. I'd like to be able to print things to the Visual Studio output window, but I can't for the life of me work out how. I've tried 'printf' and 'cout <<' but my messages stay stubbornly unprinted. Is there some sort of special way to print to the Visual Studio output window...

How to get tooltip text for a given HWND?

I'm looking for a way to get the tooltip control (if any) which is associated with a given HWND. The text of the tooltip control would be sufficient, too. The closest thing I found is the TTM_GETTEXT message, but it's meant to be sent to the tooltip control itself instead of the tool it's associated with. I don't have a handle to the too...

How can I make a file trully immutable (non-deletable and read-only)?

I need to make a file truly read only - to keep it as is. No delete, no nothing. (Setting the 'ReadOnly' attribute isn't an option) I see now some approaches: Use a program to keep the file open. Drawback: One can kill the process an then the file closes. Use a program to set the security attributes. Drawback: The file can be deleted...

Request suspend on Vista but allow other applications to cancel

My application uses the Win32 SetSuspendState() API to trigger system suspend or hibernation when it has finished doing a lengthy task. The API accepts a parameter "ForceCritical" which determines whether or not the system suspends immediately or whether it broadcasts PBT_APMQUERYSUSPEND first to allow other apps the chance to cancel th...

FindFirstFile and FindNextFile question

Output: The first file found is LOG_09.TXT Next file name is LOG_10.TXT Next file name is LOG_11.TXT Next fi (cut off word "file"?) Function: //Find last modified log file hFind = FindFirstFile("..\\..\\LOGS\\LOG*.TXT", &FindFileData); if (hFind == INVALID_HANDLE_VALUE) { printf ("FindFirs...

WINE error when running windows application

Hello, A user reports that one of our applications doesn't work under WINE. It runs until he proceeds past a certain form, and then freezes. WINE gives the following output: ~/.wine/drive_c/HeroLab$ wine HeroLab.exe fixme:wininet:InternetSetOptionW Option INTERNET_OPTION_CONNECT_TIMEOUT (30000): STUB fixme:wininet:InternetSetOptionW IN...

Authenticating users using Active Directory in Client-Server Application

I've been asked to provide support for authenticating users against an Active Directory in our existing client server application. At the moment a user supplies a user name and password from a client machine, passed over the wire (encrypted) to our server process and matched against a user name/password stored in a database. Initiall...

Console Slow to Appear While Debugging

I have a small Win32 console application and when executing from the debugger the console takes about five seconds to appear. If I place a breakpoint on the last line of main, the break point is hit immediately, so the application is already finished but the console does not appear for about five seconds. I have removed all my breakpoint...

How can I run an executable from RAM using C++?

How can I run an executable from RAM using C++? The executable is in RAM, and I know the address, how do I call into the program from mine? ...