Changing IP Address of a machine!

To change ip address of a machine use SetAdapterIpAddress. It’s an undocumented API found in iphlpapi.dll. Function signature is as follows… [sourcecode language=’cpp’]DWORD SetAdapterIpAddress( char *pszAdapGUID,                            DWORD dwDHCP,                            DWORD dwIP,                            DWORD dwMask,                            DWORD dwGateway );[/sourcecode] Look here for a demo, it’s in Russian but code is in english 😉
Continue reading…

 

How to get color of a pixel from any Bitmap?

It’s easy to get color of a pixel from a bitmap. Here is a function which does this… [sourcecode language=’cpp’]#include #include // Returns Pixel color from bitmap COLORREF GetPixelValueFromBitmap( const int x, const int y, CBitmap& bmp ) { // DC for desktop CDC dcDesktop; dcDesktop.Attach( ::GetDC( GetDesktopWindow() )); // Create a DC compatible with […]
Continue reading…