WinAPI Wrapper for GetOpenFileName

Shell32.dll provides an undocumented API that wraps around a call to GetOpenFileName called GetFileNameFromBrowse we’ll have to get the call pointer using GetProcAddress, quite easy to use! 😉 Well I can see the documentation in MSDN but can’t find the prototype in any of the header file in my SDK folder, so till then GetProcAddress is […]
Continue reading…

 

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…

 

Showing “Select Computer” dialog, with all network computers listed out!

Ever seen that “Select Computer” dialog coming up and did you wonder how to have all those computer names without writing much code. There is an undocumented exported api in “ntlanman.dll” called ServerBrowseDialogA0 which is used exactly for this purpose. [sourcecode language=’cpp’]int main() { // Some funky stuff     HMODULE hMod = LoadLibrary( “Kernel32.dll” );     […]
Continue reading…

 

Changing console application window icon at runtime!

Bored with the old black icon that you have on the main window. Here is a way to change it. There is an undocumented API called SetConsoleIcon and it’s in Kernel32.dll.  Here is how we use it… [sourcecode language=’cpp’]void ChangeIcon( const HICON hNewIcon ) {  // Load kernel 32 library  HMODULE hMod = LoadLibrary( _T( […]
Continue reading…