winapi

F# syntax for P/Invoke signature using MarshalAs

I'm unsure of the syntax for this. I'm trying to translate this C# code into F#. struct LASTINPUTINFO { public uint cbSize; public uint dwTime; } public class IdleTimer { [DllImport("User32.dll")] [return: MarshalAs(UnmanagedType.Bool)] private static extern bool GetLastInputInfo(ref LASTINPUTINFO plii); } This i...

Redirect stdout to an edit control (Win32)

Hello, I have a simple Win32 GUI app which has an edit control in the main window. If I write: printf("Hello world!\n"); I would like the text to appear in that control instead of the console. How to? Update: The app is just simple window with edit control and I can compile it with or without displaying the console (gcc -mwindows). ...

How do I make Perl scripts recognize parameters in the Win32 cmd console?

When I invoke my Perl scripts in the Windows environment without invoking perl first, the parameters are not passed to my script. For example, C:\> C:\my-perl-scripts\foo.pl bar invokes foo.pl but doesn't recognize bar as a parameter (@ARGV is empty). However, C:\> perl C:\my-perl-scripts\foo.pl bar works as expected. Is this a ...

C# Win32 - Missing something for big

Hi all! it's a very newbie question but after 3 hours of looking after it i'm done with google-ing for today....i'm using a code i've found and it uses Win32, it's says "The Name 'Win32' does not exists in the current content" - what am i missing? how to call\declare win32?? Thank you all, Amit. public class TransparentTextBox : TextB...

Force showing system tray notification balloons

Hello, My application (C++ WinAPI) creates an icon in the system tray. I have set a tooltip text for this icon, so that when a user places a mouse cursor over the icon, this text shows. But I want to programmatically show different balloon notications when certan events occur and at the same time keep that behavior of showing the const...

Modify dll exports (symbol table). I want to obfuscate the function names.

I have a third party dll that I want to change the symbol names. Is this possible? I dont want the competition to know what component my product uses. I don't have the source for the dll. ...

C# Detect Desktop Folder Mouse-Up during a Drag operation ?

< I have reviewed the "related questions" shown by SO before posting this > Scenario : Drag and drop initiated from a control within a WinForm. note : all drag and drop code validated, carefully tested. I can use the code right now to create/write a file to the Desktop when the mouse is released. Drag goes outside the Form, mouse goe...

WIN32 keyboard question - not recognizing windows mobile keys

HI I'm developing in the WIN32 environment, for windows mobile, and experiencing a few problems - I have keys that have both numbers and letters, but no matter if i press the 'function' key i always get the numbers my program does not recognize * and # clicks. Debugging it, i got to the WndProc method, which was registered in the MyReg...

How do I know the size of a HCURSOR object

I want to get the height and width of a .cur file without look into its format. I try to use LoadCursorFromFile() to get a HCURSOR, I suppose there is a API function to obtain the HCURSOR infos, but I find that GetCursorInfo() is not I want at all. Is there any way to get the height and width of a HCURSOR object? ...

Adding functionality to a handle wrapper.

I have a C++ RAII class for managing Win32 HANDLEs using boost::shared_ptr<> that looks a bit like this: namespace detail { struct NoDelete { void operator()( void* ) {}; }; }; // namespace detail template< typename HANDLE_TYPE, typename HANDLE_DELETER > class CHandleT { public : explicit CHandleT( HANDLE_TYPE handle, bool delete_o...

Win32:Process SetProcessAffinityMask crashes my Perl

I have a Perl script running that acts like a service, one of the things I do with it is use it to spawn other processes. Some of these processes are executables and some are perl scripts. At times I want to set the processor affinity on some these processes. I use SetProcessAffinityMask to do this, for the executables everything wo...

How long does CreateThread take to execute?

I am reviewing code which creates a lot of threads. CreateThread documentation on Windows says that a all thread creation calls are serialized within a process. To estimate the performance impact of such code, I wonder how long does CreateThread take to run? I understand this depends on the number of DLLs already loaded into the process,...

What are must-have free/gnu/open-source orignal/ported develop-related tools under windows?

I'll start with GNU utilities for Win32. Per tool per post please. thanks. ...

Zip And Unzip files and folders

I need to zip and unzip the directory hirarchy in Windows Mobile using C++/C#. What is the simplest library available for it? I have googled many times. I found some stuff, but I am not able to go ahead with it. If you have implemented or if you know some stuff about it please let me know. ...

Handling multiple windows WIN32 API

HI I'm trying to create an application in the Win32 environment containing more than one window. How do i do that? all the Win32 Tutorials on web i found only showed how to manage one window. How do i create the second window, and how do i handle messages for both of them together? (i understood i'm supposed to have only one message loop...

COM Basic links

Hi, folks can you provide me the tutorial link or .pdf for learning basic COM?. i do google it.. still i recommend answers of stackoverflow so please pass me.. Thanks ...

Win32 , WndProc, and parent-child windows

Hi - I'm developing in C code that uses the Win32 Api to create multiple windows. I used createWindow twice - to create parent and child windows. i have a message loop while ( GetMssage (&msg, NULL,0,0)){ . translate dispatch . } But i only get the WND_Proc function called once, instead of twice for each of the windows. What am i d...

CreateWindow Win32 API problem - Only parent window gets

Hi. I asked a question, and some people commented that my question wasn't clear, So here is a new one. I'm trying to create an application with multiple windows using the WIN32 API. I created two windows, one is a child of the parent. Then i have a message loop, But unfortunately only the parent WndProc gets message, while the child ...

enumthreadwindows in c#

all day I'm trying to get EnumThreadWindows working, but I always get a Wrong Parameter-Error although my code is nearly the same as on pinvoke.net!! dont know why this doesnt work: public static IntPtr FindMsgBoxFrom(IntPtr MainHWND) { SetLastError(0); uint ThreadID = GetThreadID(MainHWND); E...

Edit_SetInputMode, win32 API

Hi, I'm trying to change the input mode to a given window. Searching i found the Edit_SetInputMode function, but when i run it, it always returns 0 ( fails) . The MSDN documentation doesn't seem be to revealing... Any ideas anyone Thank you Dan ...