Type a page name and press Enter. You'll jump to the page if it exists, or you can create it if it doesn't.
To create a page in a module other than user32, prefix the name with the module name and a period.
<DllImport("user32.dll", SetLastError:=True)> _
Private Shared Function LoadImage(ByVal hInst As IntPtr, ByVal lpszName As String, ByVal uType As UInt32, _
ByVal cxDesired As Integer, ByVal cyDesired As Integer, ByVal fuLoad As UInt32) As IntPtr
End Function
C++/CLI Signature:
[DllImportAttribute("user32.dll", SetLastError = true, CharSet = CharSet::Auto)]
extern "C" int LoadImage(int hinst, int lpszName, unsigned int uType, int cxDesired, int cyDesired, unsigned int fuLoad);
C++/CLI: This solution allows you to load an image from an unmanaged resource in the assembly. In my case I added a .cur file to my .rc. The cursor had an ID of 101. After loading the cursor I assigned it to the Forms::Cursor.
Tips & Tricks:
Please add some!
Sample Code:
Please add some!
C++/CLI Example
using namespace System::Runtime::InteropServices;
using namespace System::Windows::Forms;
using namespace System::Reflection;
int a = LoadImage(Marshal::GetHINSTANCE(Assembly::GetExecutingAssembly()->GetModules()[0]).ToInt32(),101,2,0,0,0);
this->Cursor = gcnew ::Cursor(IntPtr(a));
helpful tips or sample code to share for using this API in managed code?
corrections to the existing content?
variations of the signature you want to share?
additional languages you want to include?
Select "Edit This Page" on the right hand toolbar and edit it! Or add new pages containing supporting types needed for this API (structures, delegates, and more).